From: DeaDDooMER Date: Wed, 9 Aug 2017 18:11:58 +0000 (+0300) Subject: Изменены размеры примитивных типов X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=776edd758b261bd4f7c5c7cd758edef40e8b4f64;p=dsw-obn.git Изменены размеры примитивных типов --- diff --git a/Out.obn b/Out.obn index dce767c..9a923c2 100644 --- a/Out.obn +++ b/Out.obn @@ -9,7 +9,7 @@ END Char; PROCEDURE String*(str : ARRAY OF CHAR); END String; -PROCEDURE Int*(i, n : LONGINT); +PROCEDURE Int*(i : HUGEINT; n : INTEGER); END Int; PROCEDURE Real*(x : REAL; n : INTEGER); diff --git a/rtl/Out.java b/rtl/Out.java index 429d321..9989977 100644 --- a/rtl/Out.java +++ b/rtl/Out.java @@ -22,17 +22,17 @@ public class Out System.out.write(str, 0, i); } - public static void Int(long i, long n) + public static void Int(long i, short n) { System.out.print(i); } - public static void Real(float x, int n) + public static void Real(float x, short n) { System.out.print(x); } - public static void LongReal(double x, int n) + public static void LongReal(double x, short n) { System.out.print(x); } diff --git a/rtl/System.java b/rtl/System.java index 08411e7..d2ccf9b 100644 --- a/rtl/System.java +++ b/rtl/System.java @@ -1,6 +1,6 @@ public class System { - public static void Halt(int n) + public static void Halt(short n) { java.lang.System.exit(n); } diff --git a/src/oberon.c b/src/oberon.c index cf1a570..bf5dad8 100644 --- a/src/oberon.c +++ b/src/oberon.c @@ -3751,17 +3751,20 @@ register_default_types(oberon_context_t * ctx) ctx -> bool_type = oberon_new_type_boolean(); oberon_define_type(ctx -> world_scope, "BOOLEAN", ctx -> bool_type, 1); + ctx -> char_type = oberon_new_type_char(1); + oberon_define_type(ctx -> world_scope, "CHAR", ctx -> char_type, 1); + ctx -> byte_type = oberon_new_type_integer(1); - oberon_define_type(ctx -> world_scope, "BYTE", ctx -> byte_type, 1); + oberon_define_type(ctx -> world_scope, "SHORTINT", ctx -> byte_type, 1); ctx -> shortint_type = oberon_new_type_integer(2); - oberon_define_type(ctx -> world_scope, "SHORTINT", ctx -> shortint_type, 1); + oberon_define_type(ctx -> world_scope, "INTEGER", ctx -> shortint_type, 1); ctx -> int_type = oberon_new_type_integer(4); - oberon_define_type(ctx -> world_scope, "INTEGER", ctx -> int_type, 1); + oberon_define_type(ctx -> world_scope, "LONGINT", ctx -> int_type, 1); ctx -> longint_type = oberon_new_type_integer(8); - oberon_define_type(ctx -> world_scope, "LONGINT", ctx -> longint_type, 1); + oberon_define_type(ctx -> world_scope, "HUGEINT", ctx -> longint_type, 1); ctx -> real_type = oberon_new_type_real(4); oberon_define_type(ctx -> world_scope, "REAL", ctx -> real_type, 1); @@ -3769,9 +3772,6 @@ register_default_types(oberon_context_t * ctx) ctx -> longreal_type = oberon_new_type_real(8); oberon_define_type(ctx -> world_scope, "LONGREAL", ctx -> longreal_type, 1); - ctx -> char_type = oberon_new_type_char(1); - oberon_define_type(ctx -> world_scope, "CHAR", ctx -> char_type, 1); - ctx -> set_type = oberon_new_type_set(4); oberon_define_type(ctx -> world_scope, "SET", ctx -> set_type, 1); }