Bladeren bron

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 jaren geleden
bovenliggende
commit
52b9259697

+ 2 - 2
source/Caches.Mod

@@ -93,7 +93,7 @@ TYPE
 		(** Synchronize all momentarily dirty buffers that are not locked. *)
 
 		PROCEDURE Synchronize*;
-		VAR list, buf: Buffer; res, num, count: LONGINT;
+		VAR list, buf: Buffer; res: WORD; num, count: LONGINT;
 		BEGIN
 			AcquireDirty(list); count := 0;
 			WHILE list # NIL DO
@@ -210,7 +210,7 @@ TYPE
 
 (* 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
 	KernelLog.Enter; KernelLog.String("Caches: Error "); KernelLog.Int(res, 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;
 
 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
 	Get(key, string, res);
 	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 *)
 		PROCEDURE ParseRangeString(rangeString : XML.String; base16, neg : BOOLEAN; VAR ranges : Ranges);
 		VAR
-			numberOfRanges, i, j, k, res : LONGINT;
+			numberOfRanges, i, j, k: LONGINT; res : WORD;
 			tempString : XML.String;
 			range : Range;
 			theseRanges, oldRanges : RangeArray;
@@ -1285,7 +1285,7 @@ VAR
 	tagName, languageAttribute, baseAttribute : XML.String;
 	base16, propertyFound : BOOLEAN;
 
-	rangeLow, rangeHigh, res : LONGINT;
+	rangeLow, rangeHigh: LONGINT; res: WORD;
 	mode, tempRangeLow, tempRangeHigh : Strings.String;
 BEGIN
 	propertyFound := FALSE;

+ 3 - 3
source/DiskFS.Mod

@@ -575,7 +575,7 @@ TYPE
 		END Init;
 
 		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}
 			f := NIL; Check(name, namebuf, res);
 			IF res <= 0 THEN
@@ -599,7 +599,7 @@ TYPE
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		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;
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
@@ -637,7 +637,7 @@ TYPE
 			RETURN f
 		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;
 		BEGIN {EXCLUSIVE}
 			Check(name, namebuf, res);

+ 5 - 5
source/DiskVolumes.Mod

@@ -37,7 +37,7 @@ TYPE
 
 		(** Get block from adr [1..size] of volume vol *)
 		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}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -59,7 +59,7 @@ TYPE
 
 		(** Put block to adr [1..size] of volume vol *)
 		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}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -84,7 +84,7 @@ TYPE
 
 		(** Finalize a volume and close its device. *)
 		PROCEDURE Finalize*;
-		VAR res, i, j: LONGINT; ptable: Disks.PartitionTable;
+		VAR res: WORD; i, j: LONGINT; ptable: Disks.PartitionTable;
 		BEGIN {EXCLUSIVE}
 			IF cache # NIL THEN cache.Synchronize; cache := NIL END;
 			i := 0; j := -1; ptable := dev.table;	(* todo: fix race! *)
@@ -111,7 +111,7 @@ BEGIN
 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). *)
-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;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 BEGIN
@@ -227,7 +227,7 @@ END InitVol;
 (* 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);
-VAR vol: Volume; startfs, size, vbs, res: LONGINT; ptable: Disks.PartitionTable;
+VAR vol: Volume; startfs, size, vbs: LONGINT; res: WORD; ptable: Disks.PartitionTable;
 BEGIN
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");

+ 5 - 5
source/Disks.Mod

@@ -65,7 +65,7 @@ TYPE
 			res := Unsupported
 		END Transfer;
 
-		PROCEDURE GetSize*(VAR size, res: LONGINT);
+		PROCEDURE GetSize*(VAR size: LONGINT; VAR res: WORD);
 		BEGIN
 			res := Unsupported
 		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. *)
 
 		PROCEDURE Open*(VAR res: WORD);
-		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: LONGINT;
+		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: WORD;
 		BEGIN
 			res := Ok;
 			IF openCount = 0 THEN
