Browse Source

use WORD instead of LONGINT for result type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8453 8c9fc860-2736-0410-a75d-ab315db34111
eth.metacore 6 years ago
parent
commit
1aa7d10a93
5 changed files with 20 additions and 20 deletions
  1. 3 3
      source/AVI.Mod
  2. 11 11
      source/BIOS.PCI.Mod
  3. 1 1
      source/BootConsole.Mod
  4. 1 1
      source/CharacterLineup.Mod
  5. 4 4
      source/Codecs.Mod

+ 3 - 3
source/AVI.Mod

@@ -220,7 +220,7 @@ IMPORT
 
 		PROCEDURE Bytes*(VAR x: ARRAY OF CHAR; ofs, size: LONGINT; VAR len: LONGINT);
 		VAR
-			min, res: LONGINT;
+			min: LONGINT; res: WORD;
 		BEGIN
 			IF Debug THEN KernelLog.String("Bytes"); KernelLog.Ln; END;
 			demultiplexer.GetData(streamNr, x, ofs, size, min, len, res);
@@ -228,7 +228,7 @@ IMPORT
 
 		(* Set Byte Position *)
 		PROCEDURE SetPos*(pos : Streams.Position);
-		VAR seekType, itemSize, res : LONGINT;
+		VAR seekType, itemSize: LONGINT; res : WORD;
 		BEGIN
 			IF Debug THEN KernelLog.String("DemuxStream.SetPos"); KernelLog.Ln; END;
 			seekType := AOC.SeekByte;
@@ -1075,7 +1075,7 @@ IMPORT
 
 		END GetInfo;
 
-		PROCEDURE GetData*(streamNr: LONGINT;  VAR buf:  ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len, res: LONGINT);
+		PROCEDURE GetData*(streamNr: LONGINT;  VAR buf:  ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len: LONGINT; VAR res: WORD);
 		VAR
 			rres: BOOLEAN;
 		BEGIN

+ 11 - 11
source/BIOS.PCI.Mod

@@ -78,7 +78,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIPresent;
 
 	PROCEDURE FindPCIDevice*(devId, vendId, idx: LONGINT; VAR busNr, devNr, fktNr: LONGINT): LONGINT;
-	VAR pci: Pci; r0, vendorId, deviceId, index,res: LONGINT;
+	VAR pci: Pci; r0, vendorId, deviceId, index: LONGINT; res: WORD;
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 			StartIterate(pci); index := 0;
@@ -111,7 +111,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END FindPCIDevice;
 
 	PROCEDURE FindPCIClassCode*(classCode, idx: LONGINT; VAR busNr, devNr, fktNr: LONGINT): LONGINT;
-	VAR pci: Pci; r0, r8,  index,res,class: LONGINT;
+	VAR pci: Pci; r0, r8,  index, class: LONGINT; res: WORD;
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 			StartIterate(pci);
@@ -214,7 +214,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END GetIrqRoutingOptions;
 
 	PROCEDURE SetPCIIrq*(IntPin, IrqNum, busNr, devNr, fktNr: LONGINT): LONGINT;
