Переглянути джерело

fix result type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8462 8c9fc860-2736-0410-a75d-ab315db34111
eth.metacore 6 роки тому
батько
коміт
35c7cbdd95

+ 2 - 2
source/ComponentViewer.Mod

@@ -153,7 +153,7 @@ VAR
 	ignoreMsg : ARRAY 1 OF CHAR;
 	generatorProc : XML.GeneratorProcedure;
 	c : XML.Content; component : Repositories.Component;
-	id, res : LONGINT;
+	id: LONGINT; res: WORD;
 BEGIN
 	IF Repositories.SplitName(filename, repositoryName, componentName, id) & (repositoryName # "") THEN
 		(* Retrieve component from repository *)
@@ -261,7 +261,7 @@ PROCEDURE Store*(context: Commands.Context);
 VAR
 	filename, name, ext, formName : ARRAY 256 OF CHAR;
 	form: WMComponents.Component;
-	id,res: LONGINT;
+	id: LONGINT; res: WORD;
 	originator: WMComponents.Component;
 	parent: XML.Element;
 BEGIN{EXCLUSIVE}

+ 1 - 1
source/Decoder.Mod

@@ -1718,7 +1718,7 @@ TYPE
 			msg : ARRAY 256 OF CHAR;
 			module : Modules.Module;
 			header: ObjHeader;
-			res, extPos : LONGINT;
+			res: WORD; extPos : LONGINT;
 		BEGIN
 			vc := CreateForm();
 			Init(vc.bounds.GetWidth(), vc.bounds.GetHeight(), FALSE);

+ 3 - 3
source/DiffLib.Mod

@@ -96,7 +96,7 @@ TYPE
 	VAR
 		leftText, rightText: Texts.Text;
 		leftReader, rightReader: Texts.TextReader;
-		format, res: LONGINT;
+		format, res: LONGINT; textRes: WORD;
 		leftBuffer, rightBuffer, left, right: LineBuffer;
 		width, height : LONGINT;
 		table: POINTER TO ARRAY OF ARRAY OF Element;
@@ -125,13 +125,13 @@ TYPE
 
 	BEGIN
 		NEW (leftText);
-		TextUtilities.LoadAuto(leftText, leftFile, format, res);
+		TextUtilities.LoadAuto(leftText, leftFile, format, textRes);
 		leftText.AcquireRead;
 		NEW (leftReader, leftText);
 		leftReader.SetPosition (0);
 
 		NEW (rightText);
-		TextUtilities.LoadAuto(rightText, rightFile, format, res);
+		TextUtilities.LoadAuto(rightText, rightFile, format, textRes);
 		rightText.AcquireRead;
 		NEW (rightReader, rightText);
 		rightReader.SetPosition (0);

+ 1 - 1
source/DynamicWebpagePlugin.Mod

@@ -795,7 +795,7 @@ TYPE
 	END ReadRegisteredModules;
 
 	PROCEDURE RegisterModuleByName(moduleName: Strings.String);
-	VAR module: Modules.Module; factory : DynamicWebpage.ActiveElementDescSetFactory; i, res: LONGINT;
+	VAR module: Modules.Module; factory : DynamicWebpage.ActiveElementDescSetFactory; i: LONGINT; res: WORD;
 		msg: ARRAY 1024 OF CHAR; desc: DynamicWebpage.ActiveElementDescriptor;
 		descList: DynamicWebpage.ActiveElementDescSet;
 	BEGIN

+ 4 - 4
source/Errors.Mod

@@ -40,7 +40,7 @@ VAR
 	index : LONGINT;
 	lastModuleName : Modules.Name;
 
-PROCEDURE GetErrorString(errorCode : LONGINT) : Strings.String;
+PROCEDURE GetErrorString(errorCode : WORD) : Strings.String;
 VAR message : ARRAY 128 OF CHAR; nbr : ARRAY 16 OF CHAR;
 BEGIN
 	message := "Unknown error, res: ";
@@ -49,7 +49,7 @@ BEGIN
 END GetErrorString;
 
 (** Get error message for the specified error number. If no message can be found, a generic error message is generated *)
-PROCEDURE GetErrorMessage*(errorCode : LONGINT) : ErrorMessage;
+PROCEDURE GetErrorMessage*(errorCode : WORD) : ErrorMessage;
 VAR errorMessage : ErrorMessage; res : WORD;
 BEGIN {EXCLUSIVE}
 	res := -1;
@@ -62,7 +62,7 @@ BEGIN {EXCLUSIVE}
 	RETURN errorMessage;
 END GetErrorMessage;
 
-PROCEDURE ToStream*(errorCode : LONGINT; out : Streams.Writer);
+PROCEDURE ToStream*(errorCode : WORD; out : Streams.Writer);
 VAR errorMessage : ErrorMessage;
 BEGIN
 	ASSERT(out # NIL);
@@ -93,7 +93,7 @@ BEGIN
 	INC(index);
 END Add;
 
-PROCEDURE Get(number : LONGINT; VAR errorMessage : ErrorMessage; VAR res : WORD);
+PROCEDURE Get(number : WORD; VAR errorMessage : ErrorMessage; VAR res : WORD);
 VAR i : LONGINT;
 BEGIN
 	IF (cache # NIL) THEN

+ 3 - 3
source/FTPFS.Mod

@@ -625,7 +625,7 @@ TYPE
 		END ScheduleClose;
 
 		PROCEDURE New0*(name: ARRAY OF CHAR): Files.File;
-		VAR i, res: LONGINT; f: File; buf: Buffer; head: FileHd; namebuf: FileName;
+		VAR i: LONGINT; res: WORD; f: File; buf: Buffer; head: FileHd; namebuf: FileName;
 		BEGIN (*{EXCLUSIVE}*)
 			lock.Acquire;
 			f := NIL; Check(name, namebuf, res);
@@ -693,7 +693,7 @@ TYPE
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		VAR
-			i, k, res: LONGINT; f: File; header: DiskAdr; buf: Buffer; head: FileHd;
+			i, k: LONGINT; res: WORD; f: File; header: DiskAdr; buf: Buffer; head: FileHd;
 			namebuf, local: FileName; super: SuperIndex; sub: SubIndex; sec: IndexSector;
 
 		BEGIN (*{EXCLUSIVE}*)
@@ -756,7 +756,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}*)
 			lock.Acquire;

+ 1 - 1
source/GZip.Mod

@@ -160,7 +160,7 @@ TYPE
 		END Init;
 
 
-		PROCEDURE Receive*(VAR buf: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len, res: LONGINT);
+		PROCEDURE Receive*(VAR buf: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len: LONGINT; VAR res: WORD);
 		VAR
 			intlen : LONGINT;
 		BEGIN

+ 2 - 2
source/HierarchicalProfiler.Mod

@@ -534,7 +534,7 @@ END GetProfile;
 
 (** Start profiling. If the profiler is already running, it is stopped and the sample data is discarded before re-starting it *)
 PROCEDURE Start*(context : Commands.Context); (** [options] ~ *)
-VAR options : Options.Options; unit : ARRAY 4 OF CHAR; maxTime, bufferSize, res : LONGINT;
+VAR options : Options.Options; unit : ARRAY 4 OF CHAR; maxTime, bufferSize: LONGINT; res: WORD;
 BEGIN
 	NEW(options);
 	options.Add("t", "time", Options.Integer); (* in seconds *)
@@ -677,7 +677,7 @@ BEGIN {EXCLUSIVE}
 END Show;
 
 PROCEDURE Cleanup;
-VAR ignore : LONGINT;
+VAR ignore : WORD;
 BEGIN
 	StopProfiling(ignore);
 END Cleanup;

+ 1 - 1
source/MemoryReader.Mod

@@ -13,7 +13,7 @@ TYPE
 			memoryAdr: ADDRESS;
 			available : LONGINT;
 
-		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min : LONGINT; VAR len, res: LONGINT);
+		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min : LONGINT; VAR len: LONGINT; VAR res: WORD);
 		BEGIN
 			ASSERT(ofs+size <= LEN(buf));
 			IF available # 0 THEN