@@ -182,7 +182,7 @@ END ValidFlag;
 
 (* 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;
 BEGIN
 	n := 0;
@@ -212,7 +212,7 @@ END ReadPrimary;
 
 (* 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;
 BEGIN
 	sec := first;
@@ -291,7 +291,7 @@ END UpdatePartitionTable;
 
 (* Clean up the installed devices. *)
 PROCEDURE Cleanup;
-VAR dev: Plugins.Table; i, res: LONGINT; msg: ShutdownMsg;
+VAR dev: Plugins.Table; i: LONGINT; res: WORD; msg: ShutdownMsg;
 BEGIN
 	registry.GetAll(dev);
 	IF dev # NIL THEN

+ 4 - 4
source/FATFiles.Mod

@@ -262,11 +262,11 @@ TYPE
 		END OldX;
 
 		(** 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)
 		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;
 		BEGIN
 			res := ErrInvalidFilename; key := 0;
@@ -461,7 +461,7 @@ TYPE
 		BEGIN INC(par(CountFiles).count); RETURN TRUE
 		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;
 		BEGIN {EXCLUSIVE}
 			IF (Files.ReadOnly IN vol.flags) THEN res := ErrReadOnly; RETURN END;
@@ -671,7 +671,7 @@ TYPE
 		PROCEDURE ReadBuffer(buffer: Buffer; pos: LONGINT);
 		VAR
 			last: Address;
-			i, res: LONGINT;
+			i: LONGINT; res: WORD;
 			bp, bc, ctrlflow, stopc: LONGINT;
 		BEGIN
 			ASSERT(buffer.pos # pos);

+ 8 - 8
source/FATVolumes.Mod

@@ -125,7 +125,7 @@ TYPE
 		END InitLowLevel;
 
 		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 *)
 			quit := TRUE;
 			timer.Wakeup;
@@ -191,7 +191,7 @@ TYPE
 		END InitCache;
 
 		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
 			IF (cache # NIL) & cache.dirty THEN
 				cache.dirty := FALSE;
@@ -387,7 +387,7 @@ TYPE
 		END FreeClusterChain;
 
 		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}
 			unsafe := TRUE; entries[0] := ReadFATEntryX(0);
 			unsafe := TRUE; entries[1] := ReadFATEntryX(1);
@@ -450,7 +450,7 @@ TYPE
 		END Initialize;
 
 		PROCEDURE InitRoot;
-		VAR sec: ARRAY BS OF CHAR; i, res: LONGINT;
+		VAR sec: ARRAY BS OF CHAR; i: LONGINT; res: WORD;
 		BEGIN
 			FOR i := 0 TO numRootSectors-1 DO
 				WriteSectorX(firstRootSector + i, sec, 0, res) (* ignore res *)
@@ -476,7 +476,7 @@ TYPE
 		END Finalize;
 
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
-		VAR offset, res: LONGINT;
+		VAR offset: LONGINT; res: WORD;
 			entry: Address;
 			data: ARRAY 2*BS OF CHAR;
 		BEGIN
@@ -672,7 +672,7 @@ TYPE
 			fsInfo-: Address; 	(* sector number of FSInfo sector (relative to 'start') *)
 
 		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}
 			result := FALSE;
 			IF Initialize^(bpb, MaxClusters) THEN	(* see note in Volumes.Initialize *)
@@ -819,7 +819,7 @@ TYPE
 
 PROCEDURE New*(context : Files.Parameters);
 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;
 	ptable: Disks.PartitionTable; ch : CHAR;
 BEGIN {EXCLUSIVE}
@@ -896,7 +896,7 @@ END WritePartitionType;
 PROCEDURE InitVol(dev: Disks.Device; partIdx, type: LONGINT; VAR vol: Files.Volume; flags: SET; cacheSize: LONGINT);
 VAR
 	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
 	dev.Transfer(Disks.Read, dev.table[partIdx].start, 1, bpb, 0, res);
 	IF (res = Ok) THEN

+ 8 - 7
source/FSTools.Mod

@@ -81,7 +81,7 @@ VAR
 	unsafeMode : BOOLEAN;
 
 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
 	genvol[0] := 0X; genfs[0] := 0X;
 	t := "Files.Alias.";
@@ -408,6 +408,7 @@ VAR
 	enumContext : Commands.Context;
 	arg : Streams.StringReader;
 	res : WORD;
+	ignore: LONGINT;
 BEGIN
 	NEW(options);
 	options.Add("s", "subdirectories", Options.Flag);
@@ -423,7 +424,7 @@ BEGIN
 					enum.Open(path, {});
 					NEW(arg, 4096);
 					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);
 
 					EnumerateDirectory(enum, enumProc, options, enumContext, filemask, arguments^);
@@ -499,7 +500,7 @@ BEGIN
 END CreateFile;
 
 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
 	context.arg.SkipWhitespace; context.arg.String(targetPath);
 	context.arg.SkipWhitespace; context.arg.String(sourcePath);
@@ -534,7 +535,7 @@ PROCEDURE CopyFiles*(context : Commands.Context); (** [Options] {source  => dest
 VAR
 	source, destination : FileList;
 	overwritten, error, ignoreErrors, quiet : BOOLEAN;
-	nofFiles, res, n : LONGINT;
+	nofFiles, n : LONGINT; res: WORD;
 	options: Options.Options;
 BEGIN
 	NEW(options);
@@ -605,7 +606,7 @@ BEGIN
 END GenerateName;
 
 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
 	overwritten := FALSE;
 	nofFiles := GetFileList(context, fileList);
@@ -628,7 +629,7 @@ PROCEDURE DeleteFiles*(context : Commands.Context); (** [Options] {file} ~ *)
 VAR
 	filelist : FileList;
 	error, ignoreErrors, silent : BOOLEAN;
-	nofFiles, res, n, ndone : LONGINT;
+	nofFiles, n, ndone : LONGINT; res: WORD;
 	options : Options.Options;
 BEGIN
 	NEW(options);
@@ -674,7 +675,7 @@ PROCEDURE RenameFiles*(context : Commands.Context); (** [Options] {source => des
 VAR
 	source, target : FileList;
 	error, ignoreErrors : BOOLEAN;
-	nofFiles, res, n : LONGINT;
+	nofFiles, n : LONGINT; res: WORD;
 	options : Options.Options;
 BEGIN
 	NEW(options);

+ 1 - 1
source/FileHandlers.Mod

@@ -5,7 +5,7 @@ IMPORT
 
 (** Opens the file path; corresponding file handlers are specified in Configuration.XML *)
 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;
 BEGIN
 	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;
 
 			PROCEDURE GetBlock*(adr: LONGINT; VAR blk: ARRAY OF CHAR);
-			VAR res, i: LONGINT;
+			VAR res: WORD; i: LONGINT;
 			BEGIN {EXCLUSIVE}
 				ASSERT(dev # NIL, 101);
 				i := 0;
@@ -83,7 +83,7 @@ END GetISO9660Volume;
 (** Generate a new ISO9660 volume object. Files.Par: device [# part (ignored)] *)
 PROCEDURE New*(context : Files.Parameters);
 VAR
-	name: Plugins.Name;  i, ignore, res: LONGINT;
+	name: Plugins.Name;  i, ignore: LONGINT; res: WORD;
 	table: Plugins.Table; dev: Disks.Device;
 BEGIN
 	context.vol := NIL;

+ 1 - 1
source/Inflate.Mod

@@ -39,7 +39,7 @@ MODULE Inflate; (** AUTHOR "ejz"; PURPOSE "Aos inflate stream"; *)
 				END;
 				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;
 			BEGIN
 				len := 0;

+ 2 - 2
source/KernelLog.Mod

@@ -41,11 +41,11 @@ END Send;
 (** Write a string to the trace output. *)
 
 PROCEDURE String*(CONST s: ARRAY OF CHAR);
-VAR len, n: LONGINT;
+VAR len, n: SIZE; res: WORD;
 BEGIN
 	len := 0; n := LEN(s);
 	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;
 
 (** 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;
 			fadr: IP.Adr;
 			locport: INTEGER;
-			connres, len : LONGINT;
+			connres: WORD; len : LONGINT;
 			conn: TCP.Connection;
 			buf : ARRAY 10000 OF CHAR;
 	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);
 		VAR
 			job: ARRAY 64 OF CHAR;
-			connres: LONGINT;
+			connres: WORD;
 			conn: TCP.Connection;
 			reader: Streams.Reader;
 			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. *)
 	PROCEDURE RemoveJob*(CONST host, queue,  email, job: ARRAY OF CHAR; VAR res : WORD);
 	VAR
-		connres: LONGINT;
+		connres: WORD;
 		conn: TCP.Connection;
 		reader: Streams.Reader;
 		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) *)
 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
 	module := ThisModule(moduleName, res, ignoreMsg);
 	IF (res = Ok) THEN

+ 2 - 2
source/OldDiskFS.Mod

@@ -569,7 +569,7 @@ TYPE
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		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;
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
@@ -607,7 +607,7 @@ TYPE
 			RETURN f
 		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;
 		BEGIN {EXCLUSIVE}
 			Check(name, namebuf, res);

+ 4 - 4
source/OldDiskVolumes.Mod

@@ -37,7 +37,7 @@ TYPE
 
 		(** Get block from adr [1..size] of volume vol *)
 		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}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -59,7 +59,7 @@ TYPE
 
 		(** Put block to adr [1..size] of volume vol *)
 		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}
 			IF (adr < 1) OR (adr > size) THEN SYSTEM.HALT(15) END;
 			ASSERT(startfs > 0);	(* startfs initialized *)
@@ -111,7 +111,7 @@ BEGIN
 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). *)
-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;
 VAR i, x, bc, fsofs: LONGINT; b: ARRAY CDBS OF CHAR;
 BEGIN
@@ -223,7 +223,7 @@ END InitVol;
 (* 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);
-VAR vol: Volume; startfs, size, vbs, res: LONGINT; ptable: Disks.PartitionTable;
+VAR vol: Volume; startfs, size, vbs: LONGINT; res: WORD; ptable: Disks.PartitionTable;
 BEGIN
 	context.out.String(Header); context.out.String(dev.name);
 	context.out.Char("#"); context.out.Int(part, 1); context.out.Char(" ");