From 60df39cb6b1db20bae7445967ffca93172771b9c Mon Sep 17 00:00:00 2001 From: runkharr Date: Thu, 12 Apr 2018 22:07:05 +0200 Subject: [PATCH] src/compiler/OPT.Mod: Fixed some typos ... src/tools/make/configure.c: Fixed a typo. Reduced the value of 'MaxPathLen' for the generated 'Configuration.Mod' by one for consistency with 'MaxFnLen' - meaning, the constant SYSTEM.MAXPATHLEN now doesn't count the terminating 0X. This is no problem, because corresponding array definitions may use the constant expression 'SYSTEM-MAXPATHLEN + 1' for achieving the same effect ... --- src/compiler/OPT.Mod | 6 +++--- src/tools/make/configure.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 737e5040..403e0377 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1315,7 +1315,7 @@ END Import; BEGIN Insert(name, obj); obj^.conval := NewConst(); obj^.mode := Con; obj^.typ := int32typ; obj^.conval^.intval := value; - END EntarIntConst; + END EnterIntConst; PROCEDURE EnterTyp(name: OPS.Name; form: SHORTINT; size: INTEGER; VAR res: Struct); VAR obj: Object; typ: Struct; @@ -1375,8 +1375,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("MOVE", movefn); (* POSIX systems normally support PATH_MAX *) - EnterIntConst("MAXPATHLEN", Configuration.MaxPathLen); - EnterIntConst("MAXFILENAMELENGTH", Configuration.MaxFnLen); + EnterIntConst("MAXPATHLEN", Configuration.MaxPathLen); (*PATH_MAX - 1*) + EnterIntConst("MAXFILENAMELEN", Configuration.MaxFnLen); (*NAME_LEN*) syslink := topScope^.right; universe := topScope; topScope^.right := NIL; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index df6c6204..f648c5c3 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -402,8 +402,8 @@ void writeConfigurationMod() { fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); - fprintf(fd, " MaxPathLen* = %d;\n", PATH_MAX); - fprintf(fd " MaxFnLen* = %d;\n", NAME_MAX); + fprintf(fd, " MaxPathLen* = %d;\n", PATH_MAX-1); // -1 for more consistency + fprintf(fd, " MaxFnLen* = %d;\n", NAME_MAX); fprintf(fd, "VAR\n"); fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1); fprintf(fd, "BEGIN\n");