+ 1 - 1
source/ModuleParser.Mod

@@ -1590,7 +1590,7 @@ VAR
 	module : Module;
 	scanner : FoxScanner.Scanner;
 	text : Texts.Text; reader : TextUtilities.TextReader;
-	format, res : LONGINT;
+	format: LONGINT; res : WORD;
 BEGIN
 	NEW(text);
 	TextUtilities.LoadAuto(text, filename, format, res);

+ 1 - 1
source/ModuleTrees.Mod

@@ -544,7 +544,7 @@ TYPE
 		END ClickNode;
 
 		PROCEDURE MiddleClickNode(sender, data : ANY);
-		VAR d : ANY; commandStr, ignoreMsg : ARRAY 128 OF CHAR; len, ignore : LONGINT;
+		VAR d : ANY; commandStr, ignoreMsg : ARRAY 128 OF CHAR; len: LONGINT; ignore : WORD;
 		BEGIN
 			IF (data # NIL) & (data IS WMTrees.TreeNode) THEN
 				tree.Acquire;

+ 3 - 3
source/OberonFS.Mod

@@ -518,7 +518,7 @@ TYPE
 		VAR dir: Directory;
 
 		PROCEDURE New0*(name: ARRAY OF CHAR): Files.File;
-		VAR i, res: LONGINT; f: File; buf: Buffer; head: FileHd; namebuf: FileName;
+		VAR i: LONGINT; res: WORD; f: File; buf: Buffer; head: FileHd; namebuf: FileName;
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
 			IF res <= 0 THEN
@@ -539,7 +539,7 @@ TYPE
 
 		PROCEDURE Old0*(name: ARRAY OF CHAR): Files.File;
 		VAR
-			i, k, res: LONGINT; f: File; header: DiskAdr; buf: Buffer; head: FileHd;
+			i, k: LONGINT; res: WORD; f: File; header: DiskAdr; buf: Buffer; head: FileHd;
 			namebuf: FileName; inxpg: Index;
 		BEGIN {EXCLUSIVE}
 			f := NIL; Check(name, namebuf, res);
@@ -570,7 +570,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);

+ 1 - 1
source/OldDiskVolumes.Mod

@@ -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! *)

+ 1 - 1
source/PCG386.Mod

@@ -2967,7 +2967,7 @@ END Init;
 
 (* Done - Code generator results - Installed in PCBT.CG *)
 
-PROCEDURE Done(VAR result: LONGINT);
+PROCEDURE Done(VAR result: WORD);
 BEGIN
 	IF PCO.CodeErr THEN result := -1
 	ELSE result := 0

+ 1 - 1
source/PCGAMD64.Mod

@@ -1847,7 +1847,7 @@ BEGIN
 END Init;
 
 (* Done - Code generator results - Installed in PCBT.CG *)
-PROCEDURE Done (VAR result: LONGINT);
+PROCEDURE Done (VAR result: WORD);
 BEGIN result := 0;
 END Done;
 

+ 3 - 3
source/PCM.Mod

@@ -322,7 +322,7 @@ IMPORT
 
 (** ---------- text output functions --------------------- *)
 
-	PROCEDURE GetMessage (err: LONGINT; CONST msg: ARRAY OF CHAR; VAR res: ARRAY OF CHAR);
+	PROCEDURE GetMessage (err: WORD; CONST msg: ARRAY OF CHAR; VAR res: ARRAY OF CHAR);
 	VAR str: ARRAY 128 OF CHAR;
 	BEGIN
 		COPY (msg, res);
@@ -347,7 +347,7 @@ IMPORT
 		TraceBackThis( Machine.CurrentPC(), Machine.CurrentBP() );
 	END TraceBack;
 
-	PROCEDURE Error* (err, pos: LONGINT;  CONST msg: ARRAY OF CHAR);
+	PROCEDURE Error* (err: WORD; pos: LONGINT;  CONST msg: ARRAY OF CHAR);
 		VAR str: ARRAY 128 OF CHAR;
 	BEGIN {EXCLUSIVE}
 		(** fof >> *)
@@ -373,7 +373,7 @@ IMPORT
 		END;
 	END Error;
 
-	PROCEDURE ErrorN* (err, pos: LONGINT; msg: StringPool.Index);
+	PROCEDURE ErrorN* (err: WORD; pos: LONGINT; msg: StringPool.Index);
 		VAR str: ARRAY 256 OF CHAR;
 	BEGIN
 		StringPool.GetString(msg, str);

+ 1 - 1
source/PCOM.Mod

@@ -1191,7 +1191,7 @@ END ImportComplete;
 
 PROCEDURE Import*(self: PCT.Module; VAR M: PCT.Module; modname: StringPool.Index);
 	VAR
-			tag, res, i: LONGINT;  name: PCS.Name;  str: PCT.Struct;  vis: SET; R: PCM.SymReader;
+			res: WORD; tag, i: LONGINT;  name: PCS.Name;  str: PCT.Struct;  vis: SET; R: PCM.SymReader;
 			proc: PCT.Proc;
 			scope: PCT.ModScope;
 			pscope: PCT.ProcScope;

+ 16 - 16
source/PCP.Mod

@@ -149,7 +149,7 @@ TYPE
 		(* --------------------------------------------------------- *)
 		(* Parser utilities *)
 
-		PROCEDURE Error(n, pos: LONGINT);
+		PROCEDURE Error(n: WORD; pos: LONGINT);
 		BEGIN PCM.Error(n, pos, "")
 		END Error;
 
@@ -269,7 +269,7 @@ TYPE
 		END OperatorDef;
 
 		PROCEDURE FPSection(scope: PCT.ProcScope; pflags: SET); (* ejz *)
-			VAR name: ARRAY 32 OF PCS.Name; i, n, res: LONGINT; VarPar: BOOLEAN;
+			VAR name: ARRAY 32 OF PCS.Name; i, n: LONGINT; res: WORD; VarPar: BOOLEAN;
 				pos: ARRAY 32 OF LONGINT; t: PCT.Struct;
 			(** fof >> *)
 			ConstPar: BOOLEAN;
@@ -421,7 +421,7 @@ TYPE
 		END CheckOperator;
 
 		PROCEDURE RecordType(VAR t: PCT.Struct;  pointed: BOOLEAN);
-			VAR recstruct: PCT.Record; ptr: PCT.Pointer; recscope: PCT.RecScope; recparser: RecordParser; bpos, res: LONGINT;
+			VAR recstruct: PCT.Record; ptr: PCT.Pointer; recscope: PCT.RecScope; recparser: RecordParser; bpos: LONGINT; res: WORD;
 				intf: ARRAY 32 OF PCT.Interface;
 		BEGIN
 			t := PCT.NoType;
@@ -466,7 +466,7 @@ TYPE
 		END Interface;
 
 		PROCEDURE ObjectType(VAR t: PCT.Struct;  name: StringPool.Index);
-			VAR recstruct: PCT.Record; ptr: PCT.Pointer; recscope: PCT.RecScope; parser: ObjectParser; bpos, res, i: LONGINT;
+			VAR recstruct: PCT.Record; ptr: PCT.Pointer; recscope: PCT.RecScope; parser: ObjectParser; bpos, i: LONGINT; res: WORD;
 				intf: ARRAY 32 OF PCT.Interface;
 
 		BEGIN
@@ -540,7 +540,7 @@ TYPE
 (** << fof  *)
 
 		PROCEDURE ArrayType (VAR t: PCT.Struct;  enhArray: BOOLEAN (* fof *));
-		VAR	index: PCB.Expression;  array: PCT.Array;  pos0, pos, res: LONGINT; base: PCT.Struct;
+		VAR	index: PCB.Expression;  array: PCT.Array;  pos0, pos: LONGINT; res: WORD; base: PCT.Struct;
 			(** fof >> *)
 			earray: PCT.EnhArray;  first: BOOLEAN;  aarray: PCT.Tensor;
 			(** << fof  *)
@@ -614,7 +614,7 @@ TYPE
 		END ArrayType;
 
 		PROCEDURE PointerType(VAR t: PCT.Struct;  name: StringPool.Index);
-			VAR pos, pos1, res: LONGINT; id: PCS.Name; o: PCT.Symbol; ptr: PCT.Pointer;
+			VAR pos, pos1: LONGINT; res: WORD; id: PCS.Name; o: PCT.Symbol; ptr: PCT.Pointer;
 		BEGIN
 			IF sym = record THEN
 				scanner.Get(sym);  RecordType(t, TRUE)
@@ -661,7 +661,7 @@ TYPE
 		END PointerType;
 
 		PROCEDURE Type (VAR t: PCT.Struct;  name: StringPool.Index);
-			VAR o: PCT.Symbol; procscope: PCT.ProcScope;  pos, res: LONGINT;
+			VAR o: PCT.Symbol; procscope: PCT.ProcScope;  pos: LONGINT; res: WORD;
 				proc: PCT.Delegate; sf: SET;
 		BEGIN
 			pos := scanner.errpos;
@@ -716,7 +716,7 @@ TYPE
 		END Type;
 
 		PROCEDURE VarDecl;
-			VAR id: ARRAY MaxIdentDef OF IdentDefDesc;  pos: ARRAY MaxIdentDef OF LONGINT; (** fof  *) c, n, res: LONGINT;  t: PCT.Struct;  flag: ARRAY MaxIdentDef OF SET;
+			VAR id: ARRAY MaxIdentDef OF IdentDefDesc; pos: ARRAY MaxIdentDef OF LONGINT; (** fof  *) c, n: LONGINT; res: WORD; t: PCT.Struct; flag: ARRAY MaxIdentDef OF SET;
 		BEGIN n := 1;
 			pos[0] := scanner.errpos;   (* fof *)
 			IdentDef (id[0], TRUE);
@@ -737,7 +737,7 @@ TYPE
 		END VarDecl;
 
 		PROCEDURE TypeDecl;
-			VAR i: IdentDefDesc; pos, res: LONGINT; t: PCT.Struct;
+			VAR i: IdentDefDesc; pos: LONGINT; res: WORD; t: PCT.Struct;
 		BEGIN
 			pos := scanner.errpos;
 			IdentDef(i, FALSE); Check(eql); Type(t, i.name);
@@ -746,7 +746,7 @@ TYPE
 		END TypeDecl;
 
 		PROCEDURE ConstDecl;
-			VAR i: IdentDefDesc; x: PCB.Const; pos, res: LONGINT;long: HUGEINT;
+			VAR i: IdentDefDesc; x: PCB.Const; pos: LONGINT; res: WORD; long: HUGEINT;
 		BEGIN
 			pos := scanner.errpos;
 			IdentDef(i, FALSE);  Check(eql);  ConstExpr(x);
@@ -790,7 +790,7 @@ TYPE
 		END ListOf;
 
 		PROCEDURE DeclSeq;
-		VAR t: PCT.Struct; name: PCS.Name; pos, res: LONGINT;
+		VAR t: PCT.Struct; name: PCS.Name; pos: LONGINT; res: WORD;
 		BEGIN
 			WHILE sym = definition DO
 				pos := scanner.errpos;
@@ -1450,7 +1450,7 @@ TYPE
 			searchScope: PCT.Scope;
 			args: ARRAY 2 OF PCT.Struct;
 			dh: PCB.Designator;  h: PCT.Variable; hiddenVarName : StringPool.Index;
-			rtype: PCT.Struct; res, i : LONGINT;
+			rtype: PCT.Struct; res: WORD; i : LONGINT;
 		BEGIN
 			PCS.GetOpName(op, name);
 			IF (mod # NIL) & (mod IS PCT.Module) THEN
@@ -1609,7 +1609,7 @@ TYPE
 		END If;
 
 		PROCEDURE BlockModifier(allowBody, suppress: BOOLEAN; VAR locked: BOOLEAN);
-			VAR x: PCB.Const; c, res: LONGINT;
+			VAR x: PCB.Const; c: LONGINT; res: WORD;
 		BEGIN
 			IF sym = lbrace THEN
 				locked := FALSE;
@@ -1718,7 +1718,7 @@ TYPE
 
 		PROCEDURE StatementSeq(body, suppress: BOOLEAN; VAR awaitCount: LONGINT);
 			VAR  d, d1: PCB.Designator; x, y: PCB.Expression; c: PCB.Const; o, o1: PCT.Symbol;
-				param: PCB.ExprList;  pos, res, stack: LONGINT;
+				param: PCB.ExprList;  pos, stack: LONGINT; res: WORD;
 				oldscope: PCT.Scope; s: PCT.WithScope; procscope: PCT.ProcScope;
 				awaitparser: AwaitParser;
 				loopinfo: PCB.LoopInfo;  caseinfo: PCB.CaseInfo;
@@ -2074,7 +2074,7 @@ TYPE
 
 		PROCEDURE ProcDecl;
 		VAR
-			procparser: ProcedureParser; procscope: PCT.ProcScope; pos, res: LONGINT;
+			procparser: ProcedureParser; procscope: PCT.ProcScope; pos: LONGINT; res: WORD;
 			i: IdentDefDesc; flags: SET; rtype: PCT.Struct; forward, suppress : BOOLEAN;
 			opName: PCS.Name; pflags: SET; right: SHORTINT; (* ejz *)
 			opStr: ARRAY PCS.MaxStrLen OF CHAR;
@@ -2429,7 +2429,7 @@ TYPE
 		END Body;
 
 		PROCEDURE DeclSeq;
-			VAR name: PCS.Name; procscope: PCT.ProcScope;  t: PCT.Struct; pos, res: LONGINT;
+			VAR name: PCS.Name; procscope: PCT.ProcScope;  t: PCT.Struct; pos: LONGINT; res: WORD;
 		BEGIN
 			WHILE sym = procedure DO
 				pos := scanner.errpos;

+ 6 - 6
source/PCT.Mod

@@ -1016,7 +1016,7 @@ VAR
 
 	(* CompareSignature - res < 0 ==> s1 < s1; used for sorting overloaded procedures *)
 
-	PROCEDURE CompareSignature(s1, s2: Parameter): LONGINT;
+	PROCEDURE CompareSignature(s1, s2: Parameter): WORD;
 		VAR res: WORD;
 
 		PROCEDURE GetInfo(t: Struct;  VAR m: Module;  VAR o: Symbol);
@@ -1029,7 +1029,7 @@ VAR
 			END
 		END GetInfo;
 
-		PROCEDURE CompareType(t1, t2: Struct): LONGINT;
+		PROCEDURE CompareType(t1, t2: Struct): WORD;
 		VAR
 			m1, m2: Module;
 			o1, o2: Symbol;
@@ -1149,7 +1149,7 @@ VAR
 	END InitScope;
 
 	PROCEDURE Insert(scope: Scope; obj: Symbol; VAR res: WORD);
-	VAR  p, q: Symbol; d: LONGINT;
+	VAR  p, q: Symbol; d: WORD;
 	BEGIN
 		ASSERT((scope.ownerID = 0) OR (PCM.GetProcessID() = scope.ownerID), 501); (*fof  global scope has no process id (=0) since different processes may insert elements here, cf. procedure Init *)
 		(* ASSERT(scope.state < complete, 502); *)
@@ -1534,7 +1534,7 @@ VAR
 
 
 	PROCEDURE ChangeState*(scope: Scope;  state: SHORTINT;  pos: LONGINT);
-	VAR  rec, r, int: Record; rscope: RecScope; mth: Method; i, res: LONGINT;
+	VAR  rec, r, int: Record; rscope: RecScope; mth: Method; i: LONGINT; res: WORD;
 	BEGIN
 		WHILE scope.state < state DO
 			CASE scope.state+1 OF
@@ -1761,7 +1761,7 @@ VAR
 (** fof >> *)
 
 	PROCEDURE MakeArrayType*(len: ARRAY OF LONGINT; dim: LONGINT; base: Struct; basesize: LONGINT): Struct;
-	VAR inc: LONGINT; a: EnhArray; i,res: LONGINT;
+	VAR inc: LONGINT; a: EnhArray; i: LONGINT; res: WORD;
 	BEGIN
 		inc := basesize;
 		FOR i := dim - 1 TO 0 BY -1 DO
@@ -1918,7 +1918,7 @@ VAR
 (** << fof  *)
 
 	PROCEDURE CopyMethods(scope: RecScope; CONST intf: Interfaces; isImported: BOOLEAN);
-		VAR i, res: LONGINT; rs: RecScope; s: ProcScope; m: Method; par: Parameter;
+		VAR i: LONGINT; res: WORD; rs: RecScope; s: ProcScope; m: Method; par: Parameter;
 			f: SET;
 	BEGIN
 		i := 0;

+ 2 - 2
source/PET.Mod

@@ -288,7 +288,7 @@ TYPE
 
 		(* Load settings from system configuration database *)
 		PROCEDURE Load;
-		VAR string : String; temp, res : LONGINT;
+		VAR string : String; temp: LONGINT; res: WORD;
 		BEGIN
 			(* General *)
 			Configuration.Get("Applications.PET.General.BackupOnStore", string, res);
@@ -1869,7 +1869,7 @@ TYPE
 		END FilenameEditEscapeHandler;
 
 		PROCEDURE LoadHandler(sender, data : ANY);
-		VAR filename : Filename; command : ARRAY 1024 OF CHAR; msg : ARRAY 64 OF CHAR; ignoreRes : LONGINT;
+		VAR filename : Filename; command : ARRAY 1024 OF CHAR; msg : ARRAY 64 OF CHAR; ignoreRes : WORD;
 		BEGIN
 			filenameEdit.GetAsString(filename);
 			Strings.TrimWS(filename);

+ 1 - 1
source/PETModuleTree.Mod

@@ -233,7 +233,7 @@ TYPE
 		END ClickNode;
 
 		PROCEDURE MiddleClickNode*(sender, data : ANY);
-		VAR commandStr, ignoreMsg : ARRAY 128 OF CHAR; len, ignore : LONGINT;
+		VAR commandStr, ignoreMsg : ARRAY 128 OF CHAR; len: LONGINT; ignore: WORD;
 		BEGIN
 			IF (data # NIL) & (data IS TreeNode) & (data(TreeNode).commandName # NIL) & (data(TreeNode).modulename # "") THEN
 				COPY(data(TreeNode).modulename, commandStr);

+ 1 - 1
source/PrevalenceSystem.Mod

@@ -1286,7 +1286,7 @@ CONST
 	END ReadRegisteredModules;
 
 	PROCEDURE RegisterModuleByName(moduleName: Strings.String);
-	VAR module: Modules.Module; factory : PersistentObjectDescSetFactory; i, res: LONGINT;
+	VAR module: Modules.Module; factory : PersistentObjectDescSetFactory; i: LONGINT; res: WORD;
 		msg: ARRAY 1024 OF CHAR; desc: PersistentObjectDescriptor;
 		descList: PersistentObjectDescSet;
 	BEGIN

+ 3 - 3
source/Repositories.Mod

@@ -795,7 +795,7 @@ TYPE
 		END Init;
 
 		(* Post-instantiation initialization *)
-		PROCEDURE Initialize() : LONGINT;
+		PROCEDURE Initialize() : WORD;
 		VAR enum : XMLObjects.Enumerator; ptr : ANY; element : XML.Element; res : WORD;
 		BEGIN
 			nextID := 0;
@@ -1804,7 +1804,7 @@ VAR
 	archive : Archives.Archive;
 	receiver : Streams.Receiver; reader : Streams.Reader;
 	element : XML.Element;
-	ignore : LONGINT;
+	ignore : WORD;
 	errors : ErrorReporter;
 	file: Files.File; writer: Files.Writer; freader: Files.Reader; ch: CHAR; buf: ARRAY 512 OF CHAR; len: LONGINT;
 BEGIN (* {EXCLUSIVE} *)
@@ -2108,7 +2108,7 @@ PROCEDURE Put*(context : Commands.Context); (** componentName repositoryName asN
 VAR
 	componentName, repositoryName, asName : ARRAY 256 OF CHAR;
 	nbr : ARRAY 3 OF CHAR;
-	component : Component; id, res : LONGINT;
+	component : Component; id : LONGINT; res: WORD;
 BEGIN
 	context.arg.SkipWhitespace; context.arg.String(componentName);
 	context.arg.SkipWhitespace; context.arg.String(repositoryName);

+ 6 - 6
source/SMTPClient.Mod

@@ -31,7 +31,7 @@ TYPE
 		BEGIN RETURN sendReady
 		END GetSendReady;
 
-		PROCEDURE GetReplyCode*(VAR code, res :LONGINT);
+		PROCEDURE GetReplyCode*(VAR code: LONGINT; VAR res: WORD); 
 		VAR msg : ARRAY 256 OF CHAR;
 		BEGIN
 			r.Ln(msg);
@@ -55,7 +55,7 @@ TYPE
 
 		PROCEDURE Open*(CONST server, thisHost : ARRAY OF CHAR; port: LONGINT; VAR result : LONGINT);
 		VAR fip : IP.Adr;
-				res, reply : LONGINT;
+				res: WORD; reply : LONGINT;
 		BEGIN
 			result := NotConnected;
 			DNS.HostByName(server, fip, res);
@@ -94,7 +94,7 @@ TYPE
 		END Close;
 
 		PROCEDURE StartMailFrom*(CONST fromAddr : ARRAY OF CHAR) : BOOLEAN;
-		VAR reply, res: LONGINT;
+		VAR reply: LONGINT; res: WORD;
 		BEGIN
 			w.String("MAIL FROM:<");  w.String(fromAddr); w.String(">"); w.Ln; w.Update;
 			IF w.res = Streams.Ok THEN
@@ -105,7 +105,7 @@ TYPE
 		END StartMailFrom;
 
 		PROCEDURE SendTo*(CONST toAddr : ARRAY OF CHAR) :BOOLEAN;
-		VAR reply, res: LONGINT;
+		VAR reply: LONGINT; res: WORD;
 		BEGIN
 			w.String("RCPT TO:<");  w.String(toAddr); w.String(">"); w.Ln; w.Update;
 			IF w.res = Streams.Ok THEN
@@ -116,7 +116,7 @@ TYPE
 		END SendTo;
 
 		PROCEDURE StartData*() : BOOLEAN;
-		VAR reply, res: LONGINT;
+		VAR reply: LONGINT; res: WORD;
 		BEGIN
 			SendCommand("DATA", "", res);
 			IF res = Ok THEN
@@ -156,7 +156,7 @@ TYPE
 		END SendRawLine;
 
 		PROCEDURE FinishSendRaw*() : BOOLEAN;
-		VAR reply, res: LONGINT;
+		VAR reply: LONGINT; res: WORD;
 		BEGIN
 			w.Update;
 			GetReplyCode(reply, res);

+ 4 - 3
source/SSH.Mod

@@ -27,7 +27,7 @@ TYPE
 				f: Forwarder; (* this client belogs to *)
 				p: T.Packet;
 				buf: ARRAY 64 OF CHAR;
-				len, res: LONGINT;
+				len: LONGINT; res: WORD;
 				
 			
 			
@@ -72,7 +72,8 @@ TYPE
 
 				buf: ARRAY 4096 OF CHAR;
 				type: CHAR;
-				len, res: LONGINT;
+				len: LONGINT;
+				res: WORD;
 				
 				clientHandlerRunning: BOOLEAN;
 				clientHandler: ClientHandler;
@@ -227,7 +228,7 @@ TYPE
 				END Send;
 
 
-				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
 					plen, dlen: LONGINT; pType, ch: CHAR;
 				BEGIN

+ 1 - 1
source/SSHGlobals.Mod

@@ -172,7 +172,7 @@ VAR
 	PROCEDURE GetConfigBuffer(): Buffer;
 	VAR
 		text: Texts.Text; r: Texts.TextReader;
-		ch, format, res, len, i, j, bytesPerChar: LONGINT;
+		ch, format, len, i, j, bytesPerChar: LONGINT; res: WORD;
 		buffer: Buffer;
 	BEGIN
 		NEW( text );

+ 4 - 4
source/SSHTransport.Mod

@@ -120,7 +120,7 @@ TYPE
 
 				PROCEDURE SendClientVersion;
 				VAR
-					len, pos, res: LONGINT;
+					len, pos: LONGINT; res: WORD;
 					nl: ARRAY 4 OF CHAR;
 				BEGIN
 					pos := 0;
@@ -133,7 +133,7 @@ TYPE
 				(** Send packet p *)
 				PROCEDURE SendPacket*( p: Packet );
 				VAR
-					i, trlen, payload, pad, cbs, res: LONGINT;
+					i, trlen, payload, pad, cbs: LONGINT; res: WORD;
 					seqno: ARRAY 4 OF CHAR;
 					trbuf: ARRAY 8196 OF CHAR;
 					packType: LONGINT;
@@ -170,7 +170,7 @@ TYPE
 
 				(** Receive SSH Packet into buf,  return packet type *)
 				PROCEDURE ReceivePacket*( VAR buf: ARRAY OF CHAR;  VAR size: LONGINT ): CHAR;
-				VAR i, l, pad, trlen, cbs, pos, res: LONGINT;
+				VAR i, l, pad, trlen, cbs, pos: LONGINT; res: WORD;
 					seqno: ARRAY 4 OF CHAR; rmac, cmac: ARRAY 20 OF CHAR;
 					trbuf: ARRAY 8196 OF CHAR;
 					packType: LONGINT;
@@ -663,7 +663,7 @@ VAR hexd: ARRAY 17 OF CHAR;
 	END Head;
 
 	PROCEDURE ReceiveLine( tcp: TCP.Connection;  VAR buf: ARRAY OF CHAR ): LONGINT;
-	VAR i, l, res: LONGINT;
+	VAR i, l: LONGINT; res: WORD;
 	BEGIN
 		i := 0;
 		REPEAT tcp.Receive( buf, i, 1, 1, l, res );  INC( i );

+ 2 - 2
source/SearchTools.Mod

@@ -47,7 +47,7 @@ TYPE
 
 
 PROCEDURE FindString(CONST filename : Files.FileName; param : Parameters; stats : Statistics; context : Commands.Context);
-VAR text : Texts.Text; pos, format, res : LONGINT; searchString : SearchStringUCS; idx : LONGINT; nbrOfHits : LONGINT;
+VAR text : Texts.Text; pos, format: LONGINT; res : WORD; searchString : SearchStringUCS; idx : LONGINT; nbrOfHits : LONGINT;
 BEGIN
 	ASSERT(param IS PatternParameters);
 	nbrOfHits := 0;
@@ -81,7 +81,7 @@ END FindString;
 
 PROCEDURE ReplaceString(CONST filename : Files.FileName; param : Parameters; stats : Statistics; context : Commands.Context);
 VAR
-	text : Texts.Text; pos, format, res : LONGINT;
+	text : Texts.Text; pos, format: LONGINT; res: WORD;
 	searchString, replaceString : SearchStringUCS; idx : LONGINT;
 	searchStringLen, replaceStringLen : LONGINT;
 	replaceCount : LONGINT;

+ 2 - 2
source/Serials.Mod

@@ -228,7 +228,7 @@ PROCEDURE SetTracePort*(portNumber: LONGINT; bps, data, parity, stop: LONGINT; V
 VAR
 	isOpen0: BOOLEAN;
 	bps0, data0, parity0, stop0 : LONGINT;
-	res1: LONGINT;
+	res1: WORD;
 	port: Port;
 BEGIN{EXCLUSIVE}
 	res := 0;
@@ -397,7 +397,7 @@ END Show;
 (** Test serial ports COM1 and if present COM2 with the generic driver *)
 PROCEDURE Test*(context : Commands.Context);
 VAR
-	result : LONGINT;
+	result : WORD;
 	portgotten : Port;
 BEGIN
 	context.out.String ("Testing availability of COM1 and COM2."); context.out.Ln;

+ 2 - 2
source/ShellCommands.Mod

@@ -397,11 +397,11 @@ BEGIN
 END execute;
 
 PROCEDURE Start*(context : Commands.Context);
-VAR msg: String; res: WORD; string : POINTER TO ARRAY OF CHAR;
+VAR msg: String; len: LONGINT; res: WORD; string : POINTER TO ARRAY OF CHAR;
 BEGIN
 	IF (context.arg IS Streams.StringReader) & (context.arg.Available() > 0) THEN
 		NEW(string, context.arg.Available() +1);
-		context.arg.Bytes(string^, 0, context.arg.Available(), res);
+		context.arg.Bytes(string^, 0, context.arg.Available(), len);
 		string[LEN(string)-1] := 0X;
 		execute(context, string^, {}, res, msg);
 		IF res # 0 THEN

+ 1 - 1
source/SyntaxHighlighter.Mod

@@ -1991,7 +1991,7 @@ PROCEDURE Highlight*(context : Commands.Context); (** filename highlighterName ~
 VAR
 	file : Files.File; filename : Files.FileName; highlighterName : Identifier;
 	highlighter : Highlighter;
-	text : Texts.Text; format, res : LONGINT;
+	text : Texts.Text; format: LONGINT; res: WORD;
 BEGIN
 	context.arg.SkipWhitespace; context.arg.String(filename);
 	context.arg.SkipWhitespace; context.arg.String(highlighterName);

+ 1 - 1
source/TCPTools.Mod

@@ -9,7 +9,7 @@ CONST
 (** Send a file to hostname:port. This can be used to send a PS file to a PS capable network printer (use port 9100) *)
 PROCEDURE SendFile*(context : Commands.Context); (** hostname port filename ~ *)
 VAR
-	hostname, adrStr : ARRAY 256 OF CHAR; ipAdr : IP.Adr; port, res : LONGINT;
+	hostname, adrStr : ARRAY 256 OF CHAR; ipAdr : IP.Adr; port: LONGINT; res: WORD;
 	filename : Files.FileName; file : Files.File; reader : Files.Reader;
 	offset, len : LONGINT;
 	buffer : POINTER TO ARRAY OF CHAR;

+ 2 - 2
source/TFAOParser.Mod

@@ -1103,12 +1103,12 @@ BEGIN {EXCLUSIVE}
 END DecWorker;
 
 PROCEDURE ScanModule*(CONST filename : ARRAY OF CHAR; dump : BOOLEAN; VAR m : TS.Module);
-VAR t : Texts.Text; res : WORD;
+VAR t : Texts.Text; res : WORD; format: LONGINT;
 	s : S.Scanner;
 	p : Parser;
 BEGIN
 	NEW(t);
-	TextUtilities.LoadAuto(t, filename, res, res);
+	TextUtilities.LoadAuto(t, filename, format, res);
 	IF res # 0 THEN
 		KernelLog.String(filename);  KernelLog.String(" not found"); KernelLog.Ln;
 		RETURN

+ 1 - 1
source/TFModuleTrees.Mod

@@ -460,7 +460,7 @@ TYPE
 			
 			done : BOOLEAN;
 			cr : Reference; count, i : LONGINT; refs : RefArray; 
-			t0, t1, res : LONGINT;
+			t0, t1: LONGINT; res: WORD;
 			child: WMTrees.TreeNode;
 	
 			PROCEDURE QuickSort(references: RefArray; lo, hi: LONGINT);

+ 2 - 2
source/TFPET.Mod

@@ -289,7 +289,7 @@ TYPE
 
 		(* Load settings from system configuration database *)
 		PROCEDURE Load;
-		VAR string : String; temp, res : LONGINT;
+		VAR string : String; temp: LONGINT; res: WORD;
 		BEGIN
 			(* General *)
 			Configuration.Get("Applications.PET.General.BackupOnStore", string, res);
@@ -1821,7 +1821,7 @@ TYPE
 		END FilenameEditEscapeHandler;
 
 		PROCEDURE LoadHandler(sender, data : ANY);
-		VAR filename : Filename; command : ARRAY 1024 OF CHAR; msg : ARRAY 64 OF CHAR; ignoreRes : LONGINT;
+		VAR filename : Filename; command : ARRAY 1024 OF CHAR; msg : ARRAY 64 OF CHAR; ignoreRes : WORD;
 		BEGIN
 			filenameEdit.GetAsString(filename);
 			Strings.TrimWS(filename);

+ 4 - 4
source/TFXRef.Mod

@@ -793,7 +793,7 @@ END InitWithText;
 PROCEDURE ProcessFile(CONST filename, targetPath : ARRAY OF CHAR; indexFile : Streams.Writer);
 VAR
 	module : TS.Module;
-	t : Texts.Text; res : WORD;
+	t : Texts.Text; res : WORD; format: LONGINT;
 	r : Streams.StringReader;
 	str : Strings.String;
 	name, path, targetFile : ARRAY 1024 OF CHAR;
@@ -809,7 +809,7 @@ BEGIN
 	TFAOParser.ScanModule(filename, FALSE, module);
 	IF module # NIL THEN
 		module.filename := Strings.NewString(filename);
-		TextUtilities.LoadAuto(t, filename, res, res);
+		TextUtilities.LoadAuto(t, filename, format, res);
 		str := InitWithText(t, 0);
 		NEW(r, Strings.Length(str^));
 		r.Set(str^);
@@ -841,7 +841,7 @@ VAR
 	sr : Streams.Reader;
 	t0, t1 : LONGINT;
 	module : TS.Module;
-	t : Texts.Text; res : WORD;
+	t : Texts.Text; res : WORD; format: LONGINT;
 	textReader : TextUtilities.TextReader;
 BEGIN
 	NEW(globalUses);
@@ -854,7 +854,7 @@ BEGIN
 	TFAOParser.ScanModule(filename, FALSE, module);
 	IF module # NIL THEN
 		module.filename := Strings.NewString(filename);
-		TextUtilities.LoadAuto(t, filename, res, res);
+		TextUtilities.LoadAuto(t, filename, format, res);
 		NEW(textReader, t);
 		GenerateModule(module, textReader, NIL);
 		TFDocGenerator.DocumentModule(module);

+ 2 - 2
source/TestServer.Mod

@@ -26,7 +26,7 @@ CONST
 
 TYPE
 	DiscardAgent = OBJECT (TCPServices.Agent)
-		VAR len, res: LONGINT; buf: ARRAY DiscardBufSize OF CHAR;
+		VAR len: LONGINT; res: WORD; buf: ARRAY DiscardBufSize OF CHAR;
 
 	BEGIN {ACTIVE}
 		REPEAT
@@ -40,7 +40,7 @@ TYPE
 
 TYPE
 	EchoAgent = OBJECT (TCPServices.Agent)
-		VAR len, res: LONGINT; buf: ARRAY EchoBufSize OF CHAR;
+		VAR len: LONGINT; res: WORD; buf: ARRAY EchoBufSize OF CHAR;
 
 	BEGIN {ACTIVE}
 		LOOP

+ 1 - 1
source/TextConverter.Mod

@@ -5,7 +5,7 @@ IMPORT Commands, Streams, Diagnostics, Files, Texts, TextUtilities;
 TYPE Converter = PROCEDURE (text : Texts.Text; CONST filename : ARRAY OF CHAR; VAR res : WORD);
 
 PROCEDURE Convert (diagnostics: Diagnostics.Diagnostics; list: Streams.Reader; converter: Converter);
-VAR text: Texts.Text; filename: Files.FileName; format, res: LONGINT;
+VAR text: Texts.Text; filename: Files.FileName; format: LONGINT; res: WORD;
 BEGIN
 	WHILE list.GetString (filename) DO
 		NEW (text);

+ 1 - 1
source/UnihanParser.Mod

@@ -43,7 +43,7 @@ VAR
 	isNum : ARRAY 256 OF BOOLEAN;
 
 PROCEDURE GetHex(r : Streams.Reader) : LONGINT;
-VAR c : CHAR; res : WORD;
+VAR c : CHAR; res: LONGINT;
 BEGIN
 	res := 0;
 	c := r.Get();

+ 5 - 3
source/VNC.Mod

@@ -39,7 +39,8 @@ TYPE
 		next: Connection;	(* link in connection pool *)
 		pcb: TCP.Connection;
 		w: Window;
-		res, id: LONGINT;
+		res: WORD;
+		id: LONGINT;
 		receiver: Receiver;
 		sender: Sender;
 		nb: Raster.Image;
@@ -169,7 +170,8 @@ TYPE
 	Sender = OBJECT
 		VAR
 			c: Connection;
-			head, middle, tail, res, lx, ly: LONGINT;
+			head, middle, tail, lx, ly: LONGINT;
+			res: WORD;
 			lkeys : SET;
 			buf: ARRAY OutBufSize OF CHAR;
 			done, poll: BOOLEAN;
@@ -885,7 +887,7 @@ END ReadString;
 
 PROCEDURE Open*(context : Commands.Context); (** server[pwd|?] port *)
 VAR
-	server: IP.Adr; res, port: LONGINT;
+	server: IP.Adr; res: WORD; port: LONGINT;
 	c: Connection; pwd: ARRAY 32 OF CHAR; svr, title: ARRAY 128 OF CHAR;
 BEGIN
 	context.arg.SkipWhitespace; context.arg.String(svr); context.arg.SkipWhitespace;

+ 12 - 12
source/WAVCodec.Mod

@@ -99,9 +99,9 @@ TYPE
 		hasMoreBytes : BOOLEAN;
 
 		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
-		VAR len: LONGINT; c: CHAR;
+		VAR len, inLen: LONGINT; c: CHAR;
 		BEGIN
-			res := -1;
+			res := -1; inLen := 0;
 			IF in = NIL THEN
 				KernelLog.String("WAVDecoder - InputStream is NIL"); KernelLog.Ln;
 				RETURN;
@@ -109,22 +109,22 @@ TYPE
 			SELF.in := in;
 
 			(* Read header and check for correctness *)
-			in.Bytes(h.chunkRIFF, 0, 4, res);
-			IF (res # 4) OR (h.chunkRIFF # "RIFF") THEN
+			in.Bytes(h.chunkRIFF, 0, 4, inLen);
+			IF (inLen # 4) OR (h.chunkRIFF # "RIFF") THEN
 				KernelLog.String("WAVDecoder - RIFF header ID not found"); KernelLog.Ln;
 				RETURN;
 			END;
 
 			ReadRawBELongInt(in, h.fileSize);
 
-			in.Bytes(h.chunkWAVE, 0, 4, res);
-			IF (res # 4) OR (h.chunkWAVE # "WAVE") THEN
+			in.Bytes(h.chunkWAVE, 0, 4, inLen);
+			IF (inLen # 4) OR (h.chunkWAVE # "WAVE") THEN
 				KernelLog.String("WAVDecoder - WAVE header ID not found"); KernelLog.Ln;
 				RETURN;
 			END;
 
-			in.Bytes(h.chunkfmt, 0, 4, res);
-			IF (res # 4) OR (h.chunkfmt # "fmt ") THEN
+			in.Bytes(h.chunkfmt, 0, 4, inLen);
+			IF (inLen # 4) OR (h.chunkfmt # "fmt ") THEN
 				KernelLog.String("WAVDecoder - fmt header ID not found"); KernelLog.Ln;
 				RETURN;
 			END;
@@ -156,12 +156,12 @@ TYPE
 			WHILE len > 0 DO c := in.Get(); DEC(len) END;
 
 			REPEAT
-				in.Bytes(h.chunkdata, 0, 4, res);
-			UNTIL (res = 4) & (h.chunkdata = "data") OR (in.Pos() >= (h.fileSize + 8));
+				in.Bytes(h.chunkdata, 0, 4, inLen);
+			UNTIL (inLen = 4) & (h.chunkdata = "data") OR (in.Pos() >= (h.fileSize + 8));
 
-			IF (res # 4) OR (h.chunkdata # "data") THEN
+			IF (inLen # 4) OR (h.chunkdata # "data") THEN
 				KernelLog.String("WAVDecoder - data header ID not found"); KernelLog.Ln;
-				KernelLog.String("res= "); KernelLog.Int(res, 0);
+				KernelLog.String("res= "); KernelLog.Int(inLen, 0);
 				KernelLog.String("h.chunkdata= "); KernelLog.String(h.chunkdata);
 				RETURN;
 			END;