Bläddra i källkod

use WORD instead of LONGINT for result type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8455 8c9fc860-2736-0410-a75d-ab315db34111
eth.metacore 6 år sedan
förälder
incheckning
52b9259697

+ 2 - 2
source/Caches.Mod

@@ -93,7 +93,7 @@ TYPE
 		(** Synchronize all momentarily dirty buffers that are not locked. *)
 		(** Synchronize all momentarily dirty buffers that are not locked. *)
 
 
 		PROCEDURE Synchronize*;
 		PROCEDURE Synchronize*;
-		VAR list, buf: Buffer; res, num, count: LONGINT;
+		VAR list, buf: Buffer; res: WORD; num, count: LONGINT;
 		BEGIN
 		BEGIN
 			AcquireDirty(list); count := 0;
 			AcquireDirty(list); count := 0;
 			WHILE list # NIL DO
 			WHILE list # NIL DO
@@ -210,7 +210,7 @@ TYPE
 
 
 (* Report an error during asynchronous disk access. *)
 (* Report an error during asynchronous disk access. *)
 
 
-PROCEDURE ReportError(dev: Disks.Device; block, num, res: LONGINT);
+PROCEDURE ReportError(dev: Disks.Device; block, num: LONGINT; res: WORD);
 BEGIN
 BEGIN
 	KernelLog.Enter; KernelLog.String("Caches: Error "); KernelLog.Int(res, 1);
 	KernelLog.Enter; KernelLog.String("Caches: Error "); KernelLog.Int(res, 1);
 	KernelLog.String(" on disk "); KernelLog.String(dev.name); KernelLog.Int(num, 1);
 	KernelLog.String(" on disk "); KernelLog.String(dev.name); KernelLog.Int(num, 1);

+ 1 - 1
source/Configuration.Mod

@@ -123,7 +123,7 @@ BEGIN
 END GetBoolean;
 END GetBoolean;
 
 
 PROCEDURE GetColor*(CONST key : ARRAY OF CHAR; VAR value : LONGINT; VAR res : WORD);
 PROCEDURE GetColor*(CONST key : ARRAY OF CHAR; VAR value : LONGINT; VAR res : WORD);
-VAR string : ARRAY 16 OF CHAR; tempres : LONGINT;
+VAR string : ARRAY 16 OF CHAR; tempres : WORD;
 BEGIN
 BEGIN
 	Get(key, string, res);
 	Get(key, string, res);
 	IF (res = Ok) THEN
 	IF (res = Ok) THEN

+ 2 - 2
source/ContextualDependency.Mod

@@ -999,7 +999,7 @@ TYPE
 		(* Parses a range string and puts the ranges into a range array *)
 		(* Parses a range string and puts the ranges into a range array *)
 		PROCEDURE ParseRangeString(rangeString : XML.String; base16, neg : BOOLEAN; VAR ranges : Ranges);
 		PROCEDURE ParseRangeString(rangeString : XML.String; base16, neg : BOOLEAN; VAR ranges : Ranges);
 		VAR
 		VAR
-			numberOfRanges, i, j, k, res : LONGINT;
+			numberOfRanges, i, j, k: LONGINT; res : WORD;
 			tempString : XML.String;
 			tempString : XML.String;
 			range : Range;
 			range : Range;
 			theseRanges, oldRanges : RangeArray;
 			theseRanges, oldRanges : RangeArray;
@@ -1285,7 +1285,7 @@ VAR
 	tagName, languageAttribute, baseAttribute : XML.String;
 	tagName, languageAttribute, baseAttribute : XML.String;
 	base16, propertyFound : BOOLEAN;
 	base16, propertyFound : BOOLEAN;
 
 
-	rangeLow, rangeHigh, res : LONGINT;
+	rangeLow, rangeHigh: LONGINT; res: WORD;
 	mode, tempRangeLow, tempRangeHigh : Strings.String;
 	mode, tempRangeLow, tempRangeHigh : Strings.String;
 BEGIN
 BEGIN
 	propertyFound := FALSE;
 	propertyFound := FALSE;

+ 3 - 3
source/DiskFS.Mod

@@ -575,7 +575,7 @@ TYPE
 		END Init;
 		END Init;
 
 
 		PROCEDURE New0*(name: ARRAY OF CHAR): Files.File;
 		PROCEDURE New0*(name: ARRAY OF CHAR): Files.File;
-		VAR i, res: LONGINT; f: File; buf: Buffer; head {UNTRACED}: POINTER {UNSAFE} TO FileHeader; namebuf: FileName;
+		VAR i: LONGINT; res: WORD; f: File; buf: Buffer; head {UNTRACED}: POINTER {UNSAFE} TO FileHeader; namebuf: FileName;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
 			f := NIL; Check(name, namebuf, res);
 			IF res <= 0 THEN
 			IF res <= 0 THEN
@@ -599,7 +599,7 @@ TYPE
 
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		VAR
 		VAR
-			i, k, res: LONGINT; f: File; header: DiskAdr; buf: Buffer; head {UNTRACED}: POINTER {UNSAFE} TO FileHeader;
+			i, k: LONGINT; res: WORD; f: File; header: DiskAdr; buf: Buffer; head {UNTRACED}: POINTER {UNSAFE} TO FileHeader;
 			namebuf: FileName; super: SuperIndex; sub: SubIndex; sec: IndexSector;
 			namebuf: FileName; super: SuperIndex; sub: SubIndex; sec: IndexSector;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
 			f := NIL; Check(name, namebuf, res);
@@ -637,7 +637,7 @@ TYPE
 			RETURN f
 			RETURN f
 		END Old0;
 		END Old0;
 
 
-		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key, res: LONGINT);
+		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key: LONGINT; VAR res: WORD);
 		VAR adr: DiskAdr; namebuf: FileName; head: FileHeader;
 		VAR adr: DiskAdr; namebuf: FileName; head: FileHeader;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			Check(name, namebuf, res);
 			Check(name, namebuf, res);

+ 5 - 5
source/DiskVolumes.Mod

@@ -37,7 +37,7 @@ TYPE
 
 
 		(** Get block from adr [1..size] of volume vol *)
 		(** Get block from adr [1..size] of volume vol *)
 		PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
 		PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-		VAR res, block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
+		VAR res: WORD; block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -59,7 +59,7 @@ TYPE
 
 
 		(** Put block to adr [1..size] of volume vol *)
 		(** Put block to adr [1..size] of volume vol *)
 		PROCEDURE PutBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
 		PROCEDURE PutBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-		VAR res, block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
+		VAR res: WORD; block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -84,7 +84,7 @@ TYPE
 
 
 		(** Finalize a volume and close its device. *)
 		(** Finalize a volume and close its device. *)
 		PROCEDURE Finalize*;
 		PROCEDURE Finalize*;
-		VAR res, i, j: LONGINT; ptable: Disks.PartitionTable;
+		VAR res: WORD; i, j: LONGINT; ptable: Disks.PartitionTable;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF cache # NIL THEN cache.Synchronize; cache := NIL END;
 			IF cache # NIL THEN cache.Synchronize; cache := NIL END;
 			i := 0; j := -1; ptable := dev.table;	(* todo: fix race! *)
 			i := 0; j := -1; ptable := dev.table;	(* todo: fix race! *)
@@ -111,7 +111,7 @@ BEGIN
 END Get4;
 END Get4;
 
 
 (* Get the file system parameters by reading the boot block. The pstart and psize parameters are the partition start and size in device blocks (size 512 or 2048).  The startfs parameter returns the offset of the file system from the start of the disk in device blocks.  The size parameter returns the size of the file system in volume blocks.  The vbs parameter returns the volume block size of the file system (4096 for AosFS, 2048 for NatFS). *)
 (* Get the file system parameters by reading the boot block. The pstart and psize parameters are the partition start and size in device blocks (size 512 or 2048).  The startfs parameter returns the offset of the file system from the start of the disk in device blocks.  The size parameter returns the size of the file system in volume blocks.  The vbs parameter returns the volume block size of the file system (4096 for AosFS, 2048 for NatFS). *)
-PROCEDURE GetOberonFS(dev: Disks.Device; pstart, psize: LONGINT; VAR startfs, size, vbs, res: LONGINT);
+PROCEDURE GetOberonFS(dev: Disks.Device; pstart, psize: LONGINT; VAR startfs, size, vbs: LONGINT; VAR res: WORD);
 CONST FSID = 21534F41H; FSVer = 2; AosSS = 4096; NSS = 2048;
 CONST FSID = 21534F41H; FSVer = 2; AosSS = 4096; NSS = 2048;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 BEGIN
 BEGIN
@@ -227,7 +227,7 @@ END InitVol;
 (* Try to open the specified volume.  Sets p.vol # NIL on success. *)
 (* Try to open the specified volume.  Sets p.vol # NIL on success. *)
 
 
 PROCEDURE TryOpen(context: Files.Parameters; dev: Disks.Device; part, dbs: LONGINT; readonly: BOOLEAN);
 PROCEDURE TryOpen(context: Files.Parameters; dev: Disks.Device; part, dbs: LONGINT; readonly: BOOLEAN);
-VAR vol: Volume; startfs, size, vbs, res: LONGINT; ptable: Disks.PartitionTable;
+VAR vol: Volume; startfs, size, vbs: LONGINT; res: WORD; ptable: Disks.PartitionTable;
 BEGIN
 BEGIN
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");

+ 5 - 5
source/Disks.Mod

@@ -65,7 +65,7 @@ TYPE
 			res := Unsupported
 			res := Unsupported
 		END Transfer;
 		END Transfer;
 
 
-		PROCEDURE GetSize*(VAR size, res: LONGINT);
+		PROCEDURE GetSize*(VAR size: LONGINT; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Unsupported
 			res := Unsupported
 		END GetSize;
 		END GetSize;
@@ -78,7 +78,7 @@ TYPE
 		(** Open the device and increment its open count if successful. If the device is opened for the first time, lock it and update its partition table. *)
 		(** Open the device and increment its open count if successful. If the device is opened for the first time, lock it and update its partition table. *)
 
 
 		PROCEDURE Open*(VAR res: WORD);
 		PROCEDURE Open*(VAR res: WORD);
-		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: LONGINT;
+		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: WORD;
 		BEGIN
 		BEGIN
 			res := Ok;
 			res := Ok;
 			IF openCount = 0 THEN
 			IF openCount = 0 THEN
@@ -182,7 +182,7 @@ END ValidFlag;
 
 
 (* Read primary partition table entries into p *)
 (* Read primary partition table entries into p *)
 
 
-PROCEDURE ReadPrimary(VAR b: DiskBlock; dev: Device;  VAR p: PartitionTable;  VAR n, res: LONGINT; VAR valid: BOOLEAN);
+PROCEDURE ReadPrimary(VAR b: DiskBlock; dev: Device;  VAR p: PartitionTable;  VAR n: LONGINT; VAR res: WORD; VAR valid: BOOLEAN);
 VAR e, size, i: LONGINT;
 VAR e, size, i: LONGINT;
 BEGIN
 BEGIN
 	n := 0;
 	n := 0;
@@ -212,7 +212,7 @@ END ReadPrimary;
 
 
 (* Read "logical drive" partitions into p *)
 (* Read "logical drive" partitions into p *)
 
 
-PROCEDURE ReadLogical(VAR b: DiskBlock; dev: Device;  first: LONGINT;  VAR p: PartitionTable;  VAR n, res: LONGINT);
+PROCEDURE ReadLogical(VAR b: DiskBlock; dev: Device;  first: LONGINT;  VAR p: PartitionTable;  VAR n: LONGINT; VAR res: WORD);
 VAR e, sec, size, i: LONGINT; found: BOOLEAN;
 VAR e, sec, size, i: LONGINT; found: BOOLEAN;
 BEGIN
 BEGIN
 	sec := first;
 	sec := first;
@@ -291,7 +291,7 @@ END UpdatePartitionTable;
 
 
 (* Clean up the installed devices. *)
 (* Clean up the installed devices. *)
 PROCEDURE Cleanup;
 PROCEDURE Cleanup;
-VAR dev: Plugins.Table; i, res: LONGINT; msg: ShutdownMsg;
+VAR dev: Plugins.Table; i: LONGINT; res: WORD; msg: ShutdownMsg;
 BEGIN
 BEGIN
 	registry.GetAll(dev);
 	registry.GetAll(dev);
 	IF dev # NIL THEN
 	IF dev # NIL THEN

+ 4 - 4
source/FATFiles.Mod

@@ -262,11 +262,11 @@ TYPE
 		END OldX;
 		END OldX;
 
 
 		(** Delete a file. res = 0 indicates success.  End users use Files.Delete instead. *)
 		(** Delete a file. res = 0 indicates success.  End users use Files.Delete instead. *)
-		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key, res: LONGINT);
+		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key: LONGINT; VAR res: WORD);
 		BEGIN {EXCLUSIVE} Delete0X(name, key, res)
 		BEGIN {EXCLUSIVE} Delete0X(name, key, res)
 		END Delete0;
 		END Delete0;
 
 
-		PROCEDURE Delete0X(name: ARRAY OF CHAR; VAR key, res: LONGINT);
+		PROCEDURE Delete0X(name: ARRAY OF CHAR; VAR key: LONGINT; VAR res: WORD);
 		VAR path, filename: Filename; dir: Directory; f: File; s: SearchByName; dcc: BOOLEAN;
 		VAR path, filename: Filename; dir: Directory; f: File; s: SearchByName; dcc: BOOLEAN;
 		BEGIN
 		BEGIN
 			res := ErrInvalidFilename; key := 0;
 			res := ErrInvalidFilename; key := 0;
@@ -461,7 +461,7 @@ TYPE
 		BEGIN INC(par(CountFiles).count); RETURN TRUE
 		BEGIN INC(par(CountFiles).count); RETURN TRUE
 		END RmDirCallback;
 		END RmDirCallback;
 
 
-		PROCEDURE RemoveDirectory0*(path: ARRAY OF CHAR; force: BOOLEAN; VAR key, res: LONGINT);
+		PROCEDURE RemoveDirectory0*(path: ARRAY OF CHAR; force: BOOLEAN; VAR key: LONGINT; VAR res: WORD);
 		VAR f: File; par: CountFiles; s: SearchByName; parent: Directory;
 		VAR f: File; par: CountFiles; s: SearchByName; parent: Directory;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (Files.ReadOnly IN vol.flags) THEN res := ErrReadOnly; RETURN END;
 			IF (Files.ReadOnly IN vol.flags) THEN res := ErrReadOnly; RETURN END;
@@ -671,7 +671,7 @@ TYPE
 		PROCEDURE ReadBuffer(buffer: Buffer; pos: LONGINT);
 		PROCEDURE ReadBuffer(buffer: Buffer; pos: LONGINT);
 		VAR
 		VAR
 			last: Address;
 			last: Address;
-			i, res: LONGINT;
+			i: LONGINT; res: WORD;
 			bp, bc, ctrlflow, stopc: LONGINT;
 			bp, bc, ctrlflow, stopc: LONGINT;
 		BEGIN
 		BEGIN
 			ASSERT(buffer.pos # pos);
 			ASSERT(buffer.pos # pos);

+ 8 - 8
source/FATVolumes.Mod

@@ -125,7 +125,7 @@ TYPE
 		END InitLowLevel;
 		END InitLowLevel;
 
 
 		PROCEDURE Finalize*;
 		PROCEDURE Finalize*;
-		VAR i, j, res: LONGINT; ptable: Disks.PartitionTable;
+		VAR i, j: LONGINT; res: WORD; ptable: Disks.PartitionTable;
 		BEGIN (* must be exclusive in overridden methods *)
 		BEGIN (* must be exclusive in overridden methods *)
 			quit := TRUE;
 			quit := TRUE;
 			timer.Wakeup;
 			timer.Wakeup;
@@ -191,7 +191,7 @@ TYPE
 		END InitCache;
 		END InitCache;
 
 
 		PROCEDURE FlushCache(cache: Cache);
 		PROCEDURE FlushCache(cache: Cache);
-		VAR i, firstDirty, lastDirty, adr, num, ofs, res: LONGINT; start: LONGINT;
+		VAR i, firstDirty, lastDirty, adr, num, ofs: LONGINT; res: WORD; start: LONGINT;
 		BEGIN
 		BEGIN
 			IF (cache # NIL) & cache.dirty THEN
 			IF (cache # NIL) & cache.dirty THEN
 				cache.dirty := FALSE;
 				cache.dirty := FALSE;
@@ -387,7 +387,7 @@ TYPE
 		END FreeClusterChain;
 		END FreeClusterChain;
 
 
 		PROCEDURE QuickFormat*;
 		PROCEDURE QuickFormat*;
-		VAR sec: ARRAY BS OF CHAR; i, res: LONGINT; entries: ARRAY 2 OF LONGINT;
+		VAR sec: ARRAY BS OF CHAR; i: LONGINT; res: WORD; entries: ARRAY 2 OF LONGINT;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			unsafe := TRUE; entries[0] := ReadFATEntryX(0);
 			unsafe := TRUE; entries[0] := ReadFATEntryX(0);
 			unsafe := TRUE; entries[1] := ReadFATEntryX(1);
 			unsafe := TRUE; entries[1] := ReadFATEntryX(1);
@@ -450,7 +450,7 @@ TYPE
 		END Initialize;
 		END Initialize;
 
 
 		PROCEDURE InitRoot;
 		PROCEDURE InitRoot;
-		VAR sec: ARRAY BS OF CHAR; i, res: LONGINT;
+		VAR sec: ARRAY BS OF CHAR; i: LONGINT; res: WORD;
 		BEGIN
 		BEGIN
 			FOR i := 0 TO numRootSectors-1 DO
 			FOR i := 0 TO numRootSectors-1 DO
 				WriteSectorX(firstRootSector + i, sec, 0, res) (* ignore res *)
 				WriteSectorX(firstRootSector + i, sec, 0, res) (* ignore res *)
@@ -476,7 +476,7 @@ TYPE
 		END Finalize;
 		END Finalize;
 
 
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
-		VAR offset, res: LONGINT;
+		VAR offset: LONGINT; res: WORD;
 			entry: Address;
 			entry: Address;
 			data: ARRAY 2*BS OF CHAR;
 			data: ARRAY 2*BS OF CHAR;
 		BEGIN
 		BEGIN
@@ -672,7 +672,7 @@ TYPE
 			fsInfo-: Address; 	(* sector number of FSInfo sector (relative to 'start') *)
 			fsInfo-: Address; 	(* sector number of FSInfo sector (relative to 'start') *)
 
 
 		PROCEDURE Initialize(VAR bpb: BPB; MaxClusters: LONGINT): BOOLEAN;
 		PROCEDURE Initialize(VAR bpb: BPB; MaxClusters: LONGINT): BOOLEAN;
-		VAR i, res: LONGINT; result: BOOLEAN; info: ARRAY BS OF CHAR; vcf: SET;
+		VAR i: LONGINT; res: WORD; result: BOOLEAN; info: ARRAY BS OF CHAR; vcf: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			result := FALSE;
 			result := FALSE;
 			IF Initialize^(bpb, MaxClusters) THEN	(* see note in Volumes.Initialize *)
 			IF Initialize^(bpb, MaxClusters) THEN	(* see note in Volumes.Initialize *)
@@ -819,7 +819,7 @@ TYPE
 
 
 PROCEDURE New*(context : Files.Parameters);
 PROCEDURE New*(context : Files.Parameters);
 VAR
 VAR
-	part, res, type, cacheSize: LONGINT; flags: SET; stop: BOOLEAN;
+	part, type, cacheSize: LONGINT; res: WORD; flags: SET; stop: BOOLEAN;
 	name: Plugins.Name; plugin: Plugins.Plugin; dev: Disks.Device;
 	name: Plugins.Name; plugin: Plugins.Plugin; dev: Disks.Device;
 	ptable: Disks.PartitionTable; ch : CHAR;
 	ptable: Disks.PartitionTable; ch : CHAR;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
@@ -896,7 +896,7 @@ END WritePartitionType;
 PROCEDURE InitVol(dev: Disks.Device; partIdx, type: LONGINT; VAR vol: Files.Volume; flags: SET; cacheSize: LONGINT);
 PROCEDURE InitVol(dev: Disks.Device; partIdx, type: LONGINT; VAR vol: Files.Volume; flags: SET; cacheSize: LONGINT);
 VAR
 VAR
 	bpb: BPB; vol12: FAT12Volume; vol16: FAT16Volume; vol32: FAT32Volume; fatString : ARRAY 12 OF CHAR;
 	bpb: BPB; vol12: FAT12Volume; vol16: FAT16Volume; vol32: FAT32Volume; fatString : ARRAY 12 OF CHAR;
-	fatSize, numSectors, numClusters, reserved, numFATs, rootEntryCount, sectPC, res, fat : LONGINT;
+	fatSize, numSectors, numClusters, reserved, numFATs, rootEntryCount, sectPC, fat : LONGINT; res: WORD;
 BEGIN
 BEGIN
 	dev.Transfer(Disks.Read, dev.table[partIdx].start, 1, bpb, 0, res);
 	dev.Transfer(Disks.Read, dev.table[partIdx].start, 1, bpb, 0, res);
 	IF (res = Ok) THEN
 	IF (res = Ok) THEN

+ 8 - 7
source/FSTools.Mod

@@ -81,7 +81,7 @@ VAR
 	unsafeMode : BOOLEAN;
 	unsafeMode : BOOLEAN;
 
 
 PROCEDURE ExpandAlias(CONST alias : ARRAY OF CHAR; VAR genvol, genfs: ARRAY OF CHAR);
 PROCEDURE ExpandAlias(CONST alias : ARRAY OF CHAR; VAR genvol, genfs: ARRAY OF CHAR);
-VAR t: ARRAY 64 OF CHAR; i, j, res: LONGINT;
+VAR t: ARRAY 64 OF CHAR; i, j: LONGINT; res: WORD;
 BEGIN
 BEGIN
 	genvol[0] := 0X; genfs[0] := 0X;
 	genvol[0] := 0X; genfs[0] := 0X;
 	t := "Files.Alias.";
 	t := "Files.Alias.";
@@ -408,6 +408,7 @@ VAR
 	enumContext : Commands.Context;
 	enumContext : Commands.Context;
 	arg : Streams.StringReader;
 	arg : Streams.StringReader;
 	res : WORD;
 	res : WORD;
+	ignore: LONGINT;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);
 	options.Add("s", "subdirectories", Options.Flag);
 	options.Add("s", "subdirectories", Options.Flag);
@@ -423,7 +424,7 @@ BEGIN
 					enum.Open(path, {});
 					enum.Open(path, {});
 					NEW(arg, 4096);
 					NEW(arg, 4096);
 					NEW(arguments, context.arg.Available()); Strings.Truncate(arguments^, 0);
 					NEW(arguments, context.arg.Available()); Strings.Truncate(arguments^, 0);
-					context.arg.Bytes(arguments^, 0, context.arg.Available(), res); (* ignore res *)
+					context.arg.Bytes(arguments^, 0, context.arg.Available(), ignore); (* ignore res *)
 					NEW(enumContext, context.in, arg, context.out, context.error, context.caller);
 					NEW(enumContext, context.in, arg, context.out, context.error, context.caller);
 
 
 					EnumerateDirectory(enum, enumProc, options, enumContext, filemask, arguments^);
 					EnumerateDirectory(enum, enumProc, options, enumContext, filemask, arguments^);
@@ -499,7 +500,7 @@ BEGIN
 END CreateFile;
 END CreateFile;
 
 
 PROCEDURE CopyTo*(context : Commands.Context); (** targetpath sourcepath {filename} ~ *)
 PROCEDURE CopyTo*(context : Commands.Context); (** targetpath sourcepath {filename} ~ *)
-VAR targetPath, sourcePath, targetFullname, sourceFullname,  filename : Files.FileName; overwrite : BOOLEAN; nofFilesCopied, nofErrors,  res : LONGINT;
+VAR targetPath, sourcePath, targetFullname, sourceFullname,  filename : Files.FileName; overwrite : BOOLEAN; nofFilesCopied, nofErrors: LONGINT; res : WORD;
 BEGIN
 BEGIN
 	context.arg.SkipWhitespace; context.arg.String(targetPath);
 	context.arg.SkipWhitespace; context.arg.String(targetPath);
 	context.arg.SkipWhitespace; context.arg.String(sourcePath);
 	context.arg.SkipWhitespace; context.arg.String(sourcePath);
@@ -534,7 +535,7 @@ PROCEDURE CopyFiles*(context : Commands.Context); (** [Options] {source  => dest
 VAR
 VAR
 	source, destination : FileList;
 	source, destination : FileList;
 	overwritten, error, ignoreErrors, quiet : BOOLEAN;
 	overwritten, error, ignoreErrors, quiet : BOOLEAN;
-	nofFiles, res, n : LONGINT;
+	nofFiles, n : LONGINT; res: WORD;
 	options: Options.Options;
 	options: Options.Options;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);
@@ -605,7 +606,7 @@ BEGIN
 END GenerateName;
 END GenerateName;
 
 
 PROCEDURE Backup*(context: Commands.Context);
 PROCEDURE Backup*(context: Commands.Context);
-VAR index: LONGINT; fileList: FileList; nofFiles, n, res: LONGINT; str: Files.FileName; overwritten: BOOLEAN;
+VAR index: LONGINT; fileList: FileList; nofFiles, n: LONGINT; res: WORD; str: Files.FileName; overwritten: BOOLEAN;
 BEGIN
 BEGIN
 	overwritten := FALSE;
 	overwritten := FALSE;
 	nofFiles := GetFileList(context, fileList);
 	nofFiles := GetFileList(context, fileList);
@@ -628,7 +629,7 @@ PROCEDURE DeleteFiles*(context : Commands.Context); (** [Options] {file} ~ *)
 VAR
 VAR
 	filelist : FileList;
 	filelist : FileList;
 	error, ignoreErrors, silent : BOOLEAN;
 	error, ignoreErrors, silent : BOOLEAN;
-	nofFiles, res, n, ndone : LONGINT;
+	nofFiles, n, ndone : LONGINT; res: WORD;
 	options : Options.Options;
 	options : Options.Options;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);
@@ -674,7 +675,7 @@ PROCEDURE RenameFiles*(context : Commands.Context); (** [Options] {source => des
 VAR
 VAR
 	source, target : FileList;
 	source, target : FileList;
 	error, ignoreErrors : BOOLEAN;
 	error, ignoreErrors : BOOLEAN;
-	nofFiles, res, n : LONGINT;
+	nofFiles, n : LONGINT; res: WORD;
 	options : Options.Options;
 	options : Options.Options;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);

+ 1 - 1
source/FileHandlers.Mod

@@ -5,7 +5,7 @@ IMPORT
 
 
 (** Opens the file path; corresponding file handlers are specified in Configuration.XML *)
 (** Opens the file path; corresponding file handlers are specified in Configuration.XML *)
 PROCEDURE OpenFile* (CONST path : ARRAY OF CHAR; err: Streams.Writer; caller: OBJECT);
 PROCEDURE OpenFile* (CONST path : ARRAY OF CHAR; err: Streams.Writer; caller: OBJECT);
-VAR config,filehandler: ARRAY 128 OF CHAR; name,filename, ext : Files.FileName; index, res : LONGINT;
+VAR config,filehandler: ARRAY 128 OF CHAR; name,filename, ext : Files.FileName; index: LONGINT; res : WORD;
 	context: Commands.Context; arg: Streams.StringReader; in: Streams.Reader; out: Streams.Writer;
 	context: Commands.Context; arg: Streams.StringReader; in: Streams.Reader; out: Streams.Writer;
 BEGIN
 BEGIN
 	Files.SplitExtension(path, name, ext);
 	Files.SplitExtension(path, name, ext);

+ 2 - 2
source/ISO9660Volumes.Mod

@@ -35,7 +35,7 @@ MODULE ISO9660Volumes;	(* AUTHOR "?/be"; PURPOSE "ISO 9660 volume (ported from N
 			END Available;
 			END Available;
 
 
 			PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
 			PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-			VAR res, i: LONGINT;
+			VAR res: WORD; i: LONGINT;
 			BEGIN {EXCLUSIVE}
 			BEGIN {EXCLUSIVE}
 				ASSERT(dev # NIL, 101);
 				ASSERT(dev # NIL, 101);
 				i := 0;
 				i := 0;
@@ -83,7 +83,7 @@ END GetISO9660Volume;
 (** Generate a new ISO9660 volume object. Files.Par: device [# part (ignored)] *)
 (** Generate a new ISO9660 volume object. Files.Par: device [# part (ignored)] *)
 PROCEDURE New*(context : Files.Parameters);
 PROCEDURE New*(context : Files.Parameters);
 VAR
 VAR
-	name: Plugins.Name;  i, ignore, res: LONGINT;
+	name: Plugins.Name;  i, ignore: LONGINT; res: WORD;
 	table: Plugins.Table; dev: Disks.Device;
 	table: Plugins.Table; dev: Disks.Device;
 BEGIN
 BEGIN
 	context.vol := NIL;
 	context.vol := NIL;

+ 1 - 1
source/Inflate.Mod

@@ -39,7 +39,7 @@ MODULE Inflate; (** AUTHOR "ejz"; PURPOSE "Aos inflate stream"; *)
 				END;
 				END;
 				eof: BOOLEAN;
 				eof: BOOLEAN;
 
 
-			PROCEDURE Receive*(VAR data: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len, res: LONGINT);
+			PROCEDURE Receive*(VAR data: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len: LONGINT; VAR res: WORD);
 				VAR n: LONGINT;
 				VAR n: LONGINT;
 			BEGIN
 			BEGIN
 				len := 0;
 				len := 0;

+ 2 - 2
source/KernelLog.Mod

@@ -41,11 +41,11 @@ END Send;
 (** Write a string to the trace output. *)
 (** Write a string to the trace output. *)
 
 
 PROCEDURE String*(CONST s: ARRAY OF CHAR);
 PROCEDURE String*(CONST s: ARRAY OF CHAR);
-VAR len, n: LONGINT;
+VAR len, n: SIZE; res: WORD;
 BEGIN
 BEGIN
 	len := 0; n := LEN(s);
 	len := 0; n := LEN(s);
 	WHILE (len # n) & (s[len] # 0X) DO INC(len) END;
 	WHILE (len # n) & (s[len] # 0X) DO INC(len) END;
-	Send(s, 0, len, FALSE, n)	(* ignore res *)
+	Send(s, 0, len, FALSE, res)
 END String;
 END String;
 
 
 (** Skip to the next line on trace output. *)
 (** Skip to the next line on trace output. *)

+ 3 - 3
source/LPR.Mod

@@ -41,7 +41,7 @@ MODULE LPR; (* AUTHOR "ejz"; PURPOSE "RFC 1179" *)
 			writer: Streams.Writer;
 			writer: Streams.Writer;
 			fadr: IP.Adr;
 			fadr: IP.Adr;
 			locport: INTEGER;
 			locport: INTEGER;
-			connres, len : LONGINT;
+			connres: WORD; len : LONGINT;
 			conn: TCP.Connection;
 			conn: TCP.Connection;
 			buf : ARRAY 10000 OF CHAR;
 			buf : ARRAY 10000 OF CHAR;
 	BEGIN
 	BEGIN
@@ -157,7 +157,7 @@ MODULE LPR; (* AUTHOR "ejz"; PURPOSE "RFC 1179" *)
 PROCEDURE ShowJobs*(out: Streams.Writer; CONST host, queue : ARRAY OF CHAR; VAR res: WORD);
 PROCEDURE ShowJobs*(out: Streams.Writer; CONST host, queue : ARRAY OF CHAR; VAR res: WORD);
 		VAR
 		VAR
 			job: ARRAY 64 OF CHAR;
 			job: ARRAY 64 OF CHAR;
-			connres: LONGINT;
+			connres: WORD;
 			conn: TCP.Connection;
 			conn: TCP.Connection;
 			reader: Streams.Reader;
 			reader: Streams.Reader;
 			writer: Streams.Writer;
 			writer: Streams.Writer;
@@ -195,7 +195,7 @@ PROCEDURE ShowJobs*(out: Streams.Writer; CONST host, queue : ARRAY OF CHAR; VAR
 		Remove the specified job or all jobs from queue. *)
 		Remove the specified job or all jobs from queue. *)
 	PROCEDURE RemoveJob*(CONST host, queue,  email, job: ARRAY OF CHAR; VAR res : WORD);
 	PROCEDURE RemoveJob*(CONST host, queue,  email, job: ARRAY OF CHAR; VAR res : WORD);
 	VAR
 	VAR
-		connres: LONGINT;
+		connres: WORD;
 		conn: TCP.Connection;
 		conn: TCP.Connection;
 		reader: Streams.Reader;
 		reader: Streams.Reader;
 		writer : Streams.Writer;
 		writer : Streams.Writer;

+ 1 - 1
source/Modules.Mod

@@ -522,7 +522,7 @@ CONST ModuleInitTimeout = HUGEINT(3000000000); (* Timeout for waiting until a mo
 
 
 (*	Retrieve a procedure given a module name, the procedure name and some type information (kernel call) *)
 (*	Retrieve a procedure given a module name, the procedure name and some type information (kernel call) *)
 PROCEDURE GetProcedure*(CONST moduleName, procedureName : ARRAY OF CHAR; argTdAdr, retTdAdr : ADDRESS; VAR entryAdr : ADDRESS);
 PROCEDURE GetProcedure*(CONST moduleName, procedureName : ARRAY OF CHAR; argTdAdr, retTdAdr : ADDRESS; VAR entryAdr : ADDRESS);
-VAR module : Module; ignoreMsg : ARRAY 32 OF CHAR; i, res : LONGINT; t: HUGEINT;
+VAR module : Module; ignoreMsg : ARRAY 32 OF CHAR; i: LONGINT; res : WORD; t: HUGEINT;
 BEGIN
 BEGIN
 	module := ThisModule(moduleName, res, ignoreMsg);
 	module := ThisModule(moduleName, res, ignoreMsg);
 	IF (res = Ok) THEN
 	IF (res = Ok) THEN

+ 2 - 2
source/OldDiskFS.Mod

@@ -569,7 +569,7 @@ TYPE
 
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		VAR
 		VAR
-			i, k, res: LONGINT; f: File; header: DiskAdr; buf: Buffer; head {UNTRACED}: FileHd;
+			i, k: LONGINT; res: WORD; f: File; header: DiskAdr; buf: Buffer; head {UNTRACED}: FileHd;
 			namebuf: FileName; super: SuperIndex; sub: SubIndex; sec: IndexSector;
 			namebuf: FileName; super: SuperIndex; sub: SubIndex; sec: IndexSector;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
 			f := NIL; Check(name, namebuf, res);
@@ -607,7 +607,7 @@ TYPE
 			RETURN f
 			RETURN f
 		END Old0;
 		END Old0;
 
 
-		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key, res: LONGINT);
+		PROCEDURE Delete0*(name: ARRAY OF CHAR; VAR key: LONGINT; VAR res: WORD);
 		VAR adr: DiskAdr; namebuf: FileName; head: FileHeader;
 		VAR adr: DiskAdr; namebuf: FileName; head: FileHeader;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			Check(name, namebuf, res);
 			Check(name, namebuf, res);

+ 4 - 4
source/OldDiskVolumes.Mod

@@ -37,7 +37,7 @@ TYPE
 
 
 		(** Get block from adr [1..size] of volume vol *)
 		(** Get block from adr [1..size] of volume vol *)
 		PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
 		PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-		VAR res, block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
+		VAR res: WORD; block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -59,7 +59,7 @@ TYPE
 
 
 		(** Put block to adr [1..size] of volume vol *)
 		(** Put block to adr [1..size] of volume vol *)
 		PROCEDURE PutBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
 		PROCEDURE PutBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-		VAR res, block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
+		VAR res: WORD; block: LONGINT; buf: Caches.Buffer; valid: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -111,7 +111,7 @@ BEGIN
 END Get4;
 END Get4;
 
 
 (* Get the file system parameters by reading the boot block. The pstart and psize parameters are the partition start and size in device blocks (size 512 or 2048).  The startfs parameter returns the offset of the file system from the start of the disk in device blocks.  The size parameter returns the size of the file system in volume blocks.  The vbs parameter returns the volume block size of the file system (4096 for AosFS, 2048 for NatFS). *)
 (* Get the file system parameters by reading the boot block. The pstart and psize parameters are the partition start and size in device blocks (size 512 or 2048).  The startfs parameter returns the offset of the file system from the start of the disk in device blocks.  The size parameter returns the size of the file system in volume blocks.  The vbs parameter returns the volume block size of the file system (4096 for AosFS, 2048 for NatFS). *)
-PROCEDURE GetOberonFS(dev: Disks.Device; pstart, psize: LONGINT; VAR startfs, size, vbs, res: LONGINT);
+PROCEDURE GetOberonFS(dev: Disks.Device; pstart, psize: LONGINT; VAR startfs, size, vbs: LONGINT; VAR res: WORD);
 CONST FSID = 21534F41H; FSVer = 1; AosSS = 4096; NSS = 2048;
 CONST FSID = 21534F41H; FSVer = 1; AosSS = 4096; NSS = 2048;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 BEGIN
 BEGIN
@@ -223,7 +223,7 @@ END InitVol;
 (* Try to open the specified volume.  Sets p.vol # NIL on success. *)
 (* Try to open the specified volume.  Sets p.vol # NIL on success. *)
 
 
 PROCEDURE TryOpen(context: Files.Parameters; dev: Disks.Device; part, dbs: LONGINT; readonly: BOOLEAN);
 PROCEDURE TryOpen(context: Files.Parameters; dev: Disks.Device; part, dbs: LONGINT; readonly: BOOLEAN);
-VAR vol: Volume; startfs, size, vbs, res: LONGINT; ptable: Disks.PartitionTable;
+VAR vol: Volume; startfs, size, vbs: LONGINT; res: WORD; ptable: Disks.PartitionTable;
 BEGIN
 BEGIN
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");