-	VAR res:WORD;
+	VAR res: WORD;
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 			(*
@@ -293,7 +293,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 
 
 	PROCEDURE Show*;
-	VAR version, lastPCIBus, hwMech, res : LONGINT;
+	VAR version, lastPCIBus, hwMech: LONGINT; res : WORD;
 	BEGIN
 		IF ~PCIDisabled() THEN
 			res := PCIPresent(version, lastPCIBus, hwMech);
@@ -340,7 +340,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig32;
 
 	PROCEDURE PCIReadConfig16(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET;res: WORD; int: INTEGER;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD; int: INTEGER;
 	BEGIN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
@@ -357,7 +357,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig16;
 
 	PROCEDURE PCIReadConfig8(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET;res: WORD; chr: CHAR;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD; chr: CHAR;
 	BEGIN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
@@ -374,7 +374,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig8;
 
 	PROCEDURE PCIWriteConfig32(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET;res: WORD;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD;
 	BEGIN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
@@ -390,7 +390,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIWriteConfig32;
 
 	PROCEDURE PCIWriteConfig16(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET;res: WORD;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD;
 	BEGIN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
@@ -406,7 +406,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIWriteConfig16;
 
 	PROCEDURE PCIWriteConfig8(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET;res: WORD;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD;
 	BEGIN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
@@ -456,7 +456,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END StartIterate;
 
 	PROCEDURE Iterate*(VAR pci: Pci): BOOLEAN;
-	VAR hdrType,res: LONGINT; multifunction: BOOLEAN;
+	VAR hdrType: LONGINT; multifunction: BOOLEAN; res: WORD;
 	BEGIN
 		IF pci.function = 0 THEN
 			(* check if multi-function device *)
@@ -589,7 +589,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END DisplayDeviceClass;
 
 	PROCEDURE TracePCIDevices;
-	VAR r0,r8,r10 : LONGINT; pci: Pci; res, class, subclass, api, vendorId, deviceId: LONGINT;
+	VAR r0,r8,r10 : LONGINT; pci: Pci; class, subclass, api, vendorId, deviceId: LONGINT; res: WORD;
 	BEGIN
 		IF pciEnabled THEN
 			KernelLog.String("PCI Devices"); KernelLog.Ln;

+ 1 - 1
source/BootConsole.Mod

@@ -24,7 +24,7 @@ CONST
 	TraceBoot = FALSE;
 
 PROCEDURE BootCommand(CONST config: ARRAY OF CHAR; flags: SET);
-VAR i, j, res: LONGINT; par: ARRAY 32 OF CHAR; s: ARRAY 256 OF CHAR;
+VAR i, j: LONGINT; res: WORD; par: ARRAY 32 OF CHAR; s: ARRAY 256 OF CHAR;
 BEGIN
 	COPY(config, par);
 	i := 0; j := 0; WHILE par[j] # 0X DO INC(j) END;

+ 1 - 1
source/CharacterLineup.Mod

@@ -246,7 +246,7 @@ TYPE
 		END NewCharacter;
 
 		PROCEDURE NewCode(sender, data :ANY);
-		VAR code, res : LONGINT;
+		VAR code: LONGINT; res : WORD;
 			codeStr: ARRAY 9 OF CHAR;
 		BEGIN
 			codeEdit.GetAsString(codeStr);

+ 4 - 4
source/Codecs.Mod

@@ -42,7 +42,7 @@ TYPE
 		f* : Files.File;
 		streamInfo*: AVStreamInfo;
 
-		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
 			f.ReadBytes(r, buf, ofs, size);
 			len := size - r.res;
@@ -95,7 +95,7 @@ TYPE
 
 		(* read data from streamNr, store it into buffer buf starting at offset ofs, store size bytes if possible, block if not read min bytes at least. Return number of read bytes in len and return code res *)
 		(* this procedure should not be directly called - it is called by the DemuxStream object! *)
-		PROCEDURE GetData*(streamNr : LONGINT; VAR buf: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len, res: LONGINT);
+		PROCEDURE GetData*(streamNr : LONGINT; VAR buf: ARRAY OF CHAR; ofs, size, min: LONGINT; VAR len: LONGINT; VAR res: WORD);
 		END GetData;
 
 		(* seek the streamNr to position pos (defined bz seekType), res = 0 if Ok, otherwise an error number *)
@@ -118,13 +118,13 @@ TYPE
 			InitReader(Receive, 4096)
 		END Open;
 
-		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
 			demultiplexer.GetData(streamNr, buf, ofs, size, min, len, res)
 		END Receive;
 
 		PROCEDURE SetPos*(pos : Streams.Position);
-		VAR  seekType, itemSize, res: LONGINT;
+		VAR  seekType, itemSize: LONGINT; res: WORD;
 		BEGIN
 			seekType := SeekByte;
 			demultiplexer.SetStreamPos(streamNr, seekType, pos, itemSize, res);