Browse Source

fix result type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8466 8c9fc860-2736-0410-a75d-ab315db34111
eth.metacore 6 years ago
parent
commit
017af82472

+ 2 - 2
source/BenchSyntaxHighlighter.Mod

@@ -136,7 +136,7 @@ VAR
 	filename : Files.FileName; highlighterName, benchmark : ARRAY 64 OF CHAR; nofIterations : LONGINT;
 	options : Options.Options;
 	text : Texts.Text; reader : Texts.TextReader;
-	format, res : LONGINT;
+	format : LONGINT; res: WORD;
 	highlighter : SyntaxHighlighter.Highlighter;
 BEGIN
 	NEW(options);
@@ -199,7 +199,7 @@ VAR
 	highlighter : SyntaxHighlighter.Highlighter;
 	text : Texts.Text; reader : Texts.TextReader; char32 : Texts.Char32;
 	token : SyntaxHighlighter.Token;
-	position, format, res : LONGINT;
+	position, format : LONGINT; res: WORD;
 BEGIN
 	NEW(options);
 	options.Add("d", "details", Options.Flag);

+ 6 - 3
source/BenchTCP.Mod

@@ -16,7 +16,9 @@ TYPE
 
 TYPE
 	Sender = OBJECT
-		VAR c: TCP.Connection; num, num0, res: LONGINT; buf: Bytes; done: BOOLEAN;
+		VAR
+			res: WORD;
+			c: TCP.Connection; num, num0: LONGINT; buf: Bytes; done: BOOLEAN;
 
 		PROCEDURE &Init*(c: TCP.Connection; buf: Bytes; num: LONGINT);
 		BEGIN
@@ -25,7 +27,7 @@ TYPE
 			done := FALSE
 		END Init;
 
-		PROCEDURE Join(): LONGINT;
+		PROCEDURE Join(): WORD;
 		BEGIN {EXCLUSIVE}
 			AWAIT(done);
 			RETURN res
@@ -45,7 +47,8 @@ TYPE
 TYPE
 	Tester = OBJECT
 		VAR
-			c: TCP.Connection; num, num0, res, port, total, len: LONGINT; fip: IP.Adr;
+			res: WORD;
+			c: TCP.Connection; num, num0, port, total, len: LONGINT; fip: IP.Adr;
 			timer: Kernel.MilliTimer; sender: Sender; server: ARRAY 64 OF CHAR;
 			time:HUGEINT;
 

+ 1 - 1
source/BimboMail.Mod

@@ -182,7 +182,7 @@ TYPE
 		END DrawCell; *)
 
 		PROCEDURE MessageClick(sender, data : ANY);
-		VAR scol, srow, ecol, erow, y, res : LONGINT; text : Texts.Text;
+		VAR scol, srow, ecol, erow, y : LONGINT; res: WORD; text : Texts.Text;
 		BEGIN
 			messageList.GetSelection(scol, srow, ecol, erow);
 			y := srow - 1;

+ 1 - 1
source/DTPEditor.Mod

@@ -836,7 +836,7 @@ TYPE
 			content : DTPData.ContentObject;
 			page : DTPData.PageObject; mpage: DTPData.MasterPageObject;
 			frame : DTPData.FrameObject;
-			tempReal: LONGREAL; tempInt, res : LONGINT; tempBool: BOOLEAN;
+			tempReal: LONGREAL; tempInt: LONGINT; res: WORD; tempBool: BOOLEAN;
 			mt, mb, ml, mr: REAL;
 		BEGIN
 			NEW(built, 0, 0, 0, 0, 0, 0, FALSE);

+ 2 - 2
source/DTPRect.Mod

@@ -104,7 +104,7 @@ TYPE
 		VAR name : Strings.String;
 			cont: XMLObjects.Enumerator;
 			ptr: ANY;
-			tempInt, res : LONGINT;
+			tempInt : LONGINT; res: WORD;
 			tempReal : LONGREAL;
 		BEGIN
 			cont := elem.GetContents(); cont.Reset();
@@ -432,7 +432,7 @@ TYPE
 		PROCEDURE SetValueHandler(sender, data: ANY);
 		VAR
 			colorString, origString : ARRAY 128 OF CHAR;
-			color, res : LONGINT;
+			color : LONGINT; res: WORD;
 			width: LONGREAL;
 			bool: BOOLEAN;
 

+ 4 - 4
source/DTPUtilities.Mod

@@ -96,7 +96,7 @@ TYPE
 		label : WMStandardComponents.Label;
 		panel : WMStandardComponents.Panel;
 		button : WMStandardComponents.Button;
-		result, chosenColor* : LONGINT;
+		result: WORD; chosenColor* : LONGINT;
 		shown : BOOLEAN;
 
 		PROCEDURE CreateForm() : WMComponents.VisualComponent;
@@ -829,7 +829,7 @@ TYPE
 		PROCEDURE UpdateValueHandler(sender, data: ANY);
 		VAR tempString : ARRAY 64 OF CHAR;
 			tempLReal : LONGREAL;
-			tempInt, res : LONGINT;
+			tempInt : LONGINT; res: WORD;
 			tempCharStyle: DTPData.CharacterStyleObject;
 			tempFont: WMGraphics.Font;
 		BEGIN
@@ -1271,7 +1271,7 @@ TYPE
 		PROCEDURE ImportCharacterStyles(filename: ARRAY OF CHAR);
 		VAR tempString : ARRAY 256 OF CHAR;
 			tempReal: LONGREAL;
-			tempInt, res: LONGINT;
+			tempInt: LONGINT; res: WORD;
 			reader : Files.Reader;
 			parser : XMLParser.Parser;
 			scanner : XMLScanner.Scanner;
@@ -1338,7 +1338,7 @@ TYPE
 		PROCEDURE ApplyCHandler(sender, data: ANY);
 		VAR tempString : ARRAY 256 OF CHAR;
 			tempLReal: LONGREAL;
-			tempInt, res : LONGINT;
+			tempInt: LONGINT; res: WORD;
 			tempFont : WMGraphics.Font;
 		BEGIN
 			(* retrieve tempvalues first for those who didn't press enter after changing a value... *)

+ 1 - 1
source/GfxFonts.Mod

@@ -684,7 +684,7 @@ MODULE GfxFonts; (** non-portable *)	(* eos  *)
 
 	PROCEDURE OpenExtension (VAR family, style: ARRAY OF CHAR; ptsize: INTEGER; VAR m: GfxMatrix.Matrix): Font;
 		VAR
-			i, j, n, res: LONGINT;
+			i, j, n: LONGINT; res: WORD;
 			enum: Files.Enumerator; time, date, size: LONGINT;  continue: BOOLEAN;
 			name: Files.FileName; msg, cmd: ARRAY 64 OF CHAR; flags: SET;
 	BEGIN

+ 2 - 2
source/HTMLTransformer.Mod

@@ -2726,7 +2726,7 @@ END Gb23122Utf8;
 PROCEDURE GetColor(s : String) : LONGINT;
 VAR
 	aoc : ARRAY 17 OF CHAR;
-	i, res : LONGINT;
+	i : LONGINT; res: WORD;
 BEGIN
 	IF s#NIL THEN
 		IF (s^[0]='#') THEN
@@ -3147,7 +3147,7 @@ PROCEDURE GetCharEnt(VAR ent : ARRAY OF CHAR) : String;
 VAR
 	temp : String;
 	aoc : ARRAY 5 OF CHAR;
-	res, suc, len : LONGINT;
+	res, len : LONGINT; suc: WORD;
 BEGIN
 	res := 0;
 	IF ent[0] = '#' THEN

+ 1 - 1
source/JoysticksTest.Mod

@@ -94,7 +94,7 @@ VAR
 	nbrOfJoysticks : LONGINT;
 
 PROCEDURE CreateJoystick*(context : Commands.Context); (* [nbrOfButtons] ~ *)
-VAR joystick : SimulatedJoystick; nbrOfButtons, nbrOfAxis, res : LONGINT;
+VAR joystick : SimulatedJoystick; nbrOfButtons, nbrOfAxis: LONGINT; res : WORD;
 BEGIN
 	context.arg.SkipWhitespace; context.arg.Int(nbrOfButtons, FALSE);
 	context.arg.SkipWhitespace; context.arg.Int(nbrOfAxis, FALSE);

+ 1 - 1
source/MP3Player.Mod

@@ -25,7 +25,7 @@ TYPE
 
 		(* Initialize Player with the given File *)
 		PROCEDURE &Init*(in : Streams.Reader; length: LONGINT);
-		VAR i, res : LONGINT;
+		VAR i: LONGINT; res: WORD;
 		BEGIN
 			ready := FALSE; finished := FALSE; paused := FALSE; oldPos := 0;
 			SELF.in := in;

+ 3 - 3
source/OGGUtilities.Mod

@@ -479,7 +479,7 @@ TYPE
 
 	(** compute the correct length of the value index for a codebook VQ lookup table of lookup type 1 *)
 	PROCEDURE Lookup1Values*(cbEntries, cbDimensions: LONGINT): LONGINT;
-	VAR res: WORD;
+	VAR res: LONGINT;
 	BEGIN
 		res := 0;
 		WHILE (Power(res, cbDimensions) <= cbEntries) DO
@@ -596,7 +596,7 @@ TYPE
 
 	(** return x to the power of n (ASSERT(n>=0)) *)
 	PROCEDURE Power*(x,n: LONGINT): LONGINT;
-	VAR res: WORD;
+	VAR res: LONGINT;
 	BEGIN
 		IF (n < 0) THEN
 			KernelLog.String("ASSERTION failed - power of negative numbers are not allowed"); KernelLog.Ln
@@ -656,7 +656,7 @@ TYPE
 
 	(** returns the logarithm to the base 2 *)
 	PROCEDURE Log2n*(n: LONGINT): LONGINT;
-	VAR res: WORD;
+	VAR res: LONGINT;
 	BEGIN
 		ASSERT(n > 0);
 		res := 0;

+ 5 - 5
source/OGGVorbisPlayer.Mod

@@ -137,7 +137,7 @@ TYPE
 
 			(* get the next bit from the stream (lsb first) *)
 			PROCEDURE GetBit(): LONGINT;
-			VAR res: WORD;
+			VAR res: LONGINT;
 			BEGIN
 				IF (bsLive = 0) THEN
 					bsBuff := ORD(r.Get());
@@ -233,7 +233,7 @@ TYPE
 
 		(* get the next bit from the buffer (lsb first) *)
 		PROCEDURE GetBit(VAR buf: ARRAY OF CHAR): LONGINT;
-		VAR res: WORD;
+		VAR res: LONGINT;
 		BEGIN
 			IF ((LEN(buf) # pos) & (len # pos) & (bsLive = 0)) THEN
 				bsBuff := ORD(buf[pos]);
@@ -2193,7 +2193,7 @@ TYPE
 		END CloseSoundChannel;
 
 		PROCEDURE InitSoundChannel*(nrOfChannels, samplingRate, samplingResolution: LONGINT);
-		VAR i, res: LONGINT;
+		VAR i: LONGINT; res: WORD;
 			buffer: SoundDevices.Buffer;
 		BEGIN
 		 	IF (Trace IN Debug) THEN
@@ -2448,7 +2448,7 @@ TYPE
 
 		(* start the decoding proccess *)
 		PROCEDURE StartDecode(VAR soundOutput: SoundOutput): LONGINT;
-		VAR res: WORD;
+		VAR res: LONGINT;
 		BEGIN
 			IF (Trace IN Debug) THEN
 				OGGUtilities.String("@StartDecode()")
@@ -3414,7 +3414,7 @@ InverseDBLookupReal[255] := 1;
 		output: SoundOutput;
 		rh : WebHTTP.RequestHeader;
 		h : WebHTTP.ResponseHeader;
-		res, volume, nrOfBuffers: LONGINT;
+		res: WORD; volume, nrOfBuffers: LONGINT;
 		con : TCP.Connection;
 		outputFilename: ARRAY 64 OF CHAR;
 		timer: Kernel.Timer;

+ 5 - 5
source/Release.Mod

@@ -794,7 +794,7 @@ TYPE
 		END GeneratePackageFile;
 
 		PROCEDURE GenerateZipFiles(out, error : Streams.Writer; diagnostics : Diagnostics.Diagnostics; VAR err : BOOLEAN);
-		VAR packageArray : PackageArray; i, res : LONGINT;
+		VAR packageArray : PackageArray; i : LONGINT; res: WORD;
 
 			PROCEDURE AddFile(archive: Zip.Archive; CONST srcname,  dstname: ARRAY OF CHAR; VAR res: WORD);
 			VAR f: Files.File; r: Files.Rider; pathName, fileName: Files.FileName;
@@ -2791,7 +2791,7 @@ PROCEDURE GetReader(file : File; diagnostics : Diagnostics.Diagnostics) : Stream
 VAR
 	reader : Streams.Reader;
 	fileReader : Files.Reader; ch1, ch2 : CHAR; offset : LONGINT;
-	text : Texts.Text; textReader : TextUtilities.TextReader; format, res : LONGINT;
+	text : Texts.Text; textReader : TextUtilities.TextReader; format : LONGINT; res: WORD;
 	message : ARRAY 256 OF CHAR;
 BEGIN
 	ASSERT((file # NIL) & (diagnostics # NIL));
@@ -2867,7 +2867,7 @@ PROCEDURE ParseBuildFile*(
 	log: Streams.Writer;
 	diagnostics : Diagnostics.Diagnostics
 	) : BOOLEAN;
-VAR text : Texts.Text; format, res : LONGINT; message : ARRAY 256 OF CHAR;
+VAR text : Texts.Text; format : LONGINT; res: WORD; message : ARRAY 256 OF CHAR;
 BEGIN
 	log.String("Loading package description file "); log.String(filename); log.String(" ... ");
 	log.Update;
@@ -3271,7 +3271,7 @@ VAR
 	buildname : ARRAY 32 OF CHAR;
 	start0 : Dates.DateTime;
 	error : BOOLEAN;
-	nofWorkers, res : LONGINT;
+	nofWorkers : LONGINT; res: WORD;
 BEGIN
 	NEW(options);
 	options.Add("b", "build", Options.Flag);
@@ -3389,7 +3389,7 @@ VAR
 	buildname : ARRAY 32 OF CHAR;
 	start0 : Dates.DateTime;
 	error : BOOLEAN;
-	nofWorkers, res : LONGINT;
+	nofWorkers : LONGINT; res: WORD;
 BEGIN
 	NEW(options);
 	options.Add("b", "build", Options.Flag);

+ 1 - 1
source/SVGColors.Mod

@@ -158,7 +158,7 @@ TYPE
 
 (* Parse a color specified by name or value *)
 PROCEDURE Parse*(value: Strings.String; VAR color: Color):BOOLEAN;
-VAR res, i, r, g, b: LONGINT;
+VAR res: WORD; i, r, g, b: LONGINT;
 	f: LONGREAL;
 BEGIN
 	IF value[0]='#' THEN

+ 1 - 1
source/TestMenu.Mod

@@ -187,7 +187,7 @@ TYPE
 		END Init;
 
 		PROCEDURE Execute;
-		VAR ignoreRes : LONGINT; ignoreMsg : ARRAY 1 OF CHAR;
+		VAR ignoreRes : WORD; ignoreMsg : ARRAY 1 OF CHAR;
 		BEGIN
 			Commands.Call(commandString, {}, ignoreRes, ignoreMsg);
 		END Execute;

+ 2 - 2
source/TestStrings.Mod

@@ -33,7 +33,7 @@ BEGIN
 END TestIntegerConversion;
 
 PROCEDURE TestHexConversion*(context : Commands.Context);
-VAR i, val, res : LONGINT; string : ARRAY 16 OF CHAR;
+VAR i, val : LONGINT; res: WORD; string : ARRAY 16 OF CHAR;
 BEGIN
 	context.out.String("Test hex <-> string conversion... "); context.out.Update;
 	i := MIN(LONGINT);
@@ -78,7 +78,7 @@ VAR i : LONGINT;
 	END Test;
 
 	PROCEDURE TestMaxLongintPlus1;
-	VAR string : ARRAY 16 OF CHAR; val, res : LONGINT;
+	VAR string : ARRAY 16 OF CHAR; val : LONGINT; res: WORD;
 	BEGIN
 		string := "-80000000";
 		Strings.HexStrToInt(string, val, res);

+ 1 - 1
source/WMSlideshow.Mod

@@ -1145,7 +1145,7 @@ END Cleanup;
  ****)
 PROCEDURE LoadImage(CONST name : ARRAY OF CHAR; fmt : Raster.Format): Image;
 VAR img : Image;
-	res, w, h, x : LONGINT;
+	res: WORD; w, h, x : LONGINT;
 	decoder : Codecs.ImageDecoder;
 	in : Streams.Reader;
 	ext : ARRAY 16 OF CHAR;

+ 3 - 3
source/WebBrowserComponents.Mod

@@ -258,7 +258,7 @@ TYPE
 			hScrollbar : WMStandardComponents.Scrollbar;
 			tv : WMTextView.TextView;
 			isoDecoder : Codecs.TextDecoder;
-			result : LONGINT;
+			result : WORD;
 		BEGIN
 			Init;
 			takesFocus.Set(FALSE);
@@ -315,7 +315,7 @@ log : Streams.Writer;*)
 			con : ResourceConnection;
 			charset: WebHTTP.AdditionalField;
 			reader : Streams.Reader;
-			result : LONGINT;
+			result : WORD;
 			cnt : LONGINT;
 		BEGIN
 			server := GetServer(url^);
@@ -559,7 +559,7 @@ END GetMimeType;
 PROCEDURE LoadImage*(reader : Streams.Reader; mimeType : ARRAY OF CHAR; name : ARRAY OF CHAR): WMGraphics.Image;
 VAR
 	img : WMGraphics.Image;
-	res, w, h, x : LONGINT;
+	res: WORD; w, h, x : LONGINT;
 	decoder : Codecs.ImageDecoder;
 	ext : String;