فهرست منبع

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 سال پیش
والد
کامیت
1aa7d10a93
5فایلهای تغییر یافته به همراه20 افزوده شده و 20 حذف شده
  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);
 		PROCEDURE Bytes*(VAR x: ARRAY OF CHAR; ofs, size: LONGINT; VAR len: LONGINT);
 		VAR
 		VAR
-			min, res: LONGINT;
+			min: LONGINT; res: WORD;
 		BEGIN
 		BEGIN
 			IF Debug THEN KernelLog.String("Bytes"); KernelLog.Ln; END;
 			IF Debug THEN KernelLog.String("Bytes"); KernelLog.Ln; END;
 			demultiplexer.GetData(streamNr, x, ofs, size, min, len, res);
 			demultiplexer.GetData(streamNr, x, ofs, size, min, len, res);
@@ -228,7 +228,7 @@ IMPORT
 
 
 		(* Set Byte Position *)
 		(* Set Byte Position *)
 		PROCEDURE SetPos*(pos : Streams.Position);
 		PROCEDURE SetPos*(pos : Streams.Position);
-		VAR seekType, itemSize, res : LONGINT;
+		VAR seekType, itemSize: LONGINT; res : WORD;
 		BEGIN
 		BEGIN
 			IF Debug THEN KernelLog.String("DemuxStream.SetPos"); KernelLog.Ln; END;
 			IF Debug THEN KernelLog.String("DemuxStream.SetPos"); KernelLog.Ln; END;
 			seekType := AOC.SeekByte;
 			seekType := AOC.SeekByte;
@@ -1075,7 +1075,7 @@ IMPORT
 
 
 		END GetInfo;
 		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
 		VAR
 			rres: BOOLEAN;
 			rres: BOOLEAN;
 		BEGIN
 		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;
 	END PCIPresent;
 
 
 	PROCEDURE FindPCIDevice*(devId, vendId, idx: LONGINT; VAR busNr, devNr, fktNr: LONGINT): LONGINT;
 	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}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			StartIterate(pci); index := 0;
 			StartIterate(pci); index := 0;
@@ -111,7 +111,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END FindPCIDevice;
 	END FindPCIDevice;
 
 
 	PROCEDURE FindPCIClassCode*(classCode, idx: LONGINT; VAR busNr, devNr, fktNr: LONGINT): LONGINT;
 	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}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			StartIterate(pci);
 			StartIterate(pci);
@@ -214,7 +214,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END GetIrqRoutingOptions;
 	END GetIrqRoutingOptions;
 
 
 	PROCEDURE SetPCIIrq*(IntPin, IrqNum, busNr, devNr, fktNr: LONGINT): LONGINT;
 	PROCEDURE SetPCIIrq*(IntPin, IrqNum, busNr, devNr, fktNr: LONGINT): LONGINT;
-	VAR res:WORD;
+	VAR res: WORD;
 	BEGIN {EXCLUSIVE}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			(*
 			(*
@@ -293,7 +293,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 
 
 
 
 	PROCEDURE Show*;
 	PROCEDURE Show*;
-	VAR version, lastPCIBus, hwMech, res : LONGINT;
+	VAR version, lastPCIBus, hwMech: LONGINT; res : WORD;
 	BEGIN
 	BEGIN
 		IF ~PCIDisabled() THEN
 		IF ~PCIDisabled() THEN
 			res := PCIPresent(version, lastPCIBus, hwMech);
 			res := PCIPresent(version, lastPCIBus, hwMech);
@@ -340,7 +340,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig32;
 	END PCIReadConfig32;
 
 
 	PROCEDURE PCIReadConfig16(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -357,7 +357,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig16;
 	END PCIReadConfig16;
 
 
 	PROCEDURE PCIReadConfig8(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -374,7 +374,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIReadConfig8;
 	END PCIReadConfig8;
 
 
 	PROCEDURE PCIWriteConfig32(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -390,7 +390,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIWriteConfig32;
 	END PCIWriteConfig32;
 
 
 	PROCEDURE PCIWriteConfig16(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -406,7 +406,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END PCIWriteConfig16;
 	END PCIWriteConfig16;
 
 
 	PROCEDURE PCIWriteConfig8(pciBus, pciDev, pciFn: LONGINT; reg: LONGINT;  val: LONGINT): LONGINT;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -456,7 +456,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END StartIterate;
 	END StartIterate;
 
 
 	PROCEDURE Iterate*(VAR pci: Pci): BOOLEAN;
 	PROCEDURE Iterate*(VAR pci: Pci): BOOLEAN;
-	VAR hdrType,res: LONGINT; multifunction: BOOLEAN;
+	VAR hdrType: LONGINT; multifunction: BOOLEAN; res: WORD;
 	BEGIN
 	BEGIN
 		IF pci.function = 0 THEN
 		IF pci.function = 0 THEN
 			(* check if multi-function device *)
 			(* check if multi-function device *)
@@ -589,7 +589,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END DisplayDeviceClass;
 	END DisplayDeviceClass;
 
 
 	PROCEDURE TracePCIDevices;
 	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
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			KernelLog.String("PCI Devices"); KernelLog.Ln;
 			KernelLog.String("PCI Devices"); KernelLog.Ln;

+ 1 - 1
source/BootConsole.Mod

@@ -24,7 +24,7 @@ CONST
 	TraceBoot = FALSE;
 	TraceBoot = FALSE;
 
 
 PROCEDURE BootCommand(CONST config: ARRAY OF CHAR; flags: SET);
 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
 BEGIN
 	COPY(config, par);
 	COPY(config, par);
 	i := 0; j := 0; WHILE par[j] # 0X DO INC(j) END;
 	i := 0; j := 0; WHILE par[j] # 0X DO INC(j) END;

+ 1 - 1
source/CharacterLineup.Mod

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

+ 4 - 4
source/Codecs.Mod

@@ -42,7 +42,7 @@ TYPE
 		f* : Files.File;
 		f* : Files.File;
 		streamInfo*: AVStreamInfo;
 		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
 		BEGIN
 			f.ReadBytes(r, buf, ofs, size);
 			f.ReadBytes(r, buf, ofs, size);
 			len := size - r.res;
 			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 *)
 		(* 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! *)
 		(* 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;
 		END GetData;
 
 
 		(* seek the streamNr to position pos (defined bz seekType), res = 0 if Ok, otherwise an error number *)
 		(* 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)
 			InitReader(Receive, 4096)
 		END Open;
 		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
 		BEGIN
 			demultiplexer.GetData(streamNr, buf, ofs, size, min, len, res)
 			demultiplexer.GetData(streamNr, buf, ofs, size, min, len, res)
 		END Receive;
 		END Receive;
 
 
 		PROCEDURE SetPos*(pos : Streams.Position);
 		PROCEDURE SetPos*(pos : Streams.Position);
-		VAR  seekType, itemSize, res: LONGINT;
+		VAR  seekType, itemSize: LONGINT; res: WORD;
 		BEGIN
 		BEGIN
 			seekType := SeekByte;
 			seekType := SeekByte;
 			demultiplexer.SetStreamPos(streamNr, seekType, pos, itemSize, res);
 			demultiplexer.SetStreamPos(streamNr, seekType, pos, itemSize, res);