diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index ded87d02..e954ea63 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -67,7 +67,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; - (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + (* C default expression integral size details. Const for now, should be var for avr_gcc/sdcc support *) CIntSize* = 4; CIntMax* = 7FFFFFFFH; CIntMin* = -CIntMax - 1; @@ -88,12 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) SourceFileName : ARRAY 256 OF CHAR; (* Parameter selectable sizes *) - Alignment*, - AddressSize*, SetSize*, + AddressSize*, Alignment*, + SetSize*, ShortintSize*, IntegerSize*, LongintSize*: INTEGER; MaxSet*: INTEGER; - MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -110,7 +109,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: SYSTEM.INT64; + lasterrpos: LONGINT; inR: Texts.Reader; Log: Texts.Text; W: Texts.Writer; @@ -479,7 +478,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ShowLine; - PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); + PROCEDURE Mark*(n: INTEGER; pos: LONGINT); BEGIN IF pos = -1 THEN pos := 0 END; IF n >= 0 THEN @@ -853,6 +852,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseFiles; + + +PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; + BEGIN Texts.OpenWriter(W); @@ -867,9 +870,9 @@ BEGIN Files.SetSearchPath(OBERON); - (* type sizes with configuration based defaults *) - AddressSize := Configuration.addressSize; - Alignment := Configuration.alignment; + (* Default address size and alignment are those of this compiler *) + AddressSize := SIZE(SYSTEM.ADDRESS); + GetAlignment(Alignment); (* Default type size model is that of the original Oberon-2 implementation (-O2) *) ShortintSize := 1; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index b6ca8bf2..a898c9a4 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -96,7 +96,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) extTools.Assemble(OPM.modName) ELSE IF ~(OPM.mainprog IN OPM.opt) THEN - (* Assemble non main rogram and add object name to link list *) + (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); Strings.Append(OPM.modName, modulesobj); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index c000b68b..936c71bb 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -401,15 +401,11 @@ void writeConfigurationMod() { fprintf(fd, "MODULE Configuration;\n"); fprintf(fd, "CONST\n"); fprintf(fd, " name* = '%s';\n", oname); - fprintf(fd, " intsize* = %d;\n", intsize); - fprintf(fd, " addressSize* = %d;\n", addressSize); - fprintf(fd, " alignment* = %d;\n", alignment); fprintf(fd, " objext* = '%s';\n", objext); fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " compile* = '%s';\n", cc); - fprintf(fd, " dataModel* = '%s';\n", dataModel); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, "VAR\n");