Bläddra i källkod

Use WORD instead of LONGINT as result type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8009 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 år sedan
förälder
incheckning
582455f41c
100 ändrade filer med 453 tillägg och 453 borttagningar
  1. 2 2
      source/AFM.Mod
  2. 1 1
      source/AM79C970.Mod
  3. 21 21
      source/AMD64.ATADisks.Mod
  4. 2 2
      source/AMD64.IP.Mod
  5. 2 2
      source/AMD64.IPv4.Mod
  6. 2 2
      source/AMD64.MemCache.Mod
  7. 2 2
      source/AMD64.MemInfo.Mod
  8. 2 2
      source/AMD64.PCI.Mod
  9. 2 2
      source/AMD64.UsbKeyboard.Mod
  10. 2 2
      source/ARM.IP.Mod
  11. 2 2
      source/ARM.IPv4.Mod
  12. 3 3
      source/AVI.Mod
  13. 2 2
      source/Adaptec7.Mod
  14. 3 3
      source/AlmSmtpReceiver.Mod
  15. 5 5
      source/AnimationCodec.Mod
  16. 2 2
      source/Archives.Mod
  17. 1 1
      source/Autostart.Mod
  18. 8 8
      source/BB.StdCoder.Mod
  19. 2 2
      source/BMPCodec.Mod
  20. 1 1
      source/BT848.Mod
  21. 1 1
      source/BenchTCP.Mod
  22. 1 1
      source/BimboScanner.Mod
  23. 11 11
      source/BiosFreePCI.Mod
  24. 5 5
      source/Bluetooth.Mod
  25. 15 15
      source/BluetoothHCI.Mod
  26. 5 5
      source/BluetoothL2CAP.Mod
  27. 1 1
      source/BluetoothRFCOMM.Mod
  28. 8 8
      source/BluetoothTest.Mod
  29. 3 3
      source/BluetoothUART.Mod
  30. 3 3
      source/BluetoothUSB.Mod
  31. 1 1
      source/BootConsole.Mod
  32. 1 1
      source/BootShell.Mod
  33. 1 1
      source/CATServer.Mod
  34. 11 11
      source/CDRecord.Mod
  35. 18 18
      source/CDRecordLib.Mod
  36. 4 4
      source/CDRecordUtils.Mod
  37. 2 2
      source/CRC.Mod
  38. 3 3
      source/CSV.Test
  39. 34 34
      source/Codecs.Mod
  40. 1 1
      source/CommandTest.Mod
  41. 6 6
      source/Commands.Mod
  42. 8 8
      source/Configuration.Mod
  43. 1 1
      source/ContextualDependency.Mod
  44. 2 2
      source/Coop.MemCache.Mod
  45. 3 3
      source/Coop.Modules.Mod
  46. 1 1
      source/Coop.Windows.Display.Mod
  47. 1 1
      source/CyberbitNetInstall.Mod
  48. 10 10
      source/CyrillicUtilities.Mod
  49. 2 2
      source/DHCP.Mod
  50. 4 4
      source/DNS.Mod
  51. 3 3
      source/DTPEditor.Mod
  52. 1 1
      source/DTPText.Mod
  53. 1 1
      source/DTPUtilities.Mod
  54. 5 5
      source/Darwin.AMD64.Unix.Mod
  55. 5 5
      source/Darwin.I386.Unix.Mod
  56. 1 1
      source/DataIO.Mod
  57. 1 1
      source/DebugLog.Mod
  58. 1 1
      source/Decoder.Mod
  59. 4 4
      source/DiskFS.Mod
  60. 1 1
      source/DiskTests.Mod
  61. 5 5
      source/Diskettes.Mod
  62. 5 5
      source/Disks.Mod
  63. 1 1
      source/DisplayNull.Mod
  64. 1 1
      source/DriverDatabase.Mod
  65. 2 2
      source/EnsoniqSound.Mod
  66. 5 5
      source/Errors.Mod
  67. 3 3
      source/EventsUtils.Mod
  68. 13 13
      source/FATFiles.Mod
  69. 6 6
      source/FATScavenger.Mod
  70. 21 21
      source/FATVolumes.Mod
  71. 5 5
      source/FSTools.Mod
  72. 5 5
      source/FSTools64.Mod
  73. 10 10
      source/FTP.Mod
  74. 17 17
      source/FTPClient.Mod
  75. 6 6
      source/FTPFS.Mod
  76. 14 14
      source/Files.Mod
  77. 15 15
      source/Files64.Mod
  78. 1 1
      source/FirewireSBP2.Mod
  79. 3 3
      source/FoxAMDBackend.Mod
  80. 1 1
      source/FoxActiveCells.Mod
  81. 1 1
      source/FoxBasic.Mod
  82. 2 2
      source/FoxInterpreter.Mod
  83. 1 1
      source/FoxInterpreterSymbols.Mod
  84. 1 1
      source/FoxScanner.Mod
  85. 1 1
      source/FoxSections.Mod
  86. 1 1
      source/FoxSyntaxTree.Mod
  87. 1 1
      source/FoxTRMTools.Mod
  88. 1 1
      source/FoxTest.Mod
  89. 4 4
      source/GIFCodec.Mod
  90. 3 3
      source/GZip.Mod
  91. 6 6
      source/HierarchicalProfiler.Mod
  92. 2 2
      source/HostClipboard.Mod
  93. 1 1
      source/HotKeys.Mod
  94. 1 1
      source/HotKeysCommands.Mod
  95. 21 21
      source/I386.ATADisks.Mod
  96. 3 3
      source/I386.DivXDecoder.Mod
  97. 2 2
      source/I386.IP.Mod
  98. 2 2
      source/I386.IPv4.Mod
  99. 1 1
      source/I386.MPEGUtilities.Mod
  100. 2 2
      source/I386.MemCache.Mod

+ 2 - 2
source/AFM.Mod

@@ -50,7 +50,7 @@ TYPE
 			RETURN (w * size) / 1000
 			RETURN (w * size) / 1000
 		END GetStringWidth;
 		END GetStringWidth;
 
 
-		PROCEDURE LoadAFM(filename : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE LoadAFM(filename : ARRAY OF CHAR; VAR res : WORD);
 		VAR f : Files.File; r : Files.Reader;
 		VAR f : Files.File; r : Files.Reader;
 			t  : ARRAY 32 OF CHAR;
 			t  : ARRAY 32 OF CHAR;
 			hasName, hasCharMetrics, isC : BOOLEAN;
 			hasName, hasCharMetrics, isC : BOOLEAN;
@@ -102,7 +102,7 @@ TYPE
 	END FontMetrics;
 	END FontMetrics;
 
 
 VAR times*, helvetica*, helveticaBold*  : FontMetrics;
 VAR times*, helvetica*, helveticaBold*  : FontMetrics;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	NEW(times);
 	NEW(times);
 	times.LoadAFM("TIR.AFM", res);
 	times.LoadAFM("TIR.AFM", res);

+ 1 - 1
source/AM79C970.Mod

@@ -156,7 +156,7 @@ TYPE
 
 
 		PROCEDURE &Init*(dev: LinkDevice; base, irq: LONGINT);
 		PROCEDURE &Init*(dev: LinkDevice; base, irq: LONGINT);
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			s: SET;
 			s: SET;
 			i,x: INTEGER;
 			i,x: INTEGER;
 
 

+ 21 - 21
source/AMD64.ATADisks.Mod

@@ -224,7 +224,7 @@ TYPE
 			DeviceReset = SYSTEM.VAL(LONGINT, Protocol_DeviceReset);
 			DeviceReset = SYSTEM.VAL(LONGINT, Protocol_DeviceReset);
 			NonData = SYSTEM.VAL(LONGINT, Protocol_NonData);
 			NonData = SYSTEM.VAL(LONGINT, Protocol_NonData);
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			ch: CHAR;
 			ch: CHAR;
 			dma: BOOLEAN;
 			dma: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
@@ -390,7 +390,7 @@ TYPE
 		VAR
 		VAR
 			ch: CHAR;
 			ch: CHAR;
 			s: SET;
 			s: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			(* Clear Interrupt & Errror *)
 			(* Clear Interrupt & Errror *)
 			Machine.Portin8(bmbase + Ofs_BMStatus, ch); s := SYSTEM.VAL(SET, ORD(ch));
 			Machine.Portin8(bmbase + Ofs_BMStatus, ch); s := SYSTEM.VAL(SET, ORD(ch));
@@ -460,7 +460,7 @@ TYPE
 		VAR
 		VAR
 			t: Kernel.MilliTimer;
 			t: Kernel.MilliTimer;
 			status: SET;
 			status: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			IF state = 1 THEN RETURN Res_Err; END;
 			IF state = 1 THEN RETURN Res_Err; END;
 			(* HSR0 *)
 			(* HSR0 *)
@@ -485,7 +485,7 @@ TYPE
 			cmdPacket: CommandPacket;
 			cmdPacket: CommandPacket;
 			ch: CHAR;
 			ch: CHAR;
 			status, devReg: SET;
 			status, devReg: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			(* HI1 *)
 			(* HI1 *)
 			res := WaitStatus({Status_BSY, Status_DRQ}, {}, {}, ms, status);
 			res := WaitStatus({Status_BSY, Status_DRQ}, {}, {}, ms, status);
@@ -749,7 +749,7 @@ TYPE
 			States: HPD0(Check_Status_A), HPD1 (Send_Packet), HPD2 (Check_Status_B), HPD3 (INTRQ_wait), HPD4 (Transfer_Data) *)
 			States: HPD0(Check_Status_A), HPD1 (Send_Packet), HPD2 (Check_Status_B), HPD3 (INTRQ_wait), HPD4 (Transfer_Data) *)
 		PROCEDURE ProtPacketDMA(command: CommandPacket; ms: LONGINT; VAR status: SET): LONGINT;
 		PROCEDURE ProtPacketDMA(command: CommandPacket; ms: LONGINT; VAR status: SET): LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			ch: CHAR;
 			ch: CHAR;
 			s: SET;
 			s: SET;
 			t: Kernel.MilliTimer;
 			t: Kernel.MilliTimer;
@@ -801,7 +801,7 @@ TYPE
 
 
 		PROCEDURE CreateDevice(devNum: LONGINT): LONGINT;
 		PROCEDURE CreateDevice(devNum: LONGINT): LONGINT;
 		VAR status: SET;
 		VAR status: SET;
-			res: LONGINT; dev, devATA: Device; devATAPI: DeviceATAPI; ch: CHAR;
+			res: WORD; dev, devATA: Device; devATAPI: DeviceATAPI; ch: CHAR;
 			buf: ARRAY BS DIV 2 OF INTEGER;
 			buf: ARRAY BS DIV 2 OF INTEGER;
 			command: Command;
 			command: Command;
 			devReg: SET;
 			devReg: SET;
@@ -968,7 +968,7 @@ TYPE
 		cmdLBA: CommandLBA;
 		cmdLBA: CommandLBA;
 		cmdLBA48: CommandLBA48;
 		cmdLBA48: CommandLBA48;
 
 
-		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: LONGINT);
+		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: WORD);
 		VAR
 		VAR
 			num1, try, ignore: LONGINT; bufAdr: ADDRESS;
 			num1, try, ignore: LONGINT; bufAdr: ADDRESS;
 			dma: BOOLEAN;
 			dma: BOOLEAN;
@@ -1028,7 +1028,7 @@ TYPE
 			res := Disks.Ok;
 			res := Disks.Ok;
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF msg IS Disks.GetGeometryMsg THEN
 			IF msg IS Disks.GetGeometryMsg THEN
@@ -1081,7 +1081,7 @@ TYPE
 		END TransferEx;
 		END TransferEx;
 
 
 		PROCEDURE Reset(): LONGINT;
 		PROCEDURE Reset(): LONGINT;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * TraceCommands # {})  THEN Show(name); KernelLog.String(" reset controller"); KernelLog.Ln; END;
 			IF TraceVerbose & (trace * TraceCommands # {})  THEN Show(name); KernelLog.String(" reset controller"); KernelLog.Ln; END;
 			res := controller.Reset();
 			res := controller.Reset();
@@ -1105,7 +1105,7 @@ TYPE
 		END InitDevice;
 		END InitDevice;
 
 
 		PROCEDURE Flush(): LONGINT;
 		PROCEDURE Flush(): LONGINT;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF FlushBit IN id.type THEN
 			IF FlushBit IN id.type THEN
@@ -1123,7 +1123,7 @@ TYPE
 		PROCEDURE MediaLock(lock: BOOLEAN): LONGINT;
 		PROCEDURE MediaLock(lock: BOOLEAN): LONGINT;
 		VAR
 		VAR
 			command: CommandLBA;
 			command: CommandLBA;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF RMSNBit IN id.type THEN
 			IF RMSNBit IN id.type THEN
@@ -1393,7 +1393,7 @@ TYPE
 		END Create;
 		END Create;
 
 
 		PROCEDURE Finalize;
 		PROCEDURE Finalize;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			(* unregister device *)
 			(* unregister device *)
 			Disks.registry.Remove(SELF);
 			Disks.registry.Remove(SELF);
@@ -1440,7 +1440,7 @@ TYPE
 			END;
 			END;
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF msg IS Disks.GetGeometryMsg THEN
 			IF msg IS Disks.GetGeometryMsg THEN
@@ -1489,7 +1489,7 @@ TYPE
 			RETURN res;
 			RETURN res;
 		END ExecuteCommand;
 		END ExecuteCommand;
 
 
-		PROCEDURE ProcessSense(VAR res: LONGINT);
+		PROCEDURE ProcessSense(VAR res: WORD);
 		BEGIN
 		BEGIN
 			IF res = Res_OK THEN
 			IF res = Res_OK THEN
 				sense := 0; asc := 0; ascq := 0;
 				sense := 0; asc := 0; ascq := 0;
@@ -1530,7 +1530,7 @@ TYPE
 		END TransferEx;
 		END TransferEx;
 
 
 		PROCEDURE WaitUntilReady(): LONGINT;
 		PROCEDURE WaitUntilReady(): LONGINT;
-		VAR res: LONGINT; retry: BOOLEAN;
+		VAR res: WORD; retry: BOOLEAN;
 		BEGIN
 		BEGIN
 			REPEAT
 			REPEAT
 				retry := FALSE;
 				retry := FALSE;
@@ -1582,7 +1582,7 @@ TYPE
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
 			buf: ARRAY 18 OF CHAR;
 			buf: ARRAY 18 OF CHAR;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
@@ -1619,7 +1619,7 @@ TYPE
 		PROCEDURE TestUnitReady*(): LONGINT;
 		PROCEDURE TestUnitReady*(): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
@@ -1672,7 +1672,7 @@ TYPE
 		PROCEDURE MediaLock*(lock: BOOLEAN): LONGINT;
 		PROCEDURE MediaLock*(lock: BOOLEAN): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			command := NewCommandPacket(1EH); (* prevent/allow medium removal *)
 			command := NewCommandPacket(1EH); (* prevent/allow medium removal *)
@@ -1689,7 +1689,7 @@ TYPE
 		PROCEDURE Powersave(): LONGINT;
 		PROCEDURE Powersave(): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			command := NewCommandPacket(1BH); (* start/stop unit *)
 			command := NewCommandPacket(1BH); (* start/stop unit *)
@@ -1801,7 +1801,7 @@ TYPE
 		END NewCommandPacket;
 		END NewCommandPacket;
 
 
 		PROCEDURE IdentifyDevice(buf: ARRAY OF INTEGER): LONGINT;
 		PROCEDURE IdentifyDevice(buf: ARRAY OF INTEGER): LONGINT;
-		VAR res : LONGINT;
+		VAR res : WORD;
 		BEGIN
 		BEGIN
 			maxTransfer := 65535;
 			maxTransfer := 65535;
 
 
@@ -1880,7 +1880,7 @@ TYPE
 		END ShowDevice;
 		END ShowDevice;
 
 
 		PROCEDURE &Create*(acontroller: Controller; adev: LONGINT; identifyDevice: ARRAY OF INTEGER);
 		PROCEDURE &Create*(acontroller: Controller; adev: LONGINT; identifyDevice: ARRAY OF INTEGER);
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			INCL(id.type, AtapiBit);
 			INCL(id.type, AtapiBit);
 			NEW(cmdPacket);
 			NEW(cmdPacket);

+ 2 - 2
source/AMD64.IP.Mod

@@ -89,7 +89,7 @@ TYPE
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			In IPv6 maskAdr is the prefix of the currently IP address *)
 			In IPv6 maskAdr is the prefix of the currently IP address *)
-		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: WORD);
 		BEGIN
 		BEGIN
 			(* Extensions have to override this method.*)
 			(* Extensions have to override this method.*)
 			HALT(99);
 			HALT(99);
@@ -1489,7 +1489,7 @@ END SetIPv6AdrNil;
 
 
 
 
 (* Add the interface to the IP configuration. *)
 (* Add the interface to the IP configuration. *)
-PROCEDURE AddInterface*(int: Interface; VAR res: LONGINT);
+PROCEDURE AddInterface*(int: Interface; VAR res: WORD);
 VAR
 VAR
 	item: Interface;
 	item: Interface;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}

+ 2 - 2
source/AMD64.IPv4.Mod

@@ -48,7 +48,7 @@ TYPE
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			same interface. *)
 			same interface. *)
-		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: LONGINT);
+		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: WORD);
 		VAR
 		VAR
 			i: LONGINT;
 			i: LONGINT;
 
 
@@ -338,7 +338,7 @@ TYPE
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
-		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: WORD);
 		VAR
 		VAR
 			maskSet: SET;
 			maskSet: SET;
 
 

+ 2 - 2
source/AMD64.MemCache.Mod

@@ -86,7 +86,7 @@ END SetMTTRphysMask;
 
 
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 
 
-PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 BEGIN
 BEGIN
 	ASSERT((physAdr MOD PS = 0) & (size MOD PS = 0) & (size # 0));
 	ASSERT((physAdr MOD PS = 0) & (size MOD PS = 0) & (size # 0));
@@ -151,7 +151,7 @@ END HandleSetCacheProperties;
 
 
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 
 
-PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 VAR i: LONGINT; msg: SetCacheMessage;
 VAR i: LONGINT; msg: SetCacheMessage;
 BEGIN
 BEGIN
 	NEW(msg); msg.physAdr := physAdr; msg.size := size; msg.type := type;
 	NEW(msg); msg.physAdr := physAdr; msg.size := size; msg.type := type;

+ 2 - 2
source/AMD64.MemInfo.Mod

@@ -176,7 +176,7 @@ END DisplayMTTR;
 
 
 (*
 (*
 PROCEDURE IntSetCache(VAR state: Machine.State);
 PROCEDURE IntSetCache(VAR state: Machine.State);
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN
 BEGIN
 	Machine.SetLocalCacheProperties(0FA800000H, 800000H, Machine.WC, res);
 	Machine.SetLocalCacheProperties(0FA800000H, 800000H, Machine.WC, res);
 	KernelLog.Enter; KernelLog.String("SetCache "); KernelLog.Int(res, 1); KernelLog.Exit
 	KernelLog.Enter; KernelLog.String("SetCache "); KernelLog.Int(res, 1); KernelLog.Exit
@@ -243,7 +243,7 @@ BEGIN
 END Test2;
 END Test2;
 
 
 PROCEDURE Test3*;
 PROCEDURE Test3*;
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN
 BEGIN
 	Processors.GlobalSetCacheProperties(0FA800000H, 800000H, Machine.WC, res);
 	Processors.GlobalSetCacheProperties(0FA800000H, 800000H, Machine.WC, res);
 	KernelLog.Enter; KernelLog.String("SetCache "); KernelLog.Int(res, 1); KernelLog.Exit
 	KernelLog.Enter; KernelLog.String("SetCache "); KernelLog.Int(res, 1); KernelLog.Exit

+ 2 - 2
source/AMD64.PCI.Mod

@@ -81,7 +81,7 @@ MODULE PCI;	(** non-portable *)
 	END BiosServiceDirectory;
 	END BiosServiceDirectory;
 
 
 	PROCEDURE FindBios32Service*(serviceId, serviceFkt: LONGINT; VAR serviceAdr: ADDRESS; VAR serviceLen, entryOffset: LONGINT): LONGINT;
 	PROCEDURE FindBios32Service*(serviceId, serviceFkt: LONGINT; VAR serviceAdr: ADDRESS; VAR serviceLen, entryOffset: LONGINT): LONGINT;
-	VAR ch: CHAR; res: LONGINT; state: SET;
+	VAR ch: CHAR; res: WORD; state: SET;
 	BEGIN {EXCLUSIVE}
 	BEGIN {EXCLUSIVE}
 		IF bios32 THEN
 		IF bios32 THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -342,7 +342,7 @@ MODULE PCI;	(** non-portable *)
 
 
 	(** Set bits included in <mask> in the PCI command register if not set already *)
 	(** Set bits included in <mask> in the PCI command register if not set already *)
 	PROCEDURE Enable*(mask : SET; busNr, devNr, fktNr : LONGINT) : LONGINT;
 	PROCEDURE Enable*(mask : SET; busNr, devNr, fktNr : LONGINT) : LONGINT;
-	VAR cmdReg : LONGINT; res : LONGINT;
+	VAR cmdReg : LONGINT; res : WORD;
 	BEGIN
 	BEGIN
 		res := ReadConfigWord(busNr, devNr, fktNr, CmdReg, cmdReg);
 		res := ReadConfigWord(busNr, devNr, fktNr, CmdReg, cmdReg);
 		IF (res = Done) THEN
 		IF (res = Done) THEN

+ 2 - 2
source/AMD64.UsbKeyboard.Mod

@@ -482,7 +482,7 @@ END UsbScanTab;
 
 
 (* Maps USB key code to X11 keysym (/usr/include/X11/keysymdef.h). *)
 (* Maps USB key code to X11 keysym (/usr/include/X11/keysymdef.h). *)
 PROCEDURE KeySym*(VAR ch : CHAR; VAR leds : SET): LONGINT;
 PROCEDURE KeySym*(VAR ch : CHAR; VAR leds : SET): LONGINT;
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN
 BEGIN
 	CASE ch OF
 	CASE ch OF
 		028X: res := Inputs.KsReturn (* Return *)
 		028X: res := Inputs.KsReturn (* Return *)
@@ -553,7 +553,7 @@ BEGIN
 END KeySym;
 END KeySym;
 
 
 PROCEDURE GetModifierKeysym(modifier : LONGINT) : LONGINT;
 PROCEDURE GetModifierKeysym(modifier : LONGINT) : LONGINT;
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	CASE modifier OF
 	CASE modifier OF
 		|Inputs.LeftCtrl: res := Inputs.KsControlL;
 		|Inputs.LeftCtrl: res := Inputs.KsControlL;

+ 2 - 2
source/ARM.IP.Mod

@@ -89,7 +89,7 @@ TYPE
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			In IPv6 maskAdr is the prefix of the currently IP address *)
 			In IPv6 maskAdr is the prefix of the currently IP address *)
-		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: WORD);
 		BEGIN
 		BEGIN
 			(* Extensions have to override this method.*)
 			(* Extensions have to override this method.*)
 			HALT(99);
 			HALT(99);
@@ -1497,7 +1497,7 @@ END SetIPv6AdrNil;
 
 
 
 
 (* Add the interface to the IP configuration. *)
 (* Add the interface to the IP configuration. *)
-PROCEDURE AddInterface*(int: Interface; VAR res: LONGINT);
+PROCEDURE AddInterface*(int: Interface; VAR res: WORD);
 VAR
 VAR
 	item: Interface;
 	item: Interface;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}

+ 2 - 2
source/ARM.IPv4.Mod

@@ -50,7 +50,7 @@ TYPE
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			same interface. *)
 			same interface. *)
-		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: LONGINT);
+		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: WORD);
 		VAR
 		VAR
 			i: LONGINT;
 			i: LONGINT;
 
 
@@ -340,7 +340,7 @@ TYPE
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
-		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: WORD);
 		VAR
 		VAR
 			maskSet: SET;
 			maskSet: SET;
 
 

+ 3 - 3
source/AVI.Mod

@@ -267,7 +267,7 @@ IMPORT
 		videoFramePos: LONGINT;
 		videoFramePos: LONGINT;
 		audioFramePos: LONGINT;
 		audioFramePos: LONGINT;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		BEGIN
 		BEGIN
 			r := in;
 			r := in;
 			res := AOC.ResFailed;
 			res := AOC.ResFailed;
@@ -1132,8 +1132,8 @@ IMPORT
 			END;
 			END;
 		END GetData;
 		END GetData;
 
 
-		PROCEDURE SetStreamPos*(streamNr: LONGINT; seekType: LONGINT; pos: LONGINT; VAR itemSize: LONGINT; VAR res: LONGINT);
-		(* PROCEDURE SetStreamPos*(streamNr, pos : LONGINT; VAR res: LONGINT); *)
+		PROCEDURE SetStreamPos*(streamNr: LONGINT; seekType: LONGINT; pos: LONGINT; VAR itemSize: LONGINT; VAR res: WORD);
+		(* PROCEDURE SetStreamPos*(streamNr, pos : LONGINT; VAR res: WORD); *)
 		VAR
 		VAR
 			n0, n1, n, spos: LONGINT;
 			n0, n1, n, spos: LONGINT;
 			(* seekType, itemSize : LONGINT; *)
 			(* seekType, itemSize : LONGINT; *)

+ 2 - 2
source/Adaptec7.Mod

@@ -1820,7 +1820,7 @@ BEGIN	WriteScsiState(firstBus)
 END ScsiState;
 END ScsiState;
 
 
 PROCEDURE Test*;
 PROCEDURE Test*;
-VAR  d: Bus;  res: LONGINT;
+VAR  d: Bus;  res: WORD;
 BEGIN
 BEGIN
 	d := firstBus;
 	d := firstBus;
 	KernelLog.String("Adaptec7.Test"); KernelLog.Int(aCount, 0); KernelLog.Ln;
 	KernelLog.String("Adaptec7.Test"); KernelLog.Int(aCount, 0); KernelLog.Ln;
@@ -1830,7 +1830,7 @@ BEGIN
 END Test;
 END Test;
 
 
 PROCEDURE Scan*;
 PROCEDURE Scan*;
-VAR  d: Bus;  res: LONGINT;  i: SHORTINT;  inq: SCSI.InquiryData;
+VAR  d: Bus;  res: WORD;  i: SHORTINT;  inq: SCSI.InquiryData;
 BEGIN
 BEGIN
 	d := firstBus;
 	d := firstBus;
 	KernelLog.String("Adaptec7.Scan"); KernelLog.Int(aCount, 0); KernelLog.Ln;
 	KernelLog.String("Adaptec7.Scan"); KernelLog.Int(aCount, 0); KernelLog.Ln;

+ 3 - 3
source/AlmSmtpReceiver.Mod

@@ -142,7 +142,7 @@ TYPE
 	SmtpAgent* = OBJECT (TCPServices.Agent)
 	SmtpAgent* = OBJECT (TCPServices.Agent)
 	VAR
 	VAR
 			ch: CHAR;				(*current input character*)
 			ch: CHAR;				(*current input character*)
-			res: LONGINT;
+			res: WORD;
 			out: Streams.Writer; in: Streams.Reader;
 			out: Streams.Writer; in: Streams.Reader;
 			log : Files.Writer;
 			log : Files.Writer;
 			env : Envelope;
 			env : Envelope;
@@ -382,7 +382,7 @@ TYPE
 
 
 	(* Begin Parser Productions *)
 	(* Begin Parser Productions *)
 	PROCEDURE HELO*;
 	PROCEDURE HELO*;
-		VAR res : LONGINT;
+		VAR res : WORD;
 	BEGIN
 	BEGIN
 		Confirm(SyHelo);
 		Confirm(SyHelo);
 		sym := SyCopy; ToMemory (env.mta);
 		sym := SyCopy; ToMemory (env.mta);
@@ -1027,7 +1027,7 @@ BEGIN
 END Announce;
 END Announce;
 
 
 PROCEDURE Open*;
 PROCEDURE Open*;
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	IF smtp = NIL THEN
 	IF smtp = NIL THEN
 		NEW(smtp, AlmSmtpReceiverPort, NewSmtpAgent, res);
 		NEW(smtp, AlmSmtpReceiverPort, NewSmtpAgent, res);

+ 5 - 5
source/AnimationCodec.Mod

@@ -70,12 +70,12 @@ TYPE
 		END ReportError;
 		END ReportError;
 
 
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR
 		VAR
 			scanner : XMLScanner.Scanner; parser : XMLParser.Parser; document : XML.Document;
 			scanner : XMLScanner.Scanner; parser : XMLParser.Parser; document : XML.Document;
 			content : XML.Content;
 			content : XML.Content;
 
 
-			PROCEDURE CheckHeader(header : XML.Element; VAR res : LONGINT);
+			PROCEDURE CheckHeader(header : XML.Element; VAR res : WORD);
 			VAR name, version : Strings.String; ignore : BOOLEAN;
 			VAR name, version : Strings.String; ignore : BOOLEAN;
 			BEGIN
 			BEGIN
 				ASSERT(header # NIL);
 				ASSERT(header # NIL);
@@ -129,7 +129,7 @@ TYPE
 			END;
 			END;
 		END Open;
 		END Open;
 
 
-		PROCEDURE ProcessFrame(frame : XML.Element; VAR desc : Codecs.ImageDescriptor; VAR res : LONGINT);
+		PROCEDURE ProcessFrame(frame : XML.Element; VAR desc : Codecs.ImageDescriptor; VAR res : WORD);
 		VAR string, imageName : Strings.String; from, to, current, minDigits : LONGINT; filename : Files.FileName; last, d : Codecs.ImageDescriptor;
 		VAR string, imageName : Strings.String; from, to, current, minDigits : LONGINT; filename : Files.FileName; last, d : Codecs.ImageDescriptor;
 		BEGIN
 		BEGIN
 			NEW(desc);
 			NEW(desc);
@@ -185,7 +185,7 @@ TYPE
 			END;
 			END;
 		END ProcessFrame;
 		END ProcessFrame;
 
 
-		PROCEDURE ProcessFrames(frames : XML.Element; VAR sequence : Codecs.ImageSequence; VAR res : LONGINT);
+		PROCEDURE ProcessFrames(frames : XML.Element; VAR sequence : Codecs.ImageSequence; VAR res : WORD);
 		VAR frame : XML.Content; name : Strings.String; desc, last : Codecs.ImageDescriptor; value : LONGINT;
 		VAR frame : XML.Content; name : Strings.String; desc, last : Codecs.ImageDescriptor; value : LONGINT;
 		BEGIN
 		BEGIN
 			ASSERT(frames # NIL);
 			ASSERT(frames # NIL);
@@ -221,7 +221,7 @@ TYPE
 			END;
 			END;
 		END ProcessFrames;
 		END ProcessFrames;
 
 
-		PROCEDURE GetImageSequence*(VAR sequence : Codecs.ImageSequence; VAR res : LONGINT);
+		PROCEDURE GetImageSequence*(VAR sequence : Codecs.ImageSequence; VAR res : WORD);
 		VAR content : XML.Content; frames : XML.Element; string : Strings.String;
 		VAR content : XML.Content; frames : XML.Element; string : Strings.String;
 		BEGIN
 		BEGIN
 			IF (animation = NIL) THEN res := Codecs.ResFailed; RETURN; END;
 			IF (animation = NIL) THEN res := Codecs.ResFailed; RETURN; END;

+ 2 - 2
source/Archives.Mod

@@ -90,7 +90,7 @@ TYPE
 		a : StringObject;
 		a : StringObject;
 		archive : Archive;
 		archive : Archive;
 		config, factoryName : ARRAY 128 OF CHAR;
 		config, factoryName : ARRAY 128 OF CHAR;
-		res : LONGINT;
+		res : WORD;
 	BEGIN
 	BEGIN
 		archive := NIL;
 		archive := NIL;
 		config := "Archives."; Strings.Append(config, type);
 		config := "Archives."; Strings.Append(config, type);
@@ -111,7 +111,7 @@ TYPE
 		a : StringObject;
 		a : StringObject;
 		archive : Archive;
 		archive : Archive;
 		config, factoryName : ARRAY 128 OF CHAR;
 		config, factoryName : ARRAY 128 OF CHAR;
-		res : LONGINT;
+		res : WORD;
 	BEGIN
 	BEGIN
 		archive := NIL;
 		archive := NIL;
 		config := "Archives."; Strings.Append(config, type);
 		config := "Archives."; Strings.Append(config, type);

+ 1 - 1
source/Autostart.Mod

@@ -10,7 +10,7 @@ CONST
 PROCEDURE Run*;
 PROCEDURE Run*;
 VAR enum: XMLObjects.Enumerator; p: ANY; e: XML.Element; value: XML.String;
 VAR enum: XMLObjects.Enumerator; p: ANY; e: XML.Element; value: XML.String;
 	autostart : XML.Element;
 	autostart : XML.Element;
-	msg: ARRAY 128 OF CHAR; res: LONGINT;
+	msg: ARRAY 128 OF CHAR; res: WORD;
 BEGIN
 BEGIN
 	autostart := Configuration.GetSection("Autostart");
 	autostart := Configuration.GetSection("Autostart");
 	IF autostart # NIL THEN
 	IF autostart # NIL THEN

+ 8 - 8
source/BB.StdCoder.Mod

@@ -44,7 +44,7 @@ VAR
 	END ShowError;
 	END ShowError;
 
 
 
 
-	PROCEDURE read( r: Streams.Reader; VAR res: LONGINT ): LONGINT;
+	PROCEDURE read( r: Streams.Reader; VAR res: WORD ): LONGINT;
 	VAR ch: CHAR; x: LONGINT;
 	VAR ch: CHAR; x: LONGINT;
 	BEGIN
 	BEGIN
 		IF res = 0 THEN
 		IF res = 0 THEN
@@ -64,7 +64,7 @@ VAR
 
 
 
 
 	PROCEDURE ReadHeader(		r: Streams.Reader; 
 	PROCEDURE ReadHeader(		r: Streams.Reader; 
-									VAR res: LONGINT;  VAR name: ARRAY OF CHAR;  VAR type: LONGINT );
+									VAR res: WORD;  VAR name: ARRAY OF CHAR;  VAR type: LONGINT );
 	VAR 
 	VAR 
 		x, bits, i: LONGINT; ch: CHAR; tag: ARRAY 16 OF CHAR;
 		x, bits, i: LONGINT; ch: CHAR; tag: ARRAY 16 OF CHAR;
 	BEGIN
 	BEGIN
@@ -97,7 +97,7 @@ VAR
 	END ReadHeader;
 	END ReadHeader;
 	
 	
 	
 	
-	PROCEDURE SkipFileType(r: Streams.Reader; VAR res: LONGINT ): BOOLEAN;
+	PROCEDURE SkipFileType(r: Streams.Reader; VAR res: WORD ): BOOLEAN;
 	VAR x, bits, i: LONGINT; ch: CHAR;  ftype: FileType; 
 	VAR x, bits, i: LONGINT; ch: CHAR;  ftype: FileType; 
 	BEGIN
 	BEGIN
 		res := 0;  i := 0; bits := 0;  x := 0;
 		res := 0;  i := 0; bits := 0;  x := 0;
@@ -111,7 +111,7 @@ VAR
 	END SkipFileType;
 	END SkipFileType;
 	
 	
 	
 	
-	PROCEDURE ReadInteger( r: Streams.Reader; VAR res: LONGINT ): LONGINT;
+	PROCEDURE ReadInteger( r: Streams.Reader; VAR res: WORD ): LONGINT;
 	VAR bits, val: LONGINT;
 	VAR bits, val: LONGINT;
 	BEGIN
 	BEGIN
 		bits := 0;  val := 0;
 		bits := 0;  val := 0;
@@ -120,7 +120,7 @@ VAR
 	END ReadInteger;
 	END ReadInteger;
 	
 	
 	
 	
-	PROCEDURE ReadFile( r: Streams.Reader; VAR res: LONGINT ): Files.File;
+	PROCEDURE ReadFile( r: Streams.Reader; VAR res: WORD ): Files.File;
 	VAR 
 	VAR 
 		hash, x, bits, i, len, sum, s: LONGINT; byte: SHORTINT;  f: Files.File;  w: Files.Writer;
 		hash, x, bits, i, len, sum, s: LONGINT; byte: SHORTINT;  f: Files.File;  w: Files.Writer;
 	BEGIN
 	BEGIN
@@ -155,7 +155,7 @@ VAR
 	
 	
 	PROCEDURE NewFile( CONST name: ARRAY OF CHAR ): Files.File;
 	PROCEDURE NewFile( CONST name: ARRAY OF CHAR ): Files.File;
 	VAR
 	VAR
-		f: Files.File;  res: LONGINT;  name2: Files.FileName; 
+		f: Files.File;  res: WORD;  name2: Files.FileName; 
 	BEGIN
 	BEGIN
 		f := Files.Old( name );
 		f := Files.Old( name );
 		IF f # NIL THEN
 		IF f # NIL THEN
@@ -213,7 +213,7 @@ VAR
 	
 	
 	
 	
 	PROCEDURE DecodeFile( r: Streams.Reader; CONST name: Files.FileName );
 	PROCEDURE DecodeFile( r: Streams.Reader; CONST name: Files.FileName );
-	VAR res: LONGINT; f: Files.File;
+	VAR res: WORD; f: Files.File;
 	BEGIN
 	BEGIN
 		IF SkipFileType( r, res ) THEN
 		IF SkipFileType( r, res ) THEN
 			f := ReadFile( r, res );
 			f := ReadFile( r, res );
@@ -225,7 +225,7 @@ VAR
 	END DecodeFile;
 	END DecodeFile;
 	
 	
 	
 	
-	PROCEDURE DecodeFileList ( r: Streams.Reader; VAR res: LONGINT );
+	PROCEDURE DecodeFileList ( r: Streams.Reader; VAR res: WORD );
 	VAR 
 	VAR 
 		i: LONGINT; p, files: FileList; ch: CHAR;
 		i: LONGINT; p, files: FileList; ch: CHAR;
 		f: Files.File; fr: Files.Reader; path: Files.FileName;
 		f: Files.File; fr: Files.Reader; path: Files.FileName;

+ 2 - 2
source/BMPCodec.Mod

@@ -34,7 +34,7 @@ TYPE
 		END Log;
 		END Log;
 
 
 		(* open the decoder on a file *)
 		(* open the decoder on a file *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR
 		VAR
 			pix: Raster.Pixel; ch: CHAR;
 			pix: Raster.Pixel; ch: CHAR;
 		BEGIN
 		BEGIN
@@ -144,7 +144,7 @@ TYPE
 		PROCEDURE SetQuality*(quality : LONGINT);
 		PROCEDURE SetQuality*(quality : LONGINT);
 		END SetQuality;
 		END SetQuality;
 
 
-		PROCEDURE WriteImage*(img : Raster.Image; VAR res : LONGINT);
+		PROCEDURE WriteImage*(img : Raster.Image; VAR res : WORD);
 		VAR
 		VAR
 			col, redMask, greenMask, blueMask: LONGINT;
 			col, redMask, greenMask, blueMask: LONGINT;
 			palentries, dataSize: LONGINT; bpp: INTEGER;
 			palentries, dataSize: LONGINT; bpp: INTEGER;

+ 1 - 1
source/BT848.Mod

@@ -3413,7 +3413,7 @@ END ScanPCI;
 (* Install procedure for installing a TV card. *)
 (* Install procedure for installing a TV card. *)
 PROCEDURE InstallDevices;
 PROCEDURE InstallDevices;
 VAR
 VAR
-	res: LONGINT;
+	res: WORD;
 	dev: VideoCaptureDevice;
 	dev: VideoCaptureDevice;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	IF nOfInstalledDevices = 0 THEN
 	IF nOfInstalledDevices = 0 THEN

+ 1 - 1
source/BenchTCP.Mod

@@ -100,7 +100,7 @@ VAR
 	buf: Bytes;
 	buf: Bytes;
 
 
 
 
-PROCEDURE Message(CONST msg1, msg2: ARRAY OF CHAR; res: LONGINT);
+PROCEDURE Message(CONST msg1, msg2: ARRAY OF CHAR; res: WORD);
 BEGIN
 BEGIN
 	KernelLog.String(Header); KernelLog.String(msg1); KernelLog.String(msg2);
 	KernelLog.String(Header); KernelLog.String(msg1); KernelLog.String(msg2);
 	IF res # 0 THEN
 	IF res # 0 THEN

+ 1 - 1
source/BimboScanner.Mod

@@ -46,7 +46,7 @@ TYPE
 			NEW(data, initialSize); length := 0;
 			NEW(data, initialSize); length := 0;
 		END Init;
 		END Init;
 
 
-		PROCEDURE Add*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Add*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR i : LONGINT; n : Strings.String;
 		VAR i : LONGINT; n : Strings.String;
 		BEGIN
 		BEGIN
 			IF length + len + 1 >= LEN(data) THEN
 			IF length + len + 1 >= LEN(data) THEN

+ 11 - 11
source/BiosFreePCI.Mod

@@ -56,7 +56,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 
 
 
 
 	PROCEDURE PCIPresent*(VAR version, lastPCIbus, hwMech: LONGINT): LONGINT;
 	PROCEDURE PCIPresent*(VAR version, lastPCIbus, hwMech: LONGINT): LONGINT;
-	VAR res: LONGINT; pci: Pci; r0: LONGINT;
+	VAR res: WORD; pci: Pci; r0: LONGINT;
 	BEGIN {EXCLUSIVE}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			StartIterate(pci);
 			StartIterate(pci);
@@ -142,7 +142,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END FindPCIClassCode;
 	END FindPCIClassCode;
 
 
 	PROCEDURE GenerateSpecialCycle*(busNr, specCycleData: LONGINT): LONGINT;
 	PROCEDURE GenerateSpecialCycle*(busNr, specCycleData: LONGINT): LONGINT;
-	VAR res: LONGINT;
+	VAR res: WORD;
 	BEGIN {EXCLUSIVE}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			(*
 			(*
@@ -166,7 +166,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	PROCEDURE GetIrqRoutingOptions*(VAR rt: RouteTable; VAR IrqBitmap: SET): LONGINT;
 	PROCEDURE GetIrqRoutingOptions*(VAR rt: RouteTable; VAR IrqBitmap: SET): LONGINT;
 	CONST dbN = 16*8;
 	CONST dbN = 16*8;
 	VAR
 	VAR
-		res: LONGINT;
+		res: WORD;
 		(*eflags, state: SET;
 		(*eflags, state: SET;
 		rb: RouteBuffer; db: ARRAY dbN OF CHAR;
 		rb: RouteBuffer; db: ARRAY dbN OF CHAR;
 		last: RouteTable;
 		last: RouteTable;
@@ -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:LONGINT;
+	VAR res:WORD;
 	BEGIN {EXCLUSIVE}
 	BEGIN {EXCLUSIVE}
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			(*
 			(*
@@ -237,7 +237,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 
 
 	(** Set bits included in <mask> in the PCI command register if not set already *)
 	(** Set bits included in <mask> in the PCI command register if not set already *)
 	PROCEDURE Enable*(mask : SET; busNr, devNr, fktNr : LONGINT) : LONGINT;
 	PROCEDURE Enable*(mask : SET; busNr, devNr, fktNr : LONGINT) : LONGINT;
-	VAR cmdReg : LONGINT; res : LONGINT;
+	VAR cmdReg : LONGINT; res : WORD;
 	BEGIN
 	BEGIN
 		res := ReadConfigWord(busNr, devNr, fktNr, CmdReg, cmdReg);
 		res := ReadConfigWord(busNr, devNr, fktNr, CmdReg, cmdReg);
 		IF (res = Done) THEN
 		IF (res = Done) THEN
@@ -324,7 +324,7 @@ MODULE PCI;	 (** author: fof -- PCI without using PCI bios (using PCI tables des
 	END GetAdr1;
 	END GetAdr1;
 
 
 	PROCEDURE PCIReadConfig32(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
 	PROCEDURE PCIReadConfig32(pciBus, pciDev, pciFn, reg: LONGINT; VAR val: LONGINT): LONGINT;
-	VAR adr, dataAdr: LONGINT; state: SET; res: LONGINT;
+	VAR adr, dataAdr: LONGINT; state: SET; res: WORD;
 	BEGIN
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();
@@ -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: LONGINT; 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: LONGINT; 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: LONGINT;
+	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: LONGINT;
+	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: LONGINT;
+	VAR adr, dataAdr: LONGINT; state: SET;res: WORD;
 	BEGIN
 	BEGIN
 		IF pciEnabled THEN
 		IF pciEnabled THEN
 			state := Machine.DisableInterrupts();
 			state := Machine.DisableInterrupts();

+ 5 - 5
source/Bluetooth.Mod

@@ -148,7 +148,7 @@ TYPE
 		END HandleTimeout;
 		END HandleTimeout;
 
 
 		(** blocks until a HCI packet is available or a timeout occurs. Packet filters are priorized over the Get request *)
 		(** blocks until a HCI packet is available or a timeout occurs. Packet filters are priorized over the Get request *)
-		PROCEDURE Get*(VAR p: Packet; timeout: LONGINT; VAR res: LONGINT);
+		PROCEDURE Get*(VAR p: Packet; timeout: LONGINT; VAR res: WORD);
 		VAR timer: IDTimer;
 		VAR timer: IDTimer;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (head = NIL) THEN
 			IF (head = NIL) THEN
@@ -179,7 +179,7 @@ TYPE
 		END GetNextHandler;
 		END GetNextHandler;
 
 
 		(* naaa...won't work. besser: filter rein, der alles frisst, dann wieder rausnehmen *)
 		(* naaa...won't work. besser: filter rein, der alles frisst, dann wieder rausnehmen *)
-		PROCEDURE GetNext*(VAR p: Packet; timeout: LONGINT; VAR res: LONGINT);
+		PROCEDURE GetNext*(VAR p: Packet; timeout: LONGINT; VAR res: WORD);
 		VAR f: Filter; timer: IDTimer;
 		VAR f: Filter; timer: IDTimer;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			(* lock *)
 			(* lock *)
@@ -277,19 +277,19 @@ TYPE
 		END GetSink;
 		END GetSink;
 
 
 		(** send a HCI packet *)
 		(** send a HCI packet *)
-		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		BEGIN
 		BEGIN
 			HALT(301)
 			HALT(301)
 		END Send;
 		END Send;
 
 
-		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		BEGIN
 		BEGIN
 			HALT(301)
 			HALT(301)
 		END Send1H;
 		END Send1H;
 
 
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
 								VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT;
 								VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT;
-								VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+								VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		BEGIN
 		BEGIN
 			HALT(301)
 			HALT(301)
 		END Send2H;
 		END Send2H;

+ 15 - 15
source/BluetoothHCI.Mod

@@ -390,7 +390,7 @@ TYPE
 
 
 		(** initialize the module, get BDADDR, MTUs, etc *)
 		(** initialize the module, get BDADDR, MTUs, etc *)
 		PROCEDURE Initialize*(): LONGINT;
 		PROCEDURE Initialize*(): LONGINT;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			IF TraceHCI THEN
 			IF TraceHCI THEN
 				KernelLog.String(ModuleName);
 				KernelLog.String(ModuleName);
@@ -455,7 +455,7 @@ TYPE
 		PROCEDURE SendCommand*(OGF, OCF: LONGINT; params: ARRAY OF CHAR; len: LONGINT;
 		PROCEDURE SendCommand*(OGF, OCF: LONGINT; params: ARRAY OF CHAR; len: LONGINT;
 										VAR packet: Bluetooth.EventPacket;
 										VAR packet: Bluetooth.EventPacket;
 										 VAR pending: BOOLEAN;
 										 VAR pending: BOOLEAN;
-										 VAR res: LONGINT);
+										 VAR res: WORD);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			InSendCommand(OGF, OCF, params, len, packet, pending, res)
 			InSendCommand(OGF, OCF, params, len, packet, pending, res)
 		END SendCommand;
 		END SendCommand;
@@ -463,7 +463,7 @@ TYPE
 		PROCEDURE InSendCommand(OGF, OCF: LONGINT; params: ARRAY OF CHAR; len: LONGINT;
 		PROCEDURE InSendCommand(OGF, OCF: LONGINT; params: ARRAY OF CHAR; len: LONGINT;
 										VAR packet: Bluetooth.EventPacket;
 										VAR packet: Bluetooth.EventPacket;
 										VAR pending: BOOLEAN;
 										VAR pending: BOOLEAN;
-										VAR res: LONGINT);
+										VAR res: WORD);
 		VAR
 		VAR
 			cmd: POINTER TO ARRAY  OF CHAR; i: LONGINT;
 			cmd: POINTER TO ARRAY  OF CHAR; i: LONGINT;
 		BEGIN (* EXCLUSIVE *)
 		BEGIN (* EXCLUSIVE *)
@@ -535,7 +535,7 @@ TYPE
 			END;
 			END;
 		END InSendCommand;
 		END InSendCommand;
 
 
-		PROCEDURE GetEvent*(timeout: LONGINT; VAR event: Bluetooth.EventPacket; VAR res: LONGINT);
+		PROCEDURE GetEvent*(timeout: LONGINT; VAR event: Bluetooth.EventPacket; VAR res: WORD);
 		VAR p: Bluetooth.Packet;
 		VAR p: Bluetooth.Packet;
 		BEGIN
 		BEGIN
 			IF TraceHCI THEN
 			IF TraceHCI THEN
@@ -578,7 +578,7 @@ TYPE
 			par: ARRAY 5 OF CHAR;
 			par: ARRAY 5 OF CHAR;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			par[0] := CHR(lap MOD 100H);
 			par[0] := CHR(lap MOD 100H);
 			par[1] := CHR((lap DIV 100H) MOD 100H);
 			par[1] := CHR((lap DIV 100H) MOD 100H);
@@ -612,7 +612,7 @@ TYPE
 			par: ARRAY 3 OF CHAR;
 			par: ARRAY 3 OF CHAR;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			par[0] := CHR(linkHandle MOD 100H);
 			par[0] := CHR(linkHandle MOD 100H);
 			par[1] := CHR(linkHandle DIV 100H);
 			par[1] := CHR(linkHandle DIV 100H);
@@ -626,7 +626,7 @@ TYPE
 		PROCEDURE SetEventMask*(eventMask : LONGINT) : LONGINT;
 		PROCEDURE SetEventMask*(eventMask : LONGINT) : LONGINT;
 		VAR
 		VAR
 			par : ARRAY 8 OF CHAR;
 			par : ARRAY 8 OF CHAR;
-			res: LONGINT;
+			res: WORD;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -645,7 +645,7 @@ TYPE
 		VAR
 		VAR
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			IF TraceHCI THEN
 			IF TraceHCI THEN
 				KernelLog.String(ModuleName);
 				KernelLog.String(ModuleName);
@@ -702,7 +702,7 @@ TYPE
 			par: ARRAY 1 OF CHAR;
 			par: ARRAY 1 OF CHAR;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			par[0] := mode;
 			par[0] := mode;
 			InSendCommand(ogfControl, ocfWriteScanEnable, par, 1, event, pending, res);
 			InSendCommand(ogfControl, ocfWriteScanEnable, par, 1, event, pending, res);
@@ -715,7 +715,7 @@ TYPE
 		VAR
 		VAR
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			InSendCommand(ogfControl,ocfReadScanEnable,"",0,event,pending,res);
 			InSendCommand(ogfControl,ocfReadScanEnable,"",0,event,pending,res);
 			scanEnable := event.params[4];
 			scanEnable := event.params[4];
@@ -728,7 +728,7 @@ TYPE
 			par: ARRAY 4 OF CHAR;
 			par: ARRAY 4 OF CHAR;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res : LONGINT;
+			res : WORD;
 			outHandle : LONGINT;
 			outHandle : LONGINT;
 		BEGIN
 		BEGIN
 			par[0] := CHR(inHandle MOD 100H);
 			par[0] := CHR(inHandle MOD 100H);
@@ -758,7 +758,7 @@ TYPE
 			par: ARRAY 2 OF CHAR;
 			par: ARRAY 2 OF CHAR;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res : LONGINT;
+			res : WORD;
 			outHandle : LONGINT;
 			outHandle : LONGINT;
 		BEGIN
 		BEGIN
 			par[0] := CHR(inHandle MOD 100H);
 			par[0] := CHR(inHandle MOD 100H);
@@ -790,7 +790,7 @@ TYPE
 			par: ARRAY 1 OF CHAR;
 			par: ARRAY 1 OF CHAR;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			par[0] := baudRate;
 			par[0] := baudRate;
 			InSendCommand(ogfEricsson,ocfSetUARTBaudRate,par,LEN(par),event,pending,res);
 			InSendCommand(ogfEricsson,ocfSetUARTBaudRate,par,LEN(par),event,pending,res);
@@ -833,7 +833,7 @@ TYPE
 		VAR
 		VAR
 			event: Bluetooth.EventPacket;
 			event: Bluetooth.EventPacket;
 			pending: BOOLEAN;
 			pending: BOOLEAN;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			InSendCommand(ogfInformational, ocfReadBufferSize, "", 0, event, pending, res);
 			InSendCommand(ogfInformational, ocfReadBufferSize, "", 0, event, pending, res);
 			IF pending THEN res := Bluetooth.ErrInvalidEvent
 			IF pending THEN res := Bluetooth.ErrInvalidEvent
@@ -1175,7 +1175,7 @@ TYPE
 	DisconnectionComplete* = PROCEDURE {DELEGATE} (sender : HCI; status,handle,reason : LONGINT);
 	DisconnectionComplete* = PROCEDURE {DELEGATE} (sender : HCI; status,handle,reason : LONGINT);
 	InquiryComplete* = PROCEDURE {DELEGATE} (sender: HCI; status: LONGINT);
 	InquiryComplete* = PROCEDURE {DELEGATE} (sender: HCI; status: LONGINT);
 
 
-	ConnectionEvent* = PROCEDURE{DELEGATE} (sender: HCI; link: Link; res: LONGINT);
+	ConnectionEvent* = PROCEDURE{DELEGATE} (sender: HCI; link: Link; res: WORD);
 	(*OnReceiveACLDataEvent* = PROCEDURE{DELEGATE} (link: Link; acl: Bluetooth.ACLPacket); *)
 	(*OnReceiveACLDataEvent* = PROCEDURE{DELEGATE} (link: Link; acl: Bluetooth.ACLPacket); *)
 		(*handle, PB, PC, len: LONGINT; VAR data: ARRAY OF CHAR);*)
 		(*handle, PB, PC, len: LONGINT; VAR data: ARRAY OF CHAR);*)
 	InquiryEvent* = PROCEDURE {DELEGATE} (sender: HCI; bdAddr: Bluetooth.BDAddr; deviceClass: Bluetooth.DeviceClass;
 	InquiryEvent* = PROCEDURE {DELEGATE} (sender: HCI; bdAddr: Bluetooth.BDAddr; deviceClass: Bluetooth.DeviceClass;

+ 5 - 5
source/BluetoothL2CAP.Mod

@@ -337,7 +337,7 @@ TYPE
 		END Connect;
 		END Connect;
 
 
 		PROCEDURE ConnectResponse(identifier: CHAR; response, status: LONGINT): LONGINT;
 		PROCEDURE ConnectResponse(identifier: CHAR; response, status: LONGINT): LONGINT;
-		VAR cmd: ARRAY 12 OF CHAR; res: LONGINT; sc: SignallingChannel;
+		VAR cmd: ARRAY 12 OF CHAR; res: WORD; sc: SignallingChannel;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			ASSERT(state = W4L2CAConnectRsp);
 			ASSERT(state = W4L2CAConnectRsp);
 			IF TraceChannel THEN
 			IF TraceChannel THEN
@@ -671,7 +671,7 @@ TYPE
 		PROCEDURE Write*(VAR buffer: ARRAY OF CHAR; ofs, len: LONGINT; VAR size: LONGINT): LONGINT;
 		PROCEDURE Write*(VAR buffer: ARRAY OF CHAR; ofs, len: LONGINT; VAR size: LONGINT): LONGINT;
 
 
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 
 
 		BEGIN
 		BEGIN
 
 
@@ -835,7 +835,7 @@ TYPE
 		PROCEDURE Signal(link: HCI.Link; code, identifier: CHAR; command: ARRAY OF CHAR; len: LONGINT): LONGINT;
 		PROCEDURE Signal(link: HCI.Link; code, identifier: CHAR; command: ARRAY OF CHAR; len: LONGINT): LONGINT;
 
 
 		VAR
 		VAR
-				res : LONGINT;
+				res : WORD;
 
 
 		BEGIN (* {EXCLUSIVE} TODO *)
 		BEGIN (* {EXCLUSIVE} TODO *)
 
 
@@ -1533,7 +1533,7 @@ TYPE
 		END AcceptACLConnection;
 		END AcceptACLConnection;
 
 
 		(*----- lower layer events -----*)
 		(*----- lower layer events -----*)
-		PROCEDURE Connect(sender: HCI.HCI; link: HCI.Link; res: LONGINT);
+		PROCEDURE Connect(sender: HCI.HCI; link: HCI.Link; res: WORD);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (res = 0) THEN
 			IF (res = 0) THEN
 				IF TraceHCIManager THEN
 				IF TraceHCIManager THEN
@@ -1551,7 +1551,7 @@ TYPE
 			END;
 			END;
 		END Connect;
 		END Connect;
 
 
-		PROCEDURE Disconnect(sender: HCI.HCI; link: HCI.Link; res: LONGINT);
+		PROCEDURE Disconnect(sender: HCI.HCI; link: HCI.Link; res: WORD);
 		VAR p,q : L2CAP;
 		VAR p,q : L2CAP;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF TraceHCIManager THEN
 			IF TraceHCIManager THEN

+ 1 - 1
source/BluetoothRFCOMM.Mod

@@ -444,7 +444,7 @@ TYPE
 
 
 		(* --------------------------------------------- *)
 		(* --------------------------------------------- *)
 
 
-		PROCEDURE Sender(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Sender(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 
 
 		VAR
 		VAR
 			info : ARRAY 127 OF CHAR;
 			info : ARRAY 127 OF CHAR;

+ 8 - 8
source/BluetoothTest.Mod

@@ -32,7 +32,7 @@ TYPE
 		END ListHCIConnections;
 		END ListHCIConnections;
 
 
 		PROCEDURE InitL2CAP;
 		PROCEDURE InitL2CAP;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			IF (l2cap # NIL) THEN CloseL2CAP END;
 			IF (l2cap # NIL) THEN CloseL2CAP END;
 			(* NEW(l2cap, hci, res); *)
 			(* NEW(l2cap, hci, res); *)
@@ -56,7 +56,7 @@ TYPE
 		END CloseL2CAP;
 		END CloseL2CAP;
 
 
 		PROCEDURE ConnectIndication(indication: L2CAP.Indication);
 		PROCEDURE ConnectIndication(indication: L2CAP.Indication);
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			KernelLog.String(ident); KernelLog.String(": connect indication!!!"); KernelLog.Ln;
 			KernelLog.String(ident); KernelLog.String(": connect indication!!!"); KernelLog.Ln;
 			WITH indication: L2CAP.ConnectInd DO
 			WITH indication: L2CAP.ConnectInd DO
@@ -66,7 +66,7 @@ TYPE
 		END ConnectIndication;
 		END ConnectIndication;
 
 
 		PROCEDURE ConfigIndication(indication: L2CAP.Indication);
 		PROCEDURE ConfigIndication(indication: L2CAP.Indication);
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			WITH indication: L2CAP.ConfigInd DO
 			WITH indication: L2CAP.ConfigInd DO
 				KernelLog.String(ident); KernelLog.String(": configuration indication:"); KernelLog.Ln;
 				KernelLog.String(ident); KernelLog.String(": configuration indication:"); KernelLog.Ln;
@@ -291,7 +291,7 @@ END ReadLocalName;
 PROCEDURE ChangeLocalName*(context : Commands.Context);
 PROCEDURE ChangeLocalName*(context : Commands.Context);
 VAR
 VAR
 	ident: Ident; d: Device;
 	ident: Ident; d: Device;
-	name: ARRAY 248 OF CHAR; event: Bluetooth.EventPacket; pending: BOOLEAN; res : LONGINT;
+	name: ARRAY 248 OF CHAR; event: Bluetooth.EventPacket; pending: BOOLEAN; res : WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(ident) & context.arg.GetString(name) THEN
 	IF context.arg.GetString(ident) & context.arg.GetString(name) THEN
 		d := Find(ident);
 		d := Find(ident);
@@ -358,7 +358,7 @@ BEGIN
 END WriteClassOfDevice;
 END WriteClassOfDevice;
 
 
 PROCEDURE Reset*(context : Commands.Context);
 PROCEDURE Reset*(context : Commands.Context);
-VAR ident: Ident; d: Device; res: LONGINT;
+VAR ident: Ident; d: Device; res: WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(ident) THEN
 	IF context.arg.GetString(ident) THEN
 		d := Find(ident);
 		d := Find(ident);
@@ -376,7 +376,7 @@ END Reset;
 PROCEDURE ReadScanEnable*(context : Commands.Context);
 PROCEDURE ReadScanEnable*(context : Commands.Context);
 VAR
 VAR
 	ident: Ident; d: Device;
 	ident: Ident; d: Device;
-	res: LONGINT; event: Bluetooth.EventPacket; pending: BOOLEAN;
+	res: WORD; event: Bluetooth.EventPacket; pending: BOOLEAN;
 BEGIN
 BEGIN
 	IF context.arg.GetString(ident) THEN
 	IF context.arg.GetString(ident) THEN
 		d := Find(ident);
 		d := Find(ident);
@@ -426,7 +426,7 @@ END WriteScanEnable;
 PROCEDURE SetFilter*(context : Commands.Context);
 PROCEDURE SetFilter*(context : Commands.Context);
 VAR
 VAR
 	ident: Ident; d: Device;
 	ident: Ident; d: Device;
-	cond: ARRAY 1 OF CHAR; res: LONGINT;
+	cond: ARRAY 1 OF CHAR; res: WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(ident) THEN
 	IF context.arg.GetString(ident) THEN
 		d := Find(ident);
 		d := Find(ident);
@@ -654,7 +654,7 @@ END Supported;
 PROCEDURE ReadLocalSupportedFeatures*(context : Commands.Context);
 PROCEDURE ReadLocalSupportedFeatures*(context : Commands.Context);
 VAR
 VAR
 	ident: Ident; d: Device;
 	ident: Ident; d: Device;
-	res: LONGINT; event: Bluetooth.EventPacket; pending: BOOLEAN;
+	res: WORD; event: Bluetooth.EventPacket; pending: BOOLEAN;
 	s: SET;
 	s: SET;
 BEGIN
 BEGIN
 	IF context.arg.GetString(ident) THEN
 	IF context.arg.GetString(ident) THEN

+ 3 - 3
source/BluetoothUART.Mod

@@ -289,7 +289,7 @@ TYPE
 			RETURN res
 			RETURN res
 		END GetPacketType;
 		END GetPacketType;
 
 
-		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR  pt: CHAR; i: LONGINT;
 		VAR  pt: CHAR; i: LONGINT;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF ~GetPacketType(type, pt) THEN
 			IF ~GetPacketType(type, pt) THEN
@@ -312,7 +312,7 @@ TYPE
 			res := out.res
 			res := out.res
 		END Send;
 		END Send;
 
 
-		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR pt: CHAR; i: LONGINT;
 		VAR pt: CHAR; i: LONGINT;
 		BEGIN
 		BEGIN
 			IF ~GetPacketType(type, pt) THEN
 			IF ~GetPacketType(type, pt) THEN
@@ -339,7 +339,7 @@ TYPE
 
 
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
 								VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT;
 								VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT;
-								VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+								VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR pt: CHAR; i: LONGINT;
 		VAR pt: CHAR; i: LONGINT;
 		BEGIN
 		BEGIN
 			IF ~GetPacketType(type, pt) THEN
 			IF ~GetPacketType(type, pt) THEN

+ 3 - 3
source/BluetoothUSB.Mod

@@ -191,7 +191,7 @@ TYPE
 			END;
 			END;
 		END ReadACL;
 		END ReadACL;
 
 
-		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send*(type: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR  i: LONGINT;
 		VAR  i: LONGINT;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF TraceSend THEN
 			IF TraceSend THEN
@@ -212,7 +212,7 @@ TYPE
 			END;
 			END;
 		END Send;
 		END Send;
 
 
-		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+		PROCEDURE Send1H*(type: LONGINT; VAR hdr: ARRAY OF CHAR; hdrlen: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR  i: LONGINT; buffer : POINTER TO ARRAY OF CHAR; bufferLen : LONGINT;
 		VAR  i: LONGINT; buffer : POINTER TO ARRAY OF CHAR; bufferLen : LONGINT;
 		BEGIN
 		BEGIN
 			IF TraceSend THEN
 			IF TraceSend THEN
@@ -242,7 +242,7 @@ TYPE
 		END Send1H;
 		END Send1H;
 
 
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
 		PROCEDURE Send2H*(type: LONGINT; VAR hdr1: ARRAY OF CHAR; hdr1len: LONGINT;
-				VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: LONGINT);
+				VAR hdr2: ARRAY OF CHAR; hdr2len: LONGINT; VAR data: ARRAY OF CHAR; ofs, len: LONGINT; VAR res: WORD);
 		VAR
 		VAR
 			i: LONGINT;
 			i: LONGINT;
 			buffer : POINTER TO ARRAY OF CHAR;
 			buffer : POINTER TO ARRAY OF CHAR;

+ 1 - 1
source/BootConsole.Mod

@@ -67,7 +67,7 @@ END Error;
 
 
 PROCEDURE Generate(CONST name: ARRAY OF CHAR; par: Files.Parameters): BOOLEAN;
 PROCEDURE Generate(CONST name: ARRAY OF CHAR; par: Files.Parameters): BOOLEAN;
 VAR
 VAR
-	factory : Files.FileSystemFactory; res: LONGINT; msg: ARRAY 256 OF CHAR;
+	factory : Files.FileSystemFactory; res: WORD; msg: ARRAY 256 OF CHAR;
 	moduleName, procedureName : Modules.Name;
 	moduleName, procedureName : Modules.Name;
 BEGIN
 BEGIN
 	Commands.Split(name, moduleName, procedureName, res, msg);
 	Commands.Split(name, moduleName, procedureName, res, msg);

+ 1 - 1
source/BootShell.Mod

@@ -175,7 +175,7 @@ TYPE
 			editEndPosition := cursorPosition;
 			editEndPosition := cursorPosition;
 		END SetEditStart;
 		END SetEditStart;
 
 
-		PROCEDURE Send( CONST data: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send( CONST data: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR i : LONGINT;
 		VAR i : LONGINT;
 		BEGIN
 		BEGIN
 			lock.Acquire;
 			lock.Acquire;

+ 1 - 1
source/CATServer.Mod

@@ -39,7 +39,7 @@ END NewCATAgent;
 
 
 
 
 PROCEDURE Start*;
 PROCEDURE Start*;
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	IF cat = NIL THEN
 	IF cat = NIL THEN
 		NEW(cat, CATPort, NewCATAgent, res);
 		NEW(cat, CATPort, NewCATAgent, res);

+ 11 - 11
source/CDRecord.Mod

@@ -330,7 +330,7 @@ TYPE
 
 
 		PROCEDURE AddTrack*(filename: Strings.String; trackType : LONGINT; permitCopy: BOOLEAN) : LONGINT;
 		PROCEDURE AddTrack*(filename: Strings.String; trackType : LONGINT; permitCopy: BOOLEAN) : LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			track: InformationTrack;
 			track: InformationTrack;
 			file: Files.File;
 			file: Files.File;
 		BEGIN
 		BEGIN
@@ -390,7 +390,7 @@ TYPE
 		PROCEDURE GetBufferCapacity(VAR totalCapacity, unusedCapacity: LONGINT): LONGINT;
 		PROCEDURE GetBufferCapacity(VAR totalCapacity, unusedCapacity: LONGINT): LONGINT;
 		VAR
 		VAR
 			capacity: Lib.BufferCapacity;
 			capacity: Lib.BufferCapacity;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			res := Lib.ReadBufferCapacity(dev, FALSE, ADDRESSOF(capacity), SIZEOF(Lib.BufferCapacity));
 			res := Lib.ReadBufferCapacity(dev, FALSE, ADDRESSOF(capacity), SIZEOF(Lib.BufferCapacity));
 			IF res = ResOk THEN
 			IF res = ResOk THEN
@@ -647,7 +647,7 @@ TYPE
 
 
 		PROCEDURE Write(op, startSec, nofBlocks: LONGINT; adr: ADDRESS): LONGINT;
 		PROCEDURE Write(op, startSec, nofBlocks: LONGINT; adr: ADDRESS): LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			LOOP
 			LOOP
 				res := dev.TransferEx(op, startSec, nofBlocks, adr, dma & UseDma);
 				res := dev.TransferEx(op, startSec, nofBlocks, adr, dma & UseDma);
@@ -662,7 +662,7 @@ TYPE
 
 
 		PROCEDURE PadTrack(op: LONGINT; track: InformationTrack) : LONGINT;
 		PROCEDURE PadTrack(op: LONGINT; track: InformationTrack) : LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			startSec, secsToPad, nofBlocks: LONGINT;
 			startSec, secsToPad, nofBlocks: LONGINT;
 			buf: POINTER TO ARRAY OF CHAR;
 			buf: POINTER TO ARRAY OF CHAR;
 		BEGIN
 		BEGIN
@@ -823,7 +823,7 @@ TYPE
 
 
 		PROCEDURE GetWriteParams(VAR  params: WriteParams): LONGINT;
 		PROCEDURE GetWriteParams(VAR  params: WriteParams): LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			page: Lib.WriteParameterPage;
 			page: Lib.WriteParameterPage;
 		BEGIN
 		BEGIN
 			res := Lib.ModeSense(dev, Lib.MPCurrent, Lib.MPWriteParameters, ADDRESSOF(page), SIZEOF(Lib.WriteParameterPage));
 			res := Lib.ModeSense(dev, Lib.MPCurrent, Lib.MPWriteParameters, ADDRESSOF(page), SIZEOF(Lib.WriteParameterPage));
@@ -919,7 +919,7 @@ TYPE
 		PROCEDURE CheckIncompatibleMedium(): BOOLEAN;
 		PROCEDURE CheckIncompatibleMedium(): BOOLEAN;
 		VAR
 		VAR
 			msg: ATADisks.GetSenseMsg;
 			msg: ATADisks.GetSenseMsg;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			dev.Handle(msg, res);
 			dev.Handle(msg, res);
 			RETURN (msg.sense = 5) & (msg.asc = 30);
 			RETURN (msg.sense = 5) & (msg.asc = 30);
@@ -945,7 +945,7 @@ TYPE
 		PROCEDURE CheckNoMediumPresent*(): BOOLEAN;
 		PROCEDURE CheckNoMediumPresent*(): BOOLEAN;
 		VAR
 		VAR
 			msg: ATADisks.GetSenseMsg;
 			msg: ATADisks.GetSenseMsg;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			dev.Handle(msg, res);
 			dev.Handle(msg, res);
 			RETURN (msg.sense = 2) & (msg.asc = 3AH) & ((msg.ascq = 0) OR (msg.ascq = 1) OR (msg.ascq = 2));
 			RETURN (msg.sense = 2) & (msg.asc = 3AH) & ((msg.ascq = 0) OR (msg.ascq = 1) OR (msg.ascq = 2));
@@ -955,7 +955,7 @@ TYPE
 		PROCEDURE IsInProgress*(): BOOLEAN;
 		PROCEDURE IsInProgress*(): BOOLEAN;
 		VAR
 		VAR
 			msg: ATADisks.GetSenseMsg;
 			msg: ATADisks.GetSenseMsg;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			dev.Handle(msg, res);
 			dev.Handle(msg, res);
 			RETURN (msg.sense = 2) & (msg.asc = 4) & ((msg.ascq = 4) OR (msg.ascq = 7) OR (msg.ascq = 8));
 			RETURN (msg.sense = 2) & (msg.asc = 4) & ((msg.ascq = 4) OR (msg.ascq = 7) OR (msg.ascq = 8));
@@ -1170,7 +1170,7 @@ VAR
 	device : ATADisks.DeviceATAPI;
 	device : ATADisks.DeviceATAPI;
 	i, cur: LONGINT;
 	i, cur: LONGINT;
 	cap: Capabilities;
 	cap: Capabilities;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	res := ResErr;
 	res := ResErr;
 	FOR i := 0 TO MaxRecorders-1 DO
 	FOR i := 0 TO MaxRecorders-1 DO
@@ -1315,7 +1315,7 @@ END InsertionSort;
 PROCEDURE GetSense*(dev: ATADisks.DeviceATAPI);
 PROCEDURE GetSense*(dev: ATADisks.DeviceATAPI);
 VAR
 VAR
 	msg: ATADisks.GetSenseMsg;
 	msg: ATADisks.GetSenseMsg;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	res := dev.RequestSense();
 	res := dev.RequestSense();
 	dev.Handle(msg, res);
 	dev.Handle(msg, res);
@@ -1370,7 +1370,7 @@ END MsfToSector;
 
 
 PROCEDURE Test*;
 PROCEDURE Test*;
 VAR
 VAR
-	res: LONGINT;
+	res: WORD;
 	settings: BurnSettings;
 	settings: BurnSettings;
 	compilation: Compilation;
 	compilation: Compilation;
 	recorders: ARRAY MaxRecorders OF CDRecorder;
 	recorders: ARRAY MaxRecorders OF CDRecorder;

+ 18 - 18
source/CDRecordLib.Mod

@@ -423,7 +423,7 @@ TYPE
 PROCEDURE GetNextAddress*(dev: Ata.DeviceATAPI; VAR adr: LONGINT): LONGINT;
 PROCEDURE GetNextAddress*(dev: Ata.DeviceATAPI; VAR adr: LONGINT): LONGINT;
 VAR
 VAR
 	info: TrackInfo;
 	info: TrackInfo;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	res := ReadTrackInformation(dev, FALSE, TRAdrType1, TRInvisible, ADDRESSOF(info), SIZEOF(TrackInfo));
 	res := ReadTrackInformation(dev, FALSE, TRAdrType1, TRInvisible, ADDRESSOF(info), SIZEOF(TrackInfo));
 	IF res = ResOk THEN
 	IF res = ResOk THEN
@@ -440,7 +440,7 @@ END ReadSessionInfo;
 PROCEDURE GetTrackDescriptor*(dev: Ata.DeviceATAPI; tno: LONGINT; VAR toc: TocDescriptor): LONGINT;
 PROCEDURE GetTrackDescriptor*(dev: Ata.DeviceATAPI; tno: LONGINT; VAR toc: TocDescriptor): LONGINT;
 VAR
 VAR
 	buf: POINTER TO ARRAY OF CHAR;
 	buf: POINTER TO ARRAY OF CHAR;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	NEW(buf, SIZEOF(TocHeader) + SIZEOF(TocDescriptor));
 	NEW(buf, SIZEOF(TocHeader) + SIZEOF(TocDescriptor));
 	res := ReadToc(dev, FALSE, TCFormatToc, tno, ADDRESSOF(buf^), LEN(buf));
 	res := ReadToc(dev, FALSE, TCFormatToc, tno, ADDRESSOF(buf^), LEN(buf));
@@ -537,7 +537,7 @@ END SetAllocationLength;
 PROCEDURE ModeSense*(dev: Ata.DeviceATAPI; pageControl, pageCode: LONGINT; adr: ADDRESS; len: LONGINT) : LONGINT;
 PROCEDURE ModeSense*(dev: Ata.DeviceATAPI; pageControl, pageCode: LONGINT; adr: ADDRESS; len: LONGINT) : LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(5AH);
 	command := dev.NewCommandPacket(5AH);
@@ -563,7 +563,7 @@ END ModeSense;
 PROCEDURE Blank*(dev: Ata.DeviceATAPI; immediate: BOOLEAN; type, tno: LONGINT): LONGINT;
 PROCEDURE Blank*(dev: Ata.DeviceATAPI; immediate: BOOLEAN; type, tno: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(0A1H);
 	command := dev.NewCommandPacket(0A1H);
@@ -587,7 +587,7 @@ END Blank;
 PROCEDURE SendOPCInformation*(dev: Ata.DeviceATAPI; doOPC: BOOLEAN): LONGINT;
 PROCEDURE SendOPCInformation*(dev: Ata.DeviceATAPI; doOPC: BOOLEAN): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(54H);
 	command := dev.NewCommandPacket(54H);
@@ -610,7 +610,7 @@ END SendOPCInformation;
 PROCEDURE GetConfiguration*(dev: Ata.DeviceATAPI; rt, start: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE GetConfiguration*(dev: Ata.DeviceATAPI; rt, start: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(46H);
 	command := dev.NewCommandPacket(46H);
@@ -636,7 +636,7 @@ END GetConfiguration;
 PROCEDURE SynchronizeCache*(dev: Ata.DeviceATAPI; immediate: BOOLEAN): LONGINT;
 PROCEDURE SynchronizeCache*(dev: Ata.DeviceATAPI; immediate: BOOLEAN): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(35H);
 	command := dev.NewCommandPacket(35H);
@@ -655,7 +655,7 @@ END SynchronizeCache;
 PROCEDURE ModeSelect*(dev: Ata.DeviceATAPI;  save: BOOLEAN; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE ModeSelect*(dev: Ata.DeviceATAPI;  save: BOOLEAN; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(55H);
 	command := dev.NewCommandPacket(55H);
@@ -680,7 +680,7 @@ END ModeSelect;
 PROCEDURE ReadDiscInformation*(dev: Ata.DeviceATAPI; dataType: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE ReadDiscInformation*(dev: Ata.DeviceATAPI; dataType: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(51H);
 	command := dev.NewCommandPacket(51H);
@@ -703,7 +703,7 @@ END ReadDiscInformation;
 PROCEDURE ReadToc*(dev: Ata.DeviceATAPI; msf: BOOLEAN; format, tno:  LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE ReadToc*(dev: Ata.DeviceATAPI; msf: BOOLEAN; format, tno:  LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(43H);
 	command := dev.NewCommandPacket(43H);
@@ -730,7 +730,7 @@ END ReadToc;
 PROCEDURE Verify*(dev: Ata.DeviceATAPI; lba, length: LONGINT): LONGINT;
 PROCEDURE Verify*(dev: Ata.DeviceATAPI; lba, length: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(2FH);
 	command := dev.NewCommandPacket(2FH);
@@ -754,7 +754,7 @@ END Verify;
 PROCEDURE ReadCD*(dev: Ata.DeviceATAPI; lba, length, adr, size, type, subChannel: LONGINT; flags: SET; dma: BOOLEAN): LONGINT;
 PROCEDURE ReadCD*(dev: Ata.DeviceATAPI; lba, length, adr, size, type, subChannel: LONGINT; flags: SET; dma: BOOLEAN): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(0BEH);
 	command := dev.NewCommandPacket(0BEH);
@@ -797,7 +797,7 @@ END ReadCD;
 PROCEDURE GetPerformance*(dev: Ata.DeviceATAPI; type, dataType, lba, maxDescr: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE GetPerformance*(dev: Ata.DeviceATAPI; type, dataType, lba, maxDescr: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(0ACH);
 	command := dev.NewCommandPacket(0ACH);
@@ -829,7 +829,7 @@ END GetPerformance;
 PROCEDURE ReadTrackInformation*(dev: Ata.DeviceATAPI; appendable: BOOLEAN; adrType, adrnr: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE ReadTrackInformation*(dev: Ata.DeviceATAPI; appendable: BOOLEAN; adrType, adrnr: LONGINT; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(52H);
 	command := dev.NewCommandPacket(52H);
@@ -859,7 +859,7 @@ END ReadTrackInformation;
 PROCEDURE CloseTrackSess*(dev: Ata.DeviceATAPI; immediate: BOOLEAN; func, trackNr: LONGINT): LONGINT;
 PROCEDURE CloseTrackSess*(dev: Ata.DeviceATAPI; immediate: BOOLEAN; func, trackNr: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(5BH);
 	command := dev.NewCommandPacket(5BH);
@@ -883,7 +883,7 @@ END CloseTrackSess;
 PROCEDURE ReadBufferCapacity*(dev: Ata.DeviceATAPI; block: BOOLEAN; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE ReadBufferCapacity*(dev: Ata.DeviceATAPI; block: BOOLEAN; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(5CH);
 	command := dev.NewCommandPacket(5CH);
@@ -908,7 +908,7 @@ END ReadBufferCapacity;
 PROCEDURE SetCDSpeed*(dev: Ata.DeviceATAPI; readSpeed, writeSpeed, rotControl: LONGINT): LONGINT;
 PROCEDURE SetCDSpeed*(dev: Ata.DeviceATAPI; readSpeed, writeSpeed, rotControl: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(0BBH);
 	command := dev.NewCommandPacket(0BBH);
@@ -933,7 +933,7 @@ END SetCDSpeed;
 PROCEDURE SendCueSheet*(dev: Ata.DeviceATAPI; adr: ADDRESS; len: LONGINT): LONGINT;
 PROCEDURE SendCueSheet*(dev: Ata.DeviceATAPI; adr: ADDRESS; len: LONGINT): LONGINT;
 VAR
 VAR
 	command: Ata.CommandPacket;
 	command: Ata.CommandPacket;
-	res: LONGINT;
+	res: WORD;
 	status: SET;
 	status: SET;
 BEGIN
 BEGIN
 	command := dev.NewCommandPacket(5DH);
 	command := dev.NewCommandPacket(5DH);

+ 4 - 4
source/CDRecordUtils.Mod

@@ -753,7 +753,7 @@ END SetBE32;
 
 
 PROCEDURE Mp3ToWave*(srcFileName, destFileName : Strings.String; onConvertStatusChanged: StatusProc) : LONGINT;
 PROCEDURE Mp3ToWave*(srcFileName, destFileName : Strings.String; onConvertStatusChanged: StatusProc) : LONGINT;
 VAR
 VAR
-	res: LONGINT;
+	res: WORD;
 	srcFile, destFile : Files.File;
 	srcFile, destFile : Files.File;
 	decoder: Codecs.AudioDecoder;
 	decoder: Codecs.AudioDecoder;
 	encoder: Codecs.AudioEncoder;
 	encoder: Codecs.AudioEncoder;
@@ -813,7 +813,7 @@ PROCEDURE GetFreeSpace*(CONST destination: ARRAY OF CHAR; VAR freeSpace: LONGINT
 VAR
 VAR
 	fs: Files.FileSystem;
 	fs: Files.FileSystem;
 	prefix, name: ARRAY MaxLen OF CHAR;
 	prefix, name: ARRAY MaxLen OF CHAR;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	res := ResErr;
 	res := ResErr;
 	Files.SplitName(destination, prefix, name);
 	Files.SplitName(destination, prefix, name);
@@ -829,7 +829,7 @@ PROCEDURE IsReadOnly*(CONST destination: ARRAY OF CHAR; VAR readOnly: BOOLEAN):
 VAR
 VAR
 	fs: Files.FileSystem;
 	fs: Files.FileSystem;
 	prefix, name: ARRAY MaxLen OF CHAR;
 	prefix, name: ARRAY MaxLen OF CHAR;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	res := ResErr;
 	res := ResErr;
 	Files.SplitName(destination, prefix, name);
 	Files.SplitName(destination, prefix, name);
@@ -844,7 +844,7 @@ END IsReadOnly;
 PROCEDURE GetDevice*(file: Files.File; VAR device: Disks.Device): LONGINT;
 PROCEDURE GetDevice*(file: Files.File; VAR device: Disks.Device): LONGINT;
 VAR
 VAR
 	fs: Files.FileSystem;
 	fs: Files.FileSystem;
-	res: LONGINT;
+	res: WORD;
 BEGIN
 BEGIN
 	res := ResErr;
 	res := ResErr;
 	fs := file.fs;
 	fs := file.fs;

+ 2 - 2
source/CRC.Mod

@@ -24,7 +24,7 @@ TYPE
 			InitWriter(Send, 256)
 			InitWriter(Send, 256)
 		END InitStream;
 		END InitStream;
 
 
-		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 			VAR fcs, idx: SET; i: LONGINT;
 			VAR fcs, idx: SET; i: LONGINT;
 		BEGIN
 		BEGIN
 			fcs := SYSTEM.VAL( SET, crc ) * SYSTEM.VAL( SET, 0FFFFH );
 			fcs := SYSTEM.VAL( SET, crc ) * SYSTEM.VAL( SET, 0FFFFH );
@@ -66,7 +66,7 @@ TYPE
 			crc := Init32
 			crc := Init32
 		END Reset;
 		END Reset;
 
 
-		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR idx: LONGINT;
 		VAR idx: LONGINT;
 		BEGIN
 		BEGIN
 			WHILE len > 0 DO
 			WHILE len > 0 DO

+ 3 - 3
source/CSV.Test

@@ -22,7 +22,7 @@ positive: UNLOAD the CSV module before the tests
 
 
 	MODULE Test;
 	MODULE Test;
 	IMPORT Modules;
 	IMPORT Modules;
-	VAR res: LONGINT; msg: ARRAY 64 OF CHAR;
+	VAR res: WORD; msg: ARRAY 64 OF CHAR;
 	BEGIN
 	BEGIN
 		Modules.FreeModule("TestShared", res, msg);
 		Modules.FreeModule("TestShared", res, msg);
 		Modules.FreeModule("CSV", res, msg);
 		Modules.FreeModule("CSV", res, msg);
@@ -62,7 +62,7 @@ positive: setup test base module with shared functions
 		END GetScanner;
 		END GetScanner;
 
 
 		PROCEDURE Cleanup;
 		PROCEDURE Cleanup;
-		VAR fnstr: Strings.String; res: LONGINT;
+		VAR fnstr: Strings.String; res: WORD;
 		BEGIN
 		BEGIN
 			IF canTest THEN
 			IF canTest THEN
 				fnstr := Strings.NewString(fn);
 				fnstr := Strings.NewString(fn);
@@ -328,7 +328,7 @@ positive: UNLOAD the CSV module after the tests
 
 
 	MODULE Test;
 	MODULE Test;
 	IMPORT Modules;
 	IMPORT Modules;
-	VAR res: LONGINT; msg: ARRAY 64 OF CHAR;
+	VAR res: WORD; msg: ARRAY 64 OF CHAR;
 	BEGIN
 	BEGIN
 		Modules.FreeModule("TestShared", res, msg);
 		Modules.FreeModule("TestShared", res, msg);
 		Modules.FreeModule("CSV", res, msg);
 		Modules.FreeModule("CSV", res, msg);

+ 34 - 34
source/Codecs.Mod

@@ -73,7 +73,7 @@ TYPE
 	AVDemultiplexer* = OBJECT
 	AVDemultiplexer* = OBJECT
 
 
 		(** open the demultiplexer on an input stream *)
 		(** open the demultiplexer on an input stream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE GetNumberOfStreams*() : LONGINT;
 		PROCEDURE GetNumberOfStreams*() : LONGINT;
@@ -100,7 +100,7 @@ TYPE
 
 
 		(* 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 *)
 		(* 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 SetStreamPos*(streamNr : LONGINT; seekType : LONGINT; pos : LONGINT; VAR itemSize : LONGINT; VAR res : LONGINT);
+		PROCEDURE SetStreamPos*(streamNr : LONGINT; seekType : LONGINT; pos : LONGINT; VAR itemSize : LONGINT; VAR res : WORD);
 		END SetStreamPos;
 		END SetStreamPos;
 
 
 	END AVDemultiplexer;
 	END AVDemultiplexer;
@@ -132,7 +132,7 @@ TYPE
 		END SetPos;
 		END SetPos;
 
 
 		(* seek the streamNr to position pos with seekType. itemSize contains the size of the element seeked to, if known and applicable; res = 0 if Ok, otherwise an error number *)
 		(* seek the streamNr to position pos with seekType. itemSize contains the size of the element seeked to, if known and applicable; res = 0 if Ok, otherwise an error number *)
-		PROCEDURE SetPosX*(seekType : LONGINT; pos : LONGINT; VAR itemSize : LONGINT; VAR res : LONGINT);
+		PROCEDURE SetPosX*(seekType : LONGINT; pos : LONGINT; VAR itemSize : LONGINT; VAR res : WORD);
 		BEGIN
 		BEGIN
 			demultiplexer.SetStreamPos(streamNr, seekType, pos, itemSize, res);
 			demultiplexer.SetStreamPos(streamNr, seekType, pos, itemSize, res);
 			Reset
 			Reset
@@ -141,7 +141,7 @@ TYPE
 
 
 	AudioDecoder* = OBJECT
 	AudioDecoder* = OBJECT
 		(* open the decoder on a file *)
 		(* open the decoder on a file *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE HasMoreData*():BOOLEAN;
 		PROCEDURE HasMoreData*():BOOLEAN;
@@ -172,10 +172,10 @@ TYPE
 		PROCEDURE SetStreamLength*(length : LONGINT);
 		PROCEDURE SetStreamLength*(length : LONGINT);
 		END SetStreamLength;
 		END SetStreamLength;
 
 
-		PROCEDURE SeekSample*(sample: LONGINT; goKeySample : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekSample*(sample: LONGINT; goKeySample : BOOLEAN; VAR res : WORD);
 		END SeekSample;
 		END SeekSample;
 
 
-		PROCEDURE SeekMillisecond*(millisecond : LONGINT; goKeySample : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekMillisecond*(millisecond : LONGINT; goKeySample : BOOLEAN; VAR res : WORD);
 		END SeekMillisecond;
 		END SeekMillisecond;
 
 
 		(** Prepare the next audio bytes not yet filled into a buffer *)
 		(** Prepare the next audio bytes not yet filled into a buffer *)
@@ -189,20 +189,20 @@ TYPE
 
 
 	AudioEncoder* = OBJECT
 	AudioEncoder* = OBJECT
 		(* open the encoder *)
 		(* open the encoder *)
-		PROCEDURE Open*(out : Streams.Writer; sRate, sRes, nofCh: LONGINT; VAR res : LONGINT);
+		PROCEDURE Open*(out : Streams.Writer; sRate, sRes, nofCh: LONGINT; VAR res : WORD);
 		END Open;
 		END Open;
 
 
-		PROCEDURE Write*(buffer : SoundDevices.Buffer; VAR res : LONGINT);
+		PROCEDURE Write*(buffer : SoundDevices.Buffer; VAR res : WORD);
 		END Write;
 		END Write;
 
 
-		PROCEDURE Close*(VAR res : LONGINT);
+		PROCEDURE Close*(VAR res : WORD);
 		END Close;
 		END Close;
 
 
 	END  AudioEncoder;
 	END  AudioEncoder;
 
 
 	VideoDecoder* = OBJECT
 	VideoDecoder* = OBJECT
 		(* open the decoder on a file *)
 		(* open the decoder on a file *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE HasMoreData*():BOOLEAN;
 		PROCEDURE HasMoreData*():BOOLEAN;
@@ -221,10 +221,10 @@ TYPE
 		PROCEDURE GetCurrentTime*() : LONGINT;
 		PROCEDURE GetCurrentTime*() : LONGINT;
 		END GetCurrentTime;
 		END GetCurrentTime;
 
 
-		PROCEDURE SeekFrame*(frame : LONGINT; goKeyFrame : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekFrame*(frame : LONGINT; goKeyFrame : BOOLEAN; VAR res : WORD);
 		END SeekFrame;
 		END SeekFrame;
 
 
-		PROCEDURE SeekMillisecond*(millisecond : LONGINT; goKeyFrame : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekMillisecond*(millisecond : LONGINT; goKeyFrame : BOOLEAN; VAR res : WORD);
 		END SeekMillisecond;
 		END SeekMillisecond;
 
 
 		(** Prepare the next frame *)
 		(** Prepare the next frame *)
@@ -238,7 +238,7 @@ TYPE
 
 
 	ImageDecoder* = OBJECT
 	ImageDecoder* = OBJECT
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE GetImageInfo*(VAR width, height, format, maxProgressionLevel : LONGINT);
 		PROCEDURE GetImageInfo*(VAR width, height, format, maxProgressionLevel : LONGINT);
@@ -272,7 +272,7 @@ TYPE
 		PROCEDURE SetQuality*(quality : LONGINT);
 		PROCEDURE SetQuality*(quality : LONGINT);
 		END SetQuality;
 		END SetQuality;
 
 
-		PROCEDURE WriteImage*(img : Raster.Image; VAR res : LONGINT);
+		PROCEDURE WriteImage*(img : Raster.Image; VAR res : WORD);
 		END WriteImage;
 		END WriteImage;
 
 
 	END ImageEncoder;
 	END ImageEncoder;
@@ -280,7 +280,7 @@ TYPE
 
 
 	TextDecoder* = OBJECT
 	TextDecoder* = OBJECT
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE GetText*() : Texts.Text;
 		PROCEDURE GetText*() : Texts.Text;
@@ -294,12 +294,12 @@ TYPE
 		PROCEDURE Open*(out : Streams.Writer);
 		PROCEDURE Open*(out : Streams.Writer);
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		END WriteText;
 		END WriteText;
 	END TextEncoder;
 	END TextEncoder;
 
 
 	CryptoDecoder* = OBJECT
 	CryptoDecoder* = OBJECT
-		PROCEDURE Open*(in: Streams.Reader; VAR res: LONGINT);
+		PROCEDURE Open*(in: Streams.Reader; VAR res: WORD);
 		END Open;
 		END Open;
 
 
 		PROCEDURE GetReader*(): Streams.Reader;
 		PROCEDURE GetReader*(): Streams.Reader;
@@ -357,10 +357,10 @@ TYPE
 	AnimationDecoder* = OBJECT
 	AnimationDecoder* = OBJECT
 
 
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		END Open;
 		END Open;
 
 
-		PROCEDURE GetImageSequence*(VAR sequence : ImageSequence; VAR res : LONGINT);
+		PROCEDURE GetImageSequence*(VAR sequence : ImageSequence; VAR res : WORD);
 		END GetImageSequence;
 		END GetImageSequence;
 
 
 	END AnimationDecoder;
 	END AnimationDecoder;
@@ -386,7 +386,7 @@ TYPE
 	AnimationDecoderFactory = PROCEDURE () : AnimationDecoder;
 	AnimationDecoderFactory = PROCEDURE () : AnimationDecoder;
 
 
 
 
-PROCEDURE GetDemuxFactoryName(CONST name : ARRAY OF CHAR; VAR module , procedure : Modules.Name; VAR res : LONGINT);
+PROCEDURE GetDemuxFactoryName(CONST name : ARRAY OF CHAR; VAR module , procedure : Modules.Name; VAR res : WORD);
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 BEGIN
 BEGIN
 	res := ResFailed;
 	res := ResFailed;
@@ -397,7 +397,7 @@ BEGIN
 	END
 	END
 END GetDemuxFactoryName;
 END GetDemuxFactoryName;
 
 
-PROCEDURE GetDecoderFactoryName(CONST type, name : ARRAY OF CHAR; VAR module, procedure : Modules.Name; VAR res : LONGINT);
+PROCEDURE GetDecoderFactoryName(CONST type, name : ARRAY OF CHAR; VAR module, procedure : Modules.Name; VAR res : WORD);
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 BEGIN
 BEGIN
 	res := ResFailed;
 	res := ResFailed;
@@ -409,7 +409,7 @@ BEGIN
 	END
 	END
 END GetDecoderFactoryName;
 END GetDecoderFactoryName;
 
 
-PROCEDURE GetEncoderFactoryName(CONST type, name : ARRAY OF CHAR; VAR module, procedure : Modules.Name; VAR res : LONGINT);
+PROCEDURE GetEncoderFactoryName(CONST type, name : ARRAY OF CHAR; VAR module, procedure : Modules.Name; VAR res : WORD);
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 VAR config, factoryName, msg : ARRAY 128 OF CHAR;
 BEGIN
 BEGIN
 	res := ResFailed;
 	res := ResFailed;
@@ -425,7 +425,7 @@ END GetEncoderFactoryName;
 PROCEDURE GetDemultiplexer*(CONST name : ARRAY OF CHAR) : AVDemultiplexer;
 PROCEDURE GetDemultiplexer*(CONST name : ARRAY OF CHAR) : AVDemultiplexer;
 VAR
 VAR
 	demux : AVDemultiplexer; factory : DemuxFactory;
 	demux : AVDemultiplexer; factory : DemuxFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	demux := NIL;
 	demux := NIL;
 	GetDemuxFactoryName(name, moduleName, procedureName, res);
 	GetDemuxFactoryName(name, moduleName, procedureName, res);
@@ -442,7 +442,7 @@ END GetDemultiplexer;
 PROCEDURE GetImageDecoder*(CONST name : ARRAY OF CHAR) : ImageDecoder;
 PROCEDURE GetImageDecoder*(CONST name : ARRAY OF CHAR) : ImageDecoder;
 VAR
 VAR
 	decoder : ImageDecoder; factory : ImageDecoderFactory;
 	decoder : ImageDecoder; factory : ImageDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Image", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Image", name, moduleName, procedureName, res);
@@ -459,7 +459,7 @@ END GetImageDecoder;
 PROCEDURE GetImageEncoder*(CONST name : ARRAY OF CHAR) : ImageEncoder;
 PROCEDURE GetImageEncoder*(CONST name : ARRAY OF CHAR) : ImageEncoder;
 VAR
 VAR
 	encoder : ImageEncoder; factory : ImageEncoderFactory;
 	encoder : ImageEncoder; factory : ImageEncoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	encoder := NIL;
 	encoder := NIL;
 	GetEncoderFactoryName("Image", name, moduleName, procedureName, res);
 	GetEncoderFactoryName("Image", name, moduleName, procedureName, res);
@@ -476,7 +476,7 @@ END GetImageEncoder;
 PROCEDURE GetVideoDecoder*(CONST name : ARRAY OF CHAR) : VideoDecoder;
 PROCEDURE GetVideoDecoder*(CONST name : ARRAY OF CHAR) : VideoDecoder;
 VAR
 VAR
 	decoder : VideoDecoder; factory : VideoDecoderFactory;
 	decoder : VideoDecoder; factory : VideoDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Video", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Video", name, moduleName, procedureName, res);
@@ -493,7 +493,7 @@ END GetVideoDecoder;
 PROCEDURE GetAudioDecoder*(CONST name : ARRAY OF CHAR) : AudioDecoder;
 PROCEDURE GetAudioDecoder*(CONST name : ARRAY OF CHAR) : AudioDecoder;
 VAR
 VAR
 	decoder : AudioDecoder; factory : AudioDecoderFactory;
 	decoder : AudioDecoder; factory : AudioDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Audio", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Audio", name, moduleName, procedureName, res);
@@ -510,7 +510,7 @@ END GetAudioDecoder;
 PROCEDURE GetAudioEncoder*(CONST name : ARRAY OF CHAR) : AudioEncoder;
 PROCEDURE GetAudioEncoder*(CONST name : ARRAY OF CHAR) : AudioEncoder;
 VAR
 VAR
 	encoder : AudioEncoder; factory : AudioEncoderFactory;
 	encoder : AudioEncoder; factory : AudioEncoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	encoder := NIL;
 	encoder := NIL;
 	GetEncoderFactoryName("Audio", name, moduleName, procedureName, res);
 	GetEncoderFactoryName("Audio", name, moduleName, procedureName, res);
@@ -526,7 +526,7 @@ END GetAudioEncoder;
 PROCEDURE GetTextDecoder*(CONST name : ARRAY OF CHAR) : TextDecoder;
 PROCEDURE GetTextDecoder*(CONST name : ARRAY OF CHAR) : TextDecoder;
 VAR
 VAR
 	decoder : TextDecoder; factory : TextDecoderFactory;
 	decoder : TextDecoder; factory : TextDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Text", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Text", name, moduleName, procedureName, res);
@@ -543,7 +543,7 @@ END GetTextDecoder;
 PROCEDURE GetTextEncoder*(CONST name : ARRAY OF CHAR) : TextEncoder;
 PROCEDURE GetTextEncoder*(CONST name : ARRAY OF CHAR) : TextEncoder;
 VAR
 VAR
 	encoder : TextEncoder; factory : TextEncoderFactory;
 	encoder : TextEncoder; factory : TextEncoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	encoder := NIL;
 	encoder := NIL;
 	GetEncoderFactoryName("Text", name, moduleName, procedureName, res);
 	GetEncoderFactoryName("Text", name, moduleName, procedureName, res);
@@ -560,7 +560,7 @@ END GetTextEncoder;
 PROCEDURE GetCryptoDecoder*(CONST name : ARRAY OF CHAR) : CryptoDecoder;
 PROCEDURE GetCryptoDecoder*(CONST name : ARRAY OF CHAR) : CryptoDecoder;
 VAR
 VAR
 	decoder : CryptoDecoder; factory : CryptoDecoderFactory;
 	decoder : CryptoDecoder; factory : CryptoDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Crypto", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Crypto", name, moduleName, procedureName, res);
@@ -577,7 +577,7 @@ END GetCryptoDecoder;
 PROCEDURE GetCryptoEncoder*(CONST name : ARRAY OF CHAR) : CryptoEncoder;
 PROCEDURE GetCryptoEncoder*(CONST name : ARRAY OF CHAR) : CryptoEncoder;
 VAR
 VAR
 	encoder : CryptoEncoder; factory : CryptoEncoderFactory;
 	encoder : CryptoEncoder; factory : CryptoEncoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	encoder := NIL;
 	encoder := NIL;
 	GetEncoderFactoryName("Crypto", name, moduleName, procedureName, res);
 	GetEncoderFactoryName("Crypto", name, moduleName, procedureName, res);
@@ -594,7 +594,7 @@ END GetCryptoEncoder;
 PROCEDURE GetAnimationDecoder*(CONST name : ARRAY OF CHAR) : AnimationDecoder;
 PROCEDURE GetAnimationDecoder*(CONST name : ARRAY OF CHAR) : AnimationDecoder;
 VAR
 VAR
 	decoder : AnimationDecoder; factory : AnimationDecoderFactory;
 	decoder : AnimationDecoder; factory : AnimationDecoderFactory;
-	moduleName, procedureName : Modules.Name; res : LONGINT;
+	moduleName, procedureName : Modules.Name; res : WORD;
 BEGIN
 BEGIN
 	decoder := NIL;
 	decoder := NIL;
 	GetDecoderFactoryName("Animation", name, moduleName, procedureName, res);
 	GetDecoderFactoryName("Animation", name, moduleName, procedureName, res);
@@ -640,7 +640,7 @@ VAR f : Files.File;
 	zf : Unzip.ZipFile;
 	zf : Unzip.ZipFile;
 	entry : Unzip.Entry;
 	entry : Unzip.Entry;
 	archive : Archives.Archive;
 	archive : Archives.Archive;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	SplitName(name, protocol, filename);
 	SplitName(name, protocol, filename);
 	COPY(protocol, tp); Strings.LowerCase(tp);
 	COPY(protocol, tp); Strings.LowerCase(tp);

+ 1 - 1
source/CommandTest.Mod

@@ -8,7 +8,7 @@ TYPE Tester = OBJECT (TestSuite.Tester)
 	VAR tempname: Files.FileName;
 	VAR tempname: Files.FileName;
 
 
 	PROCEDURE Handle (reader: Streams.Reader; position: LONGINT; CONST name: ARRAY OF CHAR; type: TestSuite.TestType): INTEGER;
 	PROCEDURE Handle (reader: Streams.Reader; position: LONGINT; CONST name: ARRAY OF CHAR; type: TestSuite.TestType): INTEGER;
-	VAR res: LONGINT; msg: ARRAY 128 OF CHAR; result: INTEGER; file: Files.File; writer: Files.Writer;
+	VAR res: WORD; msg: ARRAY 128 OF CHAR; result: INTEGER; file: Files.File; writer: Files.Writer;
 	BEGIN
 	BEGIN
 		result := TestSuite.Failure;
 		result := TestSuite.Failure;
 		file := Files.New (tempname);
 		file := Files.New (tempname);

+ 6 - 6
source/Commands.Mod

@@ -106,7 +106,7 @@ TYPE
 		proc : CommandProc;
 		proc : CommandProc;
 		commandProc : CommandContextProc;
 		commandProc : CommandContextProc;
 
 
-		msg : ARRAY 128 OF CHAR; res : LONGINT;
+		msg : ARRAY 128 OF CHAR; res : WORD;
 
 
 		module : Modules.Module;
 		module : Modules.Module;
 		state : LONGINT;
 		state : LONGINT;
@@ -129,7 +129,7 @@ TYPE
 			state := Started;
 			state := Started;
 		END Init;
 		END Init;
 
 
-		PROCEDURE Join(this : LONGINT; VAR res : LONGINT; VAR msg : ARRAY OF CHAR);
+		PROCEDURE Join(this : LONGINT; VAR res : WORD; VAR msg : ARRAY OF CHAR);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			AWAIT(state >= this);
 			AWAIT(state >= this);
 			res := SELF.res; COPY(SELF.msg, msg);
 			res := SELF.res; COPY(SELF.msg, msg);
@@ -194,13 +194,13 @@ BEGIN
 	RETURN reader;
 	RETURN reader;
 END GetEmptyReader;
 END GetEmptyReader;
 
 
-PROCEDURE SendNothing(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+PROCEDURE SendNothing(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 END SendNothing;
 END SendNothing;
 
 
 (** Splits a command string of the form moduleName.commandProcName into its components. Can be used to check whether a
 (** Splits a command string of the form moduleName.commandProcName into its components. Can be used to check whether a
 	command string is syntactically correct, i.e. is of the form 'ModuleName "." [ProcedureName]' *)
 	command string is syntactically correct, i.e. is of the form 'ModuleName "." [ProcedureName]' *)
 
 
-PROCEDURE Split*(CONST cmdstr : ARRAY OF CHAR; VAR moduleName, procedureName : Modules.Name; VAR res : LONGINT; VAR msg : ARRAY OF CHAR);
+PROCEDURE Split*(CONST cmdstr : ARRAY OF CHAR; VAR moduleName, procedureName : Modules.Name; VAR res : WORD; VAR msg : ARRAY OF CHAR);
 VAR i, j : LONGINT; maxlen, cmdlen : LONGINT;
 VAR i, j : LONGINT; maxlen, cmdlen : LONGINT;
 BEGIN
 BEGIN
 	res := CommandParseError;
 	res := CommandParseError;
@@ -245,7 +245,7 @@ END GetContext;
 	Returns res = Ok if successful, otherwise msg contains error message.
 	Returns res = Ok if successful, otherwise msg contains error message.
 	The command can call GetConext() to get its context, which is also passed directly. *)
 	The command can call GetConext() to get its context, which is also passed directly. *)
 
 
-PROCEDURE Activate*(CONST cmd : ARRAY OF CHAR; context : Context; flags : SET; VAR res : LONGINT; VAR msg : ARRAY OF CHAR);
+PROCEDURE Activate*(CONST cmd : ARRAY OF CHAR; context : Context; flags : SET; VAR res : WORD; VAR msg : ARRAY OF CHAR);
 VAR moduleName, commandName : Modules.Name; run : Runner;
 VAR moduleName, commandName : Modules.Name; run : Runner;
 BEGIN
 BEGIN
 
 
@@ -269,7 +269,7 @@ END Activate;
 		params = {<any character except ";">} .
 		params = {<any character except ";">} .
 *)
 *)
 
 
-PROCEDURE Call*(cmds : ARRAY OF CHAR; flags : SET; VAR res : LONGINT; VAR msg : ARRAY OF CHAR);
+PROCEDURE Call*(cmds : ARRAY OF CHAR; flags : SET; VAR res : WORD; VAR msg : ARRAY OF CHAR);
 VAR  outer, context : Context; arg : Streams.StringReader; i, j, k : LONGINT; mode : ARRAY 5 OF CHAR;
 VAR  outer, context : Context; arg : Streams.StringReader; i, j, k : LONGINT; mode : ARRAY 5 OF CHAR;
 par : POINTER TO ARRAY OF CHAR;
 par : POINTER TO ARRAY OF CHAR;
 BEGIN
 BEGIN

+ 8 - 8
source/Configuration.Mod

@@ -76,7 +76,7 @@ BEGIN
 END GetElementX;
 END GetElementX;
 
 
 (** 	Find the setting specified by the key, which is a path name through the sections to the setting, and return its value. *)
 (** 	Find the setting specified by the key, which is a path name through the sections to the setting, and return its value. *)
-PROCEDURE Get*(CONST key: ARRAY OF CHAR; VAR val: ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE Get*(CONST key: ARRAY OF CHAR; VAR val: ARRAY OF CHAR; VAR res : WORD);
 VAR e: XML.Element; s: Strings.String; a: XML.Attribute;
 VAR e: XML.Element; s: Strings.String; a: XML.Attribute;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	e := GetElementX(Setting, key);
 	e := GetElementX(Setting, key);
@@ -107,7 +107,7 @@ BEGIN {EXCLUSIVE}
 	END;
 	END;
 END Get;
 END Get;
 
 
-PROCEDURE GetBoolean*(CONST key : ARRAY OF CHAR; VAR value : BOOLEAN; VAR res : LONGINT);
+PROCEDURE GetBoolean*(CONST key : ARRAY OF CHAR; VAR value : BOOLEAN; VAR res : WORD);
 VAR string : ARRAY 8 OF CHAR;
 VAR string : ARRAY 8 OF CHAR;
 BEGIN
 BEGIN
 	Get(key, string, res);
 	Get(key, string, res);
@@ -122,7 +122,7 @@ BEGIN
 	END;
 	END;
 END GetBoolean;
 END GetBoolean;
 
 
-PROCEDURE GetColor*(CONST key : ARRAY OF CHAR; VAR value : LONGINT; VAR res : LONGINT);
+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 : LONGINT;
 BEGIN
 BEGIN
 	Get(key, string, res);
 	Get(key, string, res);
@@ -134,7 +134,7 @@ BEGIN
 END GetColor;
 END GetColor;
 
 
 
 
-PROCEDURE GetInteger*(CONST key : ARRAY OF CHAR; VAR value : LONGINT; VAR res : LONGINT);
+PROCEDURE GetInteger*(CONST key : ARRAY OF CHAR; VAR value : LONGINT; VAR res : WORD);
 VAR string : ARRAY 16 OF CHAR;
 VAR string : ARRAY 16 OF CHAR;
 BEGIN
 BEGIN
 	Get(key, string, res);
 	Get(key, string, res);
@@ -145,7 +145,7 @@ BEGIN
 END GetInteger;
 END GetInteger;
 
 
 (** update (or insert if necessairy) the setting specified by the key. if the specified section/setting is not yet existing, it will be created *)
 (** update (or insert if necessairy) the setting specified by the key. if the specified section/setting is not yet existing, it will be created *)
-PROCEDURE Put*(CONST key, val : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE Put*(CONST key, val : ARRAY OF CHAR; VAR res : WORD);
 VAR e, child : XML.Element; i, j : LONGINT; name : ARRAY 64 OF CHAR;
 VAR e, child : XML.Element; i, j : LONGINT; name : ARRAY 64 OF CHAR;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	res := Ok;
 	res := Ok;
@@ -175,19 +175,19 @@ BEGIN {EXCLUSIVE}
 	END
 	END
 END Put;
 END Put;
 
 
-PROCEDURE PutBoolean*(CONST key : ARRAY OF CHAR; value : BOOLEAN; VAR res : LONGINT);
+PROCEDURE PutBoolean*(CONST key : ARRAY OF CHAR; value : BOOLEAN; VAR res : WORD);
 BEGIN
 BEGIN
 	IF value THEN Put(key, "TRUE", res) ELSE Put(key, "FALSE", res); END;
 	IF value THEN Put(key, "TRUE", res) ELSE Put(key, "FALSE", res); END;
 END PutBoolean;
 END PutBoolean;
 
 
-PROCEDURE PutColor*(CONST key : ARRAY OF CHAR; value : LONGINT; VAR res : LONGINT);
+PROCEDURE PutColor*(CONST key : ARRAY OF CHAR; value : LONGINT; VAR res : WORD);
 VAR string : ARRAY 9 OF CHAR;
 VAR string : ARRAY 9 OF CHAR;
 BEGIN
 BEGIN
 	Strings.IntToHexStr(value, 8, string);
 	Strings.IntToHexStr(value, 8, string);
 	Put(key, string, res);
 	Put(key, string, res);
 END PutColor;
 END PutColor;
 
 
-PROCEDURE PutInteger*(CONST key : ARRAY OF CHAR; value : LONGINT; VAR res : LONGINT);
+PROCEDURE PutInteger*(CONST key : ARRAY OF CHAR; value : LONGINT; VAR res : WORD);
 VAR string : ARRAY 16 OF CHAR;
 VAR string : ARRAY 16 OF CHAR;
 BEGIN
 BEGIN
 	Strings.IntToStr(value, string);
 	Strings.IntToStr(value, string);

+ 1 - 1
source/ContextualDependency.Mod

@@ -762,7 +762,7 @@ TYPE
 			contextFound, validContext, charFound : BOOLEAN;
 			contextFound, validContext, charFound : BOOLEAN;
 			charString : XML.String;
 			charString : XML.String;
 			charCode : Texts.Char32;
 			charCode : Texts.Char32;
-			res : LONGINT;
+			res : WORD;
 			base16, neg : BOOLEAN;
 			base16, neg : BOOLEAN;
 			genericRangeSize, offset : LONGINT;
 			genericRangeSize, offset : LONGINT;
 
 

+ 2 - 2
source/Coop.MemCache.Mod

@@ -10,7 +10,7 @@ CONST
 
 
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 
 
-PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 BEGIN
 BEGIN
 	res := 1507	(* implementation restriction - fixed entries not supported *)
 	res := 1507	(* implementation restriction - fixed entries not supported *)
@@ -18,7 +18,7 @@ END LocalSetCacheProperties;
 
 
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 
 
-PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 BEGIN
 BEGIN
 	res := 1507	(* implementation restriction - fixed entries not supported *)
 	res := 1507	(* implementation restriction - fixed entries not supported *)
 END GlobalSetCacheProperties;
 END GlobalSetCacheProperties;

+ 3 - 3
source/Coop.Modules.Mod

@@ -112,7 +112,7 @@ TYPE
 
 
 	END Module;
 	END Module;
 
 
-	LoaderProc* = PROCEDURE (CONST name, fileName: ARRAY OF CHAR; VAR res: LONGINT;
+	LoaderProc* = PROCEDURE (CONST name, fileName: ARRAY OF CHAR; VAR res: WORD;
 			VAR msg: ARRAY OF CHAR): Module;	(** load an object file *)
 			VAR msg: ARRAY OF CHAR): Module;	(** load an object file *)
 
 
 VAR
 VAR
@@ -401,7 +401,7 @@ END Initialize;
 	END SortExceptionTable;
 	END SortExceptionTable;
 	
 	
 (** Load the module if it is not already loaded. *)	(* Algorithm J. Templ, ETHZ, 1994 *)
 (** Load the module if it is not already loaded. *)	(* Algorithm J. Templ, ETHZ, 1994 *)
-PROCEDURE ThisModule*(CONST name: ARRAY OF CHAR; VAR res: LONGINT; VAR msg: ARRAY OF CHAR): Module;
+PROCEDURE ThisModule*(CONST name: ARRAY OF CHAR; VAR res: WORD; VAR msg: ARRAY OF CHAR): Module;
 VAR m: Module; fileName: ARRAY 64 OF CHAR; i: LONGINT; registered: BOOLEAN;
 VAR m: Module; fileName: ARRAY 64 OF CHAR; i: LONGINT; registered: BOOLEAN;
 BEGIN
 BEGIN
 	res := Ok; msg[0] := 0X; m := ByName(name, registered);
 	res := Ok; msg[0] := 0X; m := ByName(name, registered);
@@ -587,7 +587,7 @@ BEGIN
 END InstallTermHandler;
 END InstallTermHandler;
 
 
 (** Free a module. The module's termination handler, if any, is called first. Then all objects that have finalizers in this module are finalized (even if they are still reachable). Then the module's data and code are invalidated. *)
 (** Free a module. The module's termination handler, if any, is called first. Then all objects that have finalizers in this module are finalized (even if they are still reachable). Then the module's data and code are invalidated. *)
-PROCEDURE FreeModule*(CONST name: ARRAY OF CHAR; VAR res: LONGINT; VAR msg: ARRAY OF CHAR);
+PROCEDURE FreeModule*(CONST name: ARRAY OF CHAR; VAR res: WORD; VAR msg: ARRAY OF CHAR);
 VAR p, m: Module; term: TerminationHandler; i: LONGINT;
 VAR p, m: Module; term: TerminationHandler; i: LONGINT;
 BEGIN
 BEGIN
 	m := ModuleByName(name);
 	m := ModuleByName(name);

+ 1 - 1
source/Coop.Windows.Display.Mod

@@ -1084,7 +1084,7 @@ VAR
 
 
 	PROCEDURE DoInstall( w, h, left, top: LONGINT );
 	PROCEDURE DoInstall( w, h, left, top: LONGINT );
 	VAR ts: ARRAY 16 OF CHAR;
 	VAR ts: ARRAY 16 OF CHAR;
-		res: LONGINT;  create: CreateStruct;  win: Window;  hMenu: User32.HMenu;  x, y: LONGINT;
+		res: WORD;  create: CreateStruct;  win: Window;  hMenu: User32.HMenu;  x, y: LONGINT;
 	VAR border: LONGINT;  rect: User32.Rect;   (*ALEX 2005.11.30*)
 	VAR border: LONGINT;  rect: User32.Rect;   (*ALEX 2005.11.30*)
 
 
 		hDC: User32.HDC;
 		hDC: User32.HDC;

+ 1 - 1
source/CyberbitNetInstall.Mod

@@ -17,7 +17,7 @@ TYPE
 	Downloader = OBJECT
 	Downloader = OBJECT
 
 
 		PROCEDURE &New*;
 		PROCEDURE &New*;
-		VAR res : LONGINT; temp : ARRAY 16 OF CHAR;
+		VAR res : WORD; temp : ARRAY 16 OF CHAR;
 			r : Streams.Reader; w : Files.Writer;
 			r : Streams.Reader; w : Files.Writer;
 			buf: ARRAY BufSize OF CHAR; len : LONGINT;
 			buf: ARRAY BufSize OF CHAR; len : LONGINT;
 			msg, s : ARRAY 256 OF CHAR; i, j : LONGINT;
 			msg, s : ARRAY 256 OF CHAR; i, j : LONGINT;

+ 10 - 10
source/CyrillicUtilities.Mod

@@ -62,7 +62,7 @@ TYPE
 			errors := TRUE
 			errors := TRUE
 		END Error;
 		END Error;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR i, m: LONGINT;
 		VAR i, m: LONGINT;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			ch, last : CHAR;
 			ch, last : CHAR;
@@ -109,7 +109,7 @@ TYPE
 			END
 			END
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 			c: CHAR;
 			c: CHAR;
 		BEGIN
 		BEGIN
@@ -145,7 +145,7 @@ TYPE
 			errors := TRUE
 			errors := TRUE
 		END Error;
 		END Error;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR i, m: LONGINT;
 		VAR i, m: LONGINT;
 			(*r : Files.Reader;*)
 			(*r : Files.Reader;*)
 			tempUCS32 : ARRAY 1024 OF Char32;
 			tempUCS32 : ARRAY 1024 OF Char32;
@@ -193,7 +193,7 @@ TYPE
 			END;
 			END;
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 			c: CHAR;
 			c: CHAR;
 		BEGIN
 		BEGIN
@@ -229,7 +229,7 @@ TYPE
 			errors := TRUE
 			errors := TRUE
 		END Error;
 		END Error;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR i, m: LONGINT;
 		VAR i, m: LONGINT;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			ch, last : CHAR;
 			ch, last : CHAR;
@@ -276,7 +276,7 @@ TYPE
 			END
 			END
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 			c: CHAR;
 			c: CHAR;
 		BEGIN
 		BEGIN
@@ -312,7 +312,7 @@ TYPE
 			errors := TRUE
 			errors := TRUE
 		END Error;
 		END Error;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR i, m: LONGINT;
 		VAR i, m: LONGINT;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			ch, last : CHAR;
 			ch, last : CHAR;
@@ -359,7 +359,7 @@ TYPE
 			END;
 			END;
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 			c: CHAR;
 			c: CHAR;
 		BEGIN
 		BEGIN
@@ -395,7 +395,7 @@ TYPE
 			errors := TRUE
 			errors := TRUE
 		END Error;
 		END Error;
 
 
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR i, m: LONGINT;
 		VAR i, m: LONGINT;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			tempUCS32 : ARRAY 1024 OF Char32;
 			ch, last : CHAR;
 			ch, last : CHAR;
@@ -442,7 +442,7 @@ TYPE
 			END
 			END
 		END Open;
 		END Open;
 
 
-		PROCEDURE WriteText*(text : Texts.Text; VAR res : LONGINT);
+		PROCEDURE WriteText*(text : Texts.Text; VAR res : WORD);
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 		VAR r : Texts.TextReader; ch : Texts.Char32; i : LONGINT;
 			c: CHAR;
 			c: CHAR;
 		BEGIN
 		BEGIN

+ 2 - 2
source/DHCP.Mod

@@ -168,7 +168,7 @@ END CreateDHCPRequestMsg;
 (* Initiate the boot protocol. When successful, return res = 0 and set the parameters. *)
 (* Initiate the boot protocol. When successful, return res = 0 and set the parameters. *)
 
 
 PROCEDURE InitDHCP(int: IP.Interface; VAR localAdr, maskAdr, gatewayAdr: IP.Adr;
 PROCEDURE InitDHCP(int: IP.Interface; VAR localAdr, maskAdr, gatewayAdr: IP.Adr;
-		VAR dns: ARRAY OF IP.Adr; VAR domain: ARRAY OF CHAR; VAR res: LONGINT);
+		VAR dns: ARRAY OF IP.Adr; VAR domain: ARRAY OF CHAR; VAR res: WORD);
 VAR
 VAR
 	p: UDP.Socket;
 	p: UDP.Socket;
 	fport, len, time, start, offerDelay, requestDelay, i: LONGINT;
 	fport, len, time, start, offerDelay, requestDelay, i: LONGINT;
@@ -310,7 +310,7 @@ END InitDHCP;
 
 
 (** Run DHCP on specified interface and try to configure it directly. *)
 (** Run DHCP on specified interface and try to configure it directly. *)
 
 
-PROCEDURE RunDHCP*(int: IP.Interface; VAR res: LONGINT);
+PROCEDURE RunDHCP*(int: IP.Interface; VAR res: WORD);
 VAR
 VAR
 	localAdr, maskAdr, gatewayAdr: IP.Adr;
 	localAdr, maskAdr, gatewayAdr: IP.Adr;
 	dns: ARRAY IP.MaxNofDNS OF IP.Adr;
 	dns: ARRAY IP.MaxNofDNS OF IP.Adr;

+ 4 - 4
source/DNS.Mod

@@ -372,7 +372,7 @@ BEGIN
 	END
 	END
 END RetrieveInfo;
 END RetrieveInfo;
 
 
-PROCEDURE SendQuery(pcb: UDP.Socket; server: IP.Adr; name: ARRAY OF CHAR; type: LONGINT; VAR buf: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE SendQuery(pcb: UDP.Socket; server: IP.Adr; name: ARRAY OF CHAR; type: LONGINT; VAR buf: ARRAY OF CHAR; VAR res: WORD);
 VAR len: LONGINT;
 VAR len: LONGINT;
 BEGIN
 BEGIN
 	len := 0; res := 0;
 	len := 0; res := 0;
@@ -435,7 +435,7 @@ END QueryDNS;
 
 
 (** Find the host responsible for mail exchange of the specified domain. *)
 (** Find the host responsible for mail exchange of the specified domain. *)
 
 
-PROCEDURE MailHostByDomain*(domain: ARRAY OF CHAR; VAR hostname: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE MailHostByDomain*(domain: ARRAY OF CHAR; VAR hostname: ARRAY OF CHAR; VAR res: WORD);
 VAR
 VAR
 	buf: ARRAY 512 OF CHAR;
 	buf: ARRAY 512 OF CHAR;
 	timeout: LONGINT;
 	timeout: LONGINT;
@@ -458,7 +458,7 @@ END MailHostByDomain;
 
 
 (** Find the IP address of the specified host. *)
 (** Find the IP address of the specified host. *)
 
 
-PROCEDURE HostByName*(hostname: ARRAY OF CHAR; VAR adr: IP.Adr; VAR res: LONGINT);
+PROCEDURE HostByName*(hostname: ARRAY OF CHAR; VAR adr: IP.Adr; VAR res: WORD);
 VAR
 VAR
 	buf: ARRAY 512 OF CHAR;
 	buf: ARRAY 512 OF CHAR;
 	name: Name;
 	name: Name;
@@ -505,7 +505,7 @@ END HostByName;
 
 
 (** Find the host name of the specified IP address. *)
 (** Find the host name of the specified IP address. *)
 
 
-PROCEDURE HostByNumber*(adr: IP.Adr; VAR hostname: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE HostByNumber*(adr: IP.Adr; VAR hostname: ARRAY OF CHAR; VAR res: WORD);
 VAR
 VAR
 	buf: ARRAY 512 OF CHAR;
 	buf: ARRAY 512 OF CHAR;
 	name: Name;
 	name: Name;

+ 3 - 3
source/DTPEditor.Mod

@@ -410,7 +410,7 @@ TYPE
 		VAR name, msg: ARRAY 32 OF CHAR;
 		VAR name, msg: ARRAY 32 OF CHAR;
 			string: Strings.String;
 			string: Strings.String;
 			i : LONGINT;
 			i : LONGINT;
-			(* res : LONGINT;	*)
+			(* res : WORD;	*)
 		BEGIN
 		BEGIN
 			drawPanel.selectionON := FALSE;
 			drawPanel.selectionON := FALSE;
 			msg := "";
 			msg := "";
@@ -1273,7 +1273,7 @@ TYPE
 			pixelPerMM : REAL;
 			pixelPerMM : REAL;
 			renderCanvas: WMGraphics.BufferCanvas;
 			renderCanvas: WMGraphics.BufferCanvas;
 			renderImg: Raster.Image;
 			renderImg: Raster.Image;
-			res: LONGINT;
+			res: WORD;
 			oldDocOriginX, oldDocOriginY : LONGINT;
 			oldDocOriginX, oldDocOriginY : LONGINT;
 			oldZoomFactor: REAL;
 			oldZoomFactor: REAL;
 			oldZoomMode: LONGINT;
 			oldZoomMode: LONGINT;
@@ -2337,7 +2337,7 @@ TYPE
 		PROCEDURE InstantiatePlugin*(CONST name: ARRAY OF CHAR): DTPData.ContentObject;
 		PROCEDURE InstantiatePlugin*(CONST name: ARRAY OF CHAR): DTPData.ContentObject;
 		VAR
 		VAR
 			contentObject : DTPData.ContentObject; gen: DTPData.ContentFactory;
 			contentObject : DTPData.ContentObject; gen: DTPData.ContentFactory;
-			moduleName, procedureName : Modules.Name; msg : ARRAY 16 OF CHAR; res : LONGINT;
+			moduleName, procedureName : Modules.Name; msg : ARRAY 16 OF CHAR; res : WORD;
 			pp : ANY;
 			pp : ANY;
 		BEGIN
 		BEGIN
 			contentObject := NIL;
 			contentObject := NIL;

+ 1 - 1
source/DTPText.Mod

@@ -1953,7 +1953,7 @@ TYPE
 		VAR di : WMWindowManager.DragInfo;
 		VAR di : WMWindowManager.DragInfo;
 			dt : WMDropTarget.DropTarget;
 			dt : WMDropTarget.DropTarget;
 		(*	itf : WMDropTarget.DropInterface;
 		(*	itf : WMDropTarget.DropInterface;
-			res : LONGINT;
+			res : WORD;
 			targetText, temp : Texts.Text;
 			targetText, temp : Texts.Text;
 			pos, a, b : LONGINT; *)
 			pos, a, b : LONGINT; *)
 		BEGIN
 		BEGIN

+ 1 - 1
source/DTPUtilities.Mod

@@ -160,7 +160,7 @@ TYPE
 			Hide;
 			Hide;
 		END OKHandler;
 		END OKHandler;
 
 
-		PROCEDURE SetResult(res: LONGINT);
+		PROCEDURE SetResult(res: WORD);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			result := res;
 			result := res;
 		END SetResult;
 		END SetResult;

+ 5 - 5
source/Darwin.AMD64.Unix.Mod

@@ -690,7 +690,7 @@ VAR
 		me: Thread_t;
 		me: Thread_t;
 		old, new: Sigset;
 		old, new: Sigset;
 		param: Sched_param;
 		param: Sched_param;
-		res: LONGINT;
+		res: WORD;
 	BEGIN
 	BEGIN
 		me := pthread_self();
 		me := pthread_self();
 		SetSigaltstack();
 		SetSigaltstack();
@@ -722,7 +722,7 @@ VAR
 	VAR
 	VAR
 		attr: PThreadAttrType;
 		attr: PThreadAttrType;
 		id: Thread_t;
 		id: Thread_t;
-		res: LONGINT;
+		res: WORD;
 	BEGIN
 	BEGIN
 		pthread_attr_init( ADDRESSOF( attr ) );
 		pthread_attr_init( ADDRESSOF( attr ) );
 		pthread_attr_setscope( ADDRESSOF( attr ), PTHREAD_SCOPE_SYSTEM );
 		pthread_attr_setscope( ADDRESSOF( attr ), PTHREAD_SCOPE_SYSTEM );
@@ -884,7 +884,7 @@ VAR
 
 
 
 
 	PROCEDURE getSysinfo;
 	PROCEDURE getSysinfo;
-	VAR res: LONGINT;  p: INTEGER;
+	VAR res: WORD;  p: INTEGER;
 		buf: ARRAY 4096 OF CHAR;
 		buf: ARRAY 4096 OF CHAR;
 
 
 		PROCEDURE copy( VAR p: INTEGER;  VAR dest: ARRAY OF CHAR );
 		PROCEDURE copy( VAR p: INTEGER;  VAR dest: ARRAY OF CHAR );
@@ -978,7 +978,7 @@ VAR
 
 
 
 
 	PROCEDURE {C} X11ErrorHandler(d: ADDRESS; err: ADDRESS): WORD;
 	PROCEDURE {C} X11ErrorHandler(d: ADDRESS; err: ADDRESS): WORD;
-	VAR res: LONGINT;
+	VAR res: WORD;
 	BEGIN
 	BEGIN
 		TRACE(d,err);
 		TRACE(d,err);
 		IF oberonXErrorHandler # NIL THEN
 		IF oberonXErrorHandler # NIL THEN
@@ -988,7 +988,7 @@ VAR
 	END X11ErrorHandler;
 	END X11ErrorHandler;
 
 
 	PROCEDURE X11IOErrorHandler(d: ADDRESS): WORD;
 	PROCEDURE X11IOErrorHandler(d: ADDRESS): WORD;
-	VAR res: LONGINT;
+	VAR res: WORD;
 	BEGIN
 	BEGIN
 		TRACE(d);
 		TRACE(d);
 		IF oberonXIOErrorHandler # NIL THEN
 		IF oberonXIOErrorHandler # NIL THEN

+ 5 - 5
source/Darwin.I386.Unix.Mod

@@ -695,7 +695,7 @@ VAR
 		me: Thread_t;
 		me: Thread_t;
 		old, new: Sigset;
 		old, new: Sigset;
 		param: Sched_param;
 		param: Sched_param;
-		res: LONGINT;
+		res: WORD;
 	BEGIN
 	BEGIN
 		me := pthread_self();
 		me := pthread_self();
 		SetSigaltstack();
 		SetSigaltstack();
@@ -727,7 +727,7 @@ VAR
 	VAR
 	VAR
 		attr: PThreadAttrType;
 		attr: PThreadAttrType;
 		id: Thread_t;
 		id: Thread_t;
-		res: LONGINT;
+		res: WORD;
 	BEGIN
 	BEGIN
 		pthread_attr_init( ADDRESSOF( attr ) );
 		pthread_attr_init( ADDRESSOF( attr ) );
 		pthread_attr_setscope( ADDRESSOF( attr ), PTHREAD_SCOPE_SYSTEM );
 		pthread_attr_setscope( ADDRESSOF( attr ), PTHREAD_SCOPE_SYSTEM );
@@ -889,7 +889,7 @@ VAR
 
 
 
 
 	PROCEDURE getSysinfo;
 	PROCEDURE getSysinfo;
-	VAR res: LONGINT;  p: INTEGER;
+	VAR res: WORD;  p: INTEGER;
 		buf: ARRAY 4096 OF CHAR;
 		buf: ARRAY 4096 OF CHAR;
 
 
 		PROCEDURE copy( VAR p: INTEGER;  VAR dest: ARRAY OF CHAR );
 		PROCEDURE copy( VAR p: INTEGER;  VAR dest: ARRAY OF CHAR );
@@ -983,7 +983,7 @@ VAR
 
 
 
 
 	PROCEDURE {C} X11ErrorHandler(d: ADDRESS; err: ADDRESS): WORD;
 	PROCEDURE {C} X11ErrorHandler(d: ADDRESS; err: ADDRESS): WORD;
-	VAR res: LONGINT;
+	VAR res: WORD;
 	BEGIN
 	BEGIN
 		TRACE(d,err);
 		TRACE(d,err);
 		IF oberonXErrorHandler # NIL THEN
 		IF oberonXErrorHandler # NIL THEN
@@ -993,7 +993,7 @@ VAR
 	END X11ErrorHandler;
 	END X11ErrorHandler;
 
 
 	PROCEDURE X11IOErrorHandler(d: ADDRESS): WORD;
 	PROCEDURE X11IOErrorHandler(d: ADDRESS): WORD;
-	VAR res: LONGINT;
+	VAR res: WORD;
 	BEGIN
 	BEGIN
 		TRACE(d);
 		TRACE(d);
 		IF oberonXIOErrorHandler # NIL THEN
 		IF oberonXIOErrorHandler # NIL THEN

+ 1 - 1
source/DataIO.Mod

@@ -26,7 +26,7 @@ TYPE
 		next: Card;
 		next: Card;
 
 
 		PROCEDURE Read( R: Reader );
 		PROCEDURE Read( R: Reader );
-		VAR res: LONGINT;
+		VAR res: WORD;
 			msg: ARRAY 64 OF CHAR;
 			msg: ARRAY 64 OF CHAR;
 			string: NbrStrings.String;  module: Modules.Module;  moduleName, typeName: Modules.Name;
 			string: NbrStrings.String;  module: Modules.Module;  moduleName, typeName: Modules.Name;
 		BEGIN
 		BEGIN

+ 1 - 1
source/DebugLog.Mod

@@ -364,7 +364,7 @@ END GetWriter;
 
 
 (* UNSAFE *)
 (* UNSAFE *)
 (** Send the specified characters to the trace output (cf. Streams.Sender). *)
 (** Send the specified characters to the trace output (cf. Streams.Sender). *)
-PROCEDURE Send*(CONST buf : ARRAY OF CHAR; ofs, len : LONGINT; propagate : BOOLEAN; VAR res : LONGINT);
+PROCEDURE Send*(CONST buf : ARRAY OF CHAR; ofs, len : LONGINT; propagate : BOOLEAN; VAR res : WORD);
 VAR i : LONGINT; str : POINTER TO ARRAY OF CHAR;
 VAR i : LONGINT; str : POINTER TO ARRAY OF CHAR;
 BEGIN
 BEGIN
 	NEW(str, len + 1);
 	NEW(str, len + 1);

+ 1 - 1
source/Decoder.Mod

@@ -1779,7 +1779,7 @@ TYPE
 		PROCEDURE DecodeModuleHandler(sender, data : ANY);
 		PROCEDURE DecodeModuleHandler(sender, data : ANY);
 		VAR moduleNameStr, msg : ARRAY 256 OF CHAR;
 		VAR moduleNameStr, msg : ARRAY 256 OF CHAR;
 			module : Modules.Module;
 			module : Modules.Module;
-			res : LONGINT;
+			res : WORD;
 			moduleInfoMemory : ModuleInfoMemory;
 			moduleInfoMemory : ModuleInfoMemory;
 			header: ObjHeader;
 			header: ObjHeader;
 		BEGIN
 		BEGIN

+ 4 - 4
source/DiskFS.Mod

@@ -638,7 +638,7 @@ TYPE
 			END
 			END
 		END Delete0;
 		END Delete0;
 
 
-		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: LONGINT);
+		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: WORD);
 		VAR adr, newAdr: DiskAdr; oldbuf, newbuf: FileName;  head: FileHeader;
 		VAR adr, newAdr: DiskAdr; oldbuf, newbuf: FileName;  head: FileHeader;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			Check(old, oldbuf, res);
 			Check(old, oldbuf, res);
@@ -672,7 +672,7 @@ TYPE
 		END Enumerate0;
 		END Enumerate0;
 
 
 		PROCEDURE FileKey*(name: ARRAY OF CHAR): LONGINT;
 		PROCEDURE FileKey*(name: ARRAY OF CHAR): LONGINT;
-			VAR res: LONGINT; namebuf: FileName; header: DiskAdr;
+			VAR res: WORD; namebuf: FileName; header: DiskAdr;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			header := 0;
 			header := 0;
 			Check(name, namebuf, res);
 			Check(name, namebuf, res);
@@ -1045,7 +1045,7 @@ TYPE
 			Files.JoinName(fs.prefix, SELF.name, name)
 			Files.JoinName(fs.prefix, SELF.name, name)
 		END GetName;
 		END GetName;
 
 
-		PROCEDURE Register0*(VAR res: LONGINT);
+		PROCEDURE Register0*(VAR res: WORD);
 		VAR oldAdr: DiskAdr; fs0: FileSystem;
 		VAR oldAdr: DiskAdr; fs0: FileSystem;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			Unbuffer(SELF);
 			Unbuffer(SELF);
@@ -1187,7 +1187,7 @@ END enumerate;
 
 
 (* Check a file name. *)
 (* Check a file name. *)
 
 
-PROCEDURE Check(VAR s: ARRAY OF CHAR; VAR name: FileName; VAR res: LONGINT);
+PROCEDURE Check(VAR s: ARRAY OF CHAR; VAR name: FileName; VAR res: WORD);
 VAR i, k: LONGINT; ch: CHAR;
 VAR i, k: LONGINT; ch: CHAR;
 BEGIN
 BEGIN
 	ch := s[0]; i := 0; k := 0;
 	ch := s[0]; i := 0; k := 0;

+ 1 - 1
source/DiskTests.Mod

@@ -388,7 +388,7 @@ BEGIN
 	END;
 	END;
 END TransferBlocks;
 END TransferBlocks;
 
 
-PROCEDURE ShowDiskres(res : LONGINT; out : Streams.Writer);
+PROCEDURE ShowDiskres(res : WORD; out : Streams.Writer);
 BEGIN
 BEGIN
 	IF res = Disks.Ok THEN out.String("Ok");
 	IF res = Disks.Ok THEN out.String("Ok");
 	ELSIF res = Disks.MediaChanged THEN out.String("MediaChanged");
 	ELSIF res = Disks.MediaChanged THEN out.String("MediaChanged");

+ 5 - 5
source/Diskettes.Mod

@@ -39,7 +39,7 @@ TYPE
 			size, sectors, heads, tracks: LONGINT;
 			size, sectors, heads, tracks: LONGINT;
 			gap, rate, spec1, spec2, fgap: CHAR;
 			gap, rate, spec1, spec2, fgap: CHAR;
 
 
-		PROCEDURE Transfer*(op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: LONGINT);
+		PROCEDURE Transfer*(op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: WORD);
 		BEGIN
 		BEGIN
 			Transfer1(SELF, op, start, num, buf, ofs, res);
 			Transfer1(SELF, op, start, num, buf, ofs, res);
 			IF Disks.Stats THEN
 			IF Disks.Stats THEN
@@ -66,7 +66,7 @@ TYPE
 			GetSize1(SELF, size, res)
 			GetSize1(SELF, size, res)
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Disks.Message;  VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Disks.Message;  VAR res: WORD);
 		BEGIN
 		BEGIN
 			Handle1(SELF, msg, res)
 			Handle1(SELF, msg, res)
 		END Handle;
 		END Handle;
@@ -402,7 +402,7 @@ BEGIN
 	IF dev.media = media THEN RETURN Ok ELSE RETURN Disks.MediaChanged END
 	IF dev.media = media THEN RETURN Ok ELSE RETURN Disks.MediaChanged END
 END Do;
 END Do;
 
 
-PROCEDURE Transfer0(d: Disks.Device;  op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: LONGINT);
+PROCEDURE Transfer0(d: Disks.Device;  op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: WORD);
 VAR dev: Device; sector, head, track, s, ofs0, n, max, start0, num0: LONGINT;
 VAR dev: Device; sector, head, track, s, ofs0, n, max, start0, num0: LONGINT;
 BEGIN
 BEGIN
 	dev := d(Device);
 	dev := d(Device);
@@ -435,7 +435,7 @@ BEGIN
 	END
 	END
 END Transfer0;
 END Transfer0;
 
 
-PROCEDURE Transfer1(d: Disks.Device;  op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: LONGINT);
+PROCEDURE Transfer1(d: Disks.Device;  op, start, num: LONGINT;  VAR buf: ARRAY OF CHAR;  ofs: LONGINT;  VAR res: WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	Transfer0(d, op, start, num, buf, ofs, res)
 	Transfer0(d, op, start, num, buf, ofs, res)
 END Transfer1;
 END Transfer1;
@@ -448,7 +448,7 @@ BEGIN {EXCLUSIVE}
 	IF res = Disks.Ok THEN size := dev.size ELSE size := 0 END
 	IF res = Disks.Ok THEN size := dev.size ELSE size := 0 END
 END GetSize1;
 END GetSize1;
 
 
-PROCEDURE Handle1(d: Disks.Device;  VAR msg: Disks.Message;  VAR res: LONGINT);
+PROCEDURE Handle1(d: Disks.Device;  VAR msg: Disks.Message;  VAR res: WORD);
 VAR dev: Device;  buf: ARRAY BS OF CHAR;
 VAR dev: Device;  buf: ARRAY BS OF CHAR;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	dev := d(Device);
 	dev := d(Device);

+ 5 - 5
source/Disks.Mod

@@ -60,7 +60,7 @@ TYPE
 			NnofReads*, NnofWrites*, NnofOthers*, (** operation count *)
 			NnofReads*, NnofWrites*, NnofOthers*, (** operation count *)
 			NnofErrors* : HUGEINT; (** read/write errors *)
 			NnofErrors* : HUGEINT; (** read/write errors *)
 
 
-		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: LONGINT);
+		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Unsupported
 			res := Unsupported
 		END Transfer;
 		END Transfer;
@@ -70,14 +70,14 @@ TYPE
 			res := Unsupported
 			res := Unsupported
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Message;  VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Message;  VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Unsupported
 			res := Unsupported
 		END Handle;
 		END Handle;
 
 
 		(** 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. *)
 		(** 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: LONGINT);
+		PROCEDURE Open*(VAR res: WORD);
 		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: LONGINT;
 		VAR lockMsg: LockMsg; unlockMsg: UnlockMsg; ignore: LONGINT;
 		BEGIN
 		BEGIN
 			res := Ok;
 			res := Ok;
@@ -96,7 +96,7 @@ TYPE
 
 
 		(** Close the device and decrement its open count. Unlock it if the open count has reached 0. *)
 		(** Close the device and decrement its open count. Unlock it if the open count has reached 0. *)
 
 
-		PROCEDURE Close*(VAR res: LONGINT);
+		PROCEDURE Close*(VAR res: WORD);
 		VAR unlockMsg: UnlockMsg;
 		VAR unlockMsg: UnlockMsg;
 		BEGIN
 		BEGIN
 			res := Ok; ASSERT(openCount > 0);
 			res := Ok; ASSERT(openCount > 0);
@@ -254,7 +254,7 @@ END ReadLogical;
 partition spanning the entire device, with type = 256. If the device has been opened before, do nothing and
 partition spanning the entire device, with type = 256. If the device has been opened before, do nothing and
 return DeviceInUse, otherwise return Ok. On any other error dev.table is set NIL. *)
 return DeviceInUse, otherwise return Ok. On any other error dev.table is set NIL. *)
 
 
-PROCEDURE UpdatePartitionTable*(dev: Device; VAR res: LONGINT);
+PROCEDURE UpdatePartitionTable*(dev: Device; VAR res: WORD);
 VAR p, t: PartitionTable; i, pn, tn, size: LONGINT; buf: DiskBlock; valid: BOOLEAN;
 VAR p, t: PartitionTable; i, pn, tn, size: LONGINT; buf: DiskBlock; valid: BOOLEAN;
 BEGIN
 BEGIN
 	IF dev.openCount = 0 THEN
 	IF dev.openCount = 0 THEN

+ 1 - 1
source/DisplayNull.Mod

@@ -34,7 +34,7 @@ TYPE
 	END Display;
 	END Display;
 
 
 PROCEDURE Install*;
 PROCEDURE Install*;
-VAR d: Display; res: LONGINT;
+VAR d: Display; res: WORD;
 BEGIN
 BEGIN
 	NEW(d); d.desc := "Null display driver";
 	NEW(d); d.desc := "Null display driver";
 	Displays.registry.Add(d, res);
 	Displays.registry.Add(d, res);

+ 1 - 1
source/DriverDatabase.Mod

@@ -225,7 +225,7 @@ END HasBeenExecuted;
 PROCEDURE LoadDriver(driver : Driver) : BOOLEAN;
 PROCEDURE LoadDriver(driver : Driver) : BOOLEAN;
 VAR
 VAR
 	commands : Strings.StringArray;
 	commands : Strings.StringArray;
-	flags : SET; msg : ARRAY 256 OF CHAR; res : LONGINT;
+	flags : SET; msg : ARRAY 256 OF CHAR; res : WORD;
 	i : LONGINT;
 	i : LONGINT;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	res := -1;
 	res := -1;

+ 2 - 2
source/EnsoniqSound.Mod

@@ -852,7 +852,7 @@ TYPE
 
 
 		PROCEDURE OpenPlayChannel*(VAR channel : SoundDevices.Channel;
 		PROCEDURE OpenPlayChannel*(VAR channel : SoundDevices.Channel;
 		samplingRate, samplingResolution, nofSubChannels, format : LONGINT;
 		samplingRate, samplingResolution, nofSubChannels, format : LONGINT;
-		VAR res : LONGINT);
+		VAR res : WORD);
 		VAR i, count : LONGINT;
 		VAR i, count : LONGINT;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			channel := NIL;
 			channel := NIL;
@@ -887,7 +887,7 @@ TYPE
 
 
 		PROCEDURE OpenRecordChannel*(VAR channel : SoundDevices.Channel;
 		PROCEDURE OpenRecordChannel*(VAR channel : SoundDevices.Channel;
 		samplingRate, samplingResolution, nofSubChannels, format : LONGINT;
 		samplingRate, samplingResolution, nofSubChannels, format : LONGINT;
-		VAR res: LONGINT);
+		VAR res: WORD);
 		VAR i : LONGINT;
 		VAR i : LONGINT;
 		BEGIN
 		BEGIN
 			channel := NIL;
 			channel := NIL;

+ 5 - 5
source/Errors.Mod

@@ -50,7 +50,7 @@ END GetErrorString;
 
 
 (** Get error message for the specified error number. If no message can be found, a generic error message is generated *)
 (** 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 : LONGINT) : ErrorMessage;
-VAR errorMessage : ErrorMessage; res : LONGINT;
+VAR errorMessage : ErrorMessage; res : WORD;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	res := -1;
 	res := -1;
 	Get(errorCode, errorMessage, res);
 	Get(errorCode, errorMessage, res);
@@ -93,7 +93,7 @@ BEGIN
 	INC(index);
 	INC(index);
 END Add;
 END Add;
 
 
-PROCEDURE Get(number : LONGINT; VAR errorMessage : ErrorMessage; VAR res : LONGINT);
+PROCEDURE Get(number : LONGINT; VAR errorMessage : ErrorMessage; VAR res : WORD);
 VAR i : LONGINT;
 VAR i : LONGINT;
 BEGIN
 BEGIN
 	IF (cache # NIL) THEN
 	IF (cache # NIL) THEN
@@ -108,7 +108,7 @@ BEGIN
 	END;
 	END;
 END Get;
 END Get;
 
 
-PROCEDURE ParseLine(reader : Streams.Reader; VAR errorMessage : ErrorMessage; VAR res : LONGINT);
+PROCEDURE ParseLine(reader : Streams.Reader; VAR errorMessage : ErrorMessage; VAR res : WORD);
 VAR line : ARRAY MaxLineLength OF CHAR;
 VAR line : ARRAY MaxLineLength OF CHAR;
 BEGIN
 BEGIN
 	IF reader.GetInteger(errorMessage.code, FALSE) THEN
 	IF reader.GetInteger(errorMessage.code, FALSE) THEN
@@ -121,7 +121,7 @@ BEGIN
 	res := reader.res;
 	res := reader.res;
 END ParseLine;
 END ParseLine;
 
 
-PROCEDURE ParseFile(CONST filename : Files.FileName; VAR res : LONGINT);
+PROCEDURE ParseFile(CONST filename : Files.FileName; VAR res : WORD);
 VAR file : Files.File; reader : Files.Reader; errorMessage : ErrorMessage; ch : CHAR;
 VAR file : Files.File; reader : Files.Reader; errorMessage : ErrorMessage; ch : CHAR;
 BEGIN
 BEGIN
 	file := Files.Old(filename);
 	file := Files.Old(filename);
@@ -152,7 +152,7 @@ END ParseFile;
 
 
 (**	Load and parse a error message file. *)
 (**	Load and parse a error message file. *)
 PROCEDURE Open*(context : Commands.Context); (** [filename] ~ *)
 PROCEDURE Open*(context : Commands.Context); (** [filename] ~ *)
-VAR filename : Files.FileName; res : LONGINT;
+VAR filename : Files.FileName; res : WORD;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	index := 0; cache := NIL;
 	index := 0; cache := NIL;
 	context.arg.SkipWhitespace; context.arg.String(filename);
 	context.arg.SkipWhitespace; context.arg.String(filename);

+ 3 - 3
source/EventsUtils.Mod

@@ -101,7 +101,7 @@ TYPE
 
 
 	END EventContainer;
 	END EventContainer;
 
 
-PROCEDURE LoadFromFile*(CONST filename : ARRAY OF CHAR; VAR events : EventContainer; VAR msg : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE LoadFromFile*(CONST filename : ARRAY OF CHAR; VAR events : EventContainer; VAR msg : ARRAY OF CHAR; VAR res : WORD);
 VAR file : Files.File; r : Files.Reader; event : Events.Event; nofEvents : LONGINT;
 VAR file : Files.File; r : Files.Reader; event : Events.Event; nofEvents : LONGINT;
 BEGIN
 BEGIN
 	file := Files.Old(filename);
 	file := Files.Old(filename);
@@ -131,7 +131,7 @@ BEGIN
 	END;
 	END;
 END LoadFromFile;
 END LoadFromFile;
 
 
-PROCEDURE StoreToFile*(CONST filename : ARRAY OF CHAR; events : EventContainer; VAR msg : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE StoreToFile*(CONST filename : ARRAY OF CHAR; events : EventContainer; VAR msg : ARRAY OF CHAR; VAR res : WORD);
 VAR
 VAR
 	file : Files.File; w : Files.Writer; wrapper : EventWrapper;
 	file : Files.File; w : Files.Writer; wrapper : EventWrapper;
 	nofEvents, lastCleared, i, idx : LONGINT; full : BOOLEAN;
 	nofEvents, lastCleared, i, idx : LONGINT; full : BOOLEAN;
@@ -172,7 +172,7 @@ BEGIN
 	w.Update;
 	w.Update;
 END ToStream;
 END ToStream;
 
 
-PROCEDURE FromStream*(r : Streams.Reader; VAR event : Events.Event; VAR msg : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE FromStream*(r : Streams.Reader; VAR event : Events.Event; VAR msg : ARRAY OF CHAR; VAR res : WORD);
 VAR dt : Dates.DateTime; str : Events.Message; ch : CHAR; class, subclass, code : LONGINT;
 VAR dt : Dates.DateTime; str : Events.Message; ch : CHAR; class, subclass, code : LONGINT;
 
 
 	PROCEDURE IsValid(value : LONGINT) : BOOLEAN;
 	PROCEDURE IsValid(value : LONGINT) : BOOLEAN;

+ 13 - 13
source/FATFiles.Mod

@@ -98,7 +98,7 @@ TYPE
 	FilePurger = OBJECT
 	FilePurger = OBJECT
 		VAR count: LONGINT;
 		VAR count: LONGINT;
 		PROCEDURE EnumFile(f: ANY; VAR cont: BOOLEAN);
 		PROCEDURE EnumFile(f: ANY; VAR cont: BOOLEAN);
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN ASSERT(~f(File).registered);
 		BEGIN ASSERT(~f(File).registered);
 			KernelLog.Enter;
 			KernelLog.Enter;
 			KernelLog.String(moduleName); KernelLog.String("purging anonymous file '"); KernelLog.String(f(File).long); KernelLog.String("'...");
 			KernelLog.String(moduleName); KernelLog.String("purging anonymous file '"); KernelLog.String(f(File).long); KernelLog.String("'...");
@@ -310,7 +310,7 @@ TYPE
 		END Delete0X;
 		END Delete0X;
 
 
 		(* Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
 		(* Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
-		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: LONGINT);
+		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: WORD);
 		VAR oldpath, oldname, newpath, newname: Filename; r: File; dir: Directory; s: SearchByName;
 		VAR oldpath, oldname, newpath, newname: Filename; r: File; dir: Directory; s: SearchByName;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			res := ErrInvalidFilename;
 			res := ErrInvalidFilename;
@@ -412,7 +412,7 @@ TYPE
 			RETURN key
 			RETURN key
 		END FileKey;
 		END FileKey;
 
 
-		PROCEDURE CreateDirectory0*(path: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE CreateDirectory0*(path: ARRAY OF CHAR; VAR res: WORD);
 		VAR f: File; d: Directory; i,j: LONGINT; name: Filename; lookup: BOOLEAN; s: SearchByName;
 		VAR f: File; d: Directory; i,j: LONGINT; name: Filename; lookup: BOOLEAN; s: SearchByName;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF (Files.ReadOnly IN vol.flags) THEN res := ErrReadOnly; RETURN END;
 			IF (Files.ReadOnly IN vol.flags) THEN res := ErrReadOnly; RETURN END;
@@ -497,7 +497,7 @@ TYPE
 			END
 			END
 		END RemoveDirectory0;
 		END RemoveDirectory0;
 
 
-		PROCEDURE QuickFormat*(volLabel: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE QuickFormat*(volLabel: ARRAY OF CHAR; VAR res: WORD);
 		VAR f: File; label: ARRAY 11 OF CHAR; i: LONGINT;
 		VAR f: File; label: ARRAY 11 OF CHAR; i: LONGINT;
 			clean: FileEnumerator; c: CHAR; dummy: BOOLEAN;
 			clean: FileEnumerator; c: CHAR; dummy: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
@@ -739,7 +739,7 @@ TYPE
 
 
 		(* Write logical cluster. Depending on buf.cluster, a new physical cluster may be allocated. cf. ReadBuffer *)
 		(* Write logical cluster. Depending on buf.cluster, a new physical cluster may be allocated. cf. ReadBuffer *)
 		PROCEDURE WriteBuffer(buffer: Buffer);
 		PROCEDURE WriteBuffer(buffer: Buffer);
-		VAR link: Address; res: LONGINT;
+		VAR link: Address; res: WORD;
 		BEGIN
 		BEGIN
 			IF (buffer.cluster < 2) THEN	(* allocate new cluster *)
 			IF (buffer.cluster < 2) THEN	(* allocate new cluster *)
 				IF (buffer.cluster = -EOC) THEN link := FATVolumes.FREE
 				IF (buffer.cluster = -EOC) THEN link := FATVolumes.FREE
@@ -913,7 +913,7 @@ TYPE
 
 
 		(* Register a file created with New in the directory, replacing the previous file in the directory with the same name.
 		(* Register a file created with New in the directory, replacing the previous file in the directory with the same name.
 			The file is automatically updated.  End users use Files.Register instead. *)
 			The file is automatically updated.  End users use Files.Register instead. *)
-		PROCEDURE Register0*(VAR res: LONGINT);
+		PROCEDURE Register0*(VAR res: WORD);
 		VAR dir: Directory; old: File; s: SearchByName;
 		VAR dir: Directory; old: File; s: SearchByName;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF ~registered THEN
 			IF ~registered THEN
@@ -963,7 +963,7 @@ TYPE
 			END
 			END
 		END UpdateX;
 		END UpdateX;
 
 
-		PROCEDURE DeleteClusterChain(VAR res: LONGINT);
+		PROCEDURE DeleteClusterChain(VAR res: WORD);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			UpdateX;
 			UpdateX;
 			fs.vol(FATVolumes.Volume).FreeClusterChain(cluster, res);
 			fs.vol(FATVolumes.Volume).FreeClusterChain(cluster, res);
@@ -1028,7 +1028,7 @@ TYPE
 	END;
 	END;
 
 
 	ResultParam = POINTER TO RECORD(Parameter)
 	ResultParam = POINTER TO RECORD(Parameter)
-		res: LONGINT
+		res: WORD
 	END;
 	END;
 
 
 	TailGenParam = POINTER TO RECORD(Parameter)
 	TailGenParam = POINTER TO RECORD(Parameter)
@@ -1516,7 +1516,7 @@ TYPE
 			IF ro THEN INCL(attr, faReadOnly) END
 			IF ro THEN INCL(attr, faReadOnly) END
 		END WriteFileHeaderX;
 		END WriteFileHeaderX;
 
 
-		PROCEDURE NewSubdirectory(name: ARRAY OF CHAR; VAR res: LONGINT): Directory;
+		PROCEDURE NewSubdirectory(name: ARRAY OF CHAR; VAR res: WORD): Directory;
 		VAR upName: Filename; dir: Directory; f: File; i, t, d, p: LONGINT; r: Files.Rider; entry: ARRAY 32 OF CHAR;
 		VAR upName: Filename; dir: Directory; f: File; i, t, d, p: LONGINT; r: Files.Rider; entry: ARRAY 32 OF CHAR;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF UTF8Strings.Valid(name) & ValidateName(name) THEN
 			IF UTF8Strings.Valid(name) & ValidateName(name) THEN
@@ -1579,7 +1579,7 @@ TYPE
 			END
 			END
 		END DeleteCallback;
 		END DeleteCallback;
 
 
-		PROCEDURE DeleteContents(VAR res: LONGINT);
+		PROCEDURE DeleteContents(VAR res: WORD);
 		VAR par: ResultParam; enum: FileEnumerator;
 		VAR par: ResultParam; enum: FileEnumerator;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			NEW(enum, cluster);
 			NEW(enum, cluster);
@@ -1673,7 +1673,7 @@ TYPE
 		END InitSize;
 		END InitSize;
 
 
 		PROCEDURE ReadBuffer(buffer: Buffer; pos: LONGINT);
 		PROCEDURE ReadBuffer(buffer: Buffer; pos: LONGINT);
-		VAR vol: FATVolumes.FAT1216Volume; res: LONGINT;
+		VAR vol: FATVolumes.FAT1216Volume; res: WORD;
 		BEGIN
 		BEGIN
 			vol := fs.vol(FATVolumes.FAT1216Volume);
 			vol := fs.vol(FATVolumes.FAT1216Volume);
 			IF (pos < 0) OR (pos >= vol.numRootSectors) THEN HALT(ErrInvalidParams) END;
 			IF (pos < 0) OR (pos >= vol.numRootSectors) THEN HALT(ErrInvalidParams) END;
@@ -1683,7 +1683,7 @@ TYPE
 		END ReadBuffer;
 		END ReadBuffer;
 
 
 		PROCEDURE WriteBuffer(buffer: Buffer);
 		PROCEDURE WriteBuffer(buffer: Buffer);
-		VAR vol: FATVolumes.FAT1216Volume; res: LONGINT;
+		VAR vol: FATVolumes.FAT1216Volume; res: WORD;
 		BEGIN
 		BEGIN
 			vol := fs.vol(FATVolumes.FAT1216Volume);
 			vol := fs.vol(FATVolumes.FAT1216Volume);
 			IF (buffer.cluster < 0) OR (buffer.cluster >= vol.numRootSectors) THEN HALT(ErrInvalidParams) END;
 			IF (buffer.cluster < 0) OR (buffer.cluster >= vol.numRootSectors) THEN HALT(ErrInvalidParams) END;
@@ -1723,7 +1723,7 @@ BEGIN
 END NewFS;
 END NewFS;
 
 
 PROCEDURE PurgeFile(f: ANY);
 PROCEDURE PurgeFile(f: ANY);
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN
 BEGIN
 	WITH f: File DO
 	WITH f: File DO
 		IF ~f.registered & (f.cluster # NotAssigned) THEN
 		IF ~f.registered & (f.cluster # NotAssigned) THEN

+ 6 - 6
source/FATScavenger.Mod

@@ -735,7 +735,7 @@ TYPE
 			collision : BOOLEAN;
 			collision : BOOLEAN;
 			vdf, clnShutdown, ioError : SET; (* Volume dirty flags (FAT16/32) *)
 			vdf, clnShutdown, ioError : SET; (* Volume dirty flags (FAT16/32) *)
 			bpb : Block;
 			bpb : Block;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			IF Trace THEN KernelLog.String("FATScavenger started on "); END;
 			IF Trace THEN KernelLog.String("FATScavenger started on "); END;
 			SetStatus(state.status, "Scavenger starting...", 0, 0, 0, FALSE);
 			SetStatus(state.status, "Scavenger starting...", 0, 0, 0, FALSE);
@@ -918,7 +918,7 @@ TYPE
 		PROCEDURE GetFSInfo(VAR freeCount, nextFree : LONGINT) : BOOLEAN;
 		PROCEDURE GetFSInfo(VAR freeCount, nextFree : LONGINT) : BOOLEAN;
 		VAR
 		VAR
 			bootsector : ARRAY FATVolumes.BS OF CHAR;
 			bootsector : ARRAY FATVolumes.BS OF CHAR;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			(* load the boot sector to get address of FSinfo block *)
 			(* load the boot sector to get address of FSinfo block *)
 			dev.Transfer(Disks.Read, vol.start, 1, bootsector, 0, res);
 			dev.Transfer(Disks.Read, vol.start, 1, bootsector, 0, res);
@@ -958,7 +958,7 @@ TYPE
 		END GetFSInfo;
 		END GetFSInfo;
 
 
 		PROCEDURE SetFSInfo(freeCount, nextFree : LONGINT);
 		PROCEDURE SetFSInfo(freeCount, nextFree : LONGINT);
-		VAR res : LONGINT;
+		VAR res : WORD;
 		BEGIN
 		BEGIN
 			IF fsInfoLoaded THEN
 			IF fsInfoLoaded THEN
 				FATVolumes.PutLongint(fsinfo, 488, freeCount); (* - deleted + created *)
 				FATVolumes.PutLongint(fsinfo, 488, freeCount); (* - deleted + created *)
@@ -1123,7 +1123,7 @@ TYPE
 			newBadClusters, cluster, link : LONGINT;
 			newBadClusters, cluster, link : LONGINT;
 			operation, string, temp : String;
 			operation, string, temp : String;
 			address : Files.Address;
 			address : Files.Address;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			NEW(data,vol.clusterSize);
 			NEW(data,vol.clusterSize);
 			IF Trace THEN KernelLog.String("Surface scan started..."); END;
 			IF Trace THEN KernelLog.String("Surface scan started..."); END;
@@ -1469,7 +1469,7 @@ TYPE
 			entry : Entry; shortEntry : ShortEntry;
 			entry : Entry; shortEntry : ShortEntry;
 			dirFragments, dirClusters : LONGINT;
 			dirFragments, dirClusters : LONGINT;
 			collision : BOOLEAN;
 			collision : BOOLEAN;
-			res : LONGINT;
+			res : WORD;
 		BEGIN
 		BEGIN
 			IF Trace THEN KernelLog.String("Scanning FAT directory structure... "); END;
 			IF Trace THEN KernelLog.String("Scanning FAT directory structure... "); END;
 			INC(curOp); operation := GetString(curOp, maxOp, "", "Scanning FAT directory: ");
 			INC(curOp); operation := GetString(curOp, maxOp, "", "Scanning FAT directory: ");
@@ -1854,7 +1854,7 @@ TYPE
 		VAR
 		VAR
 			buf : POINTER TO ARRAY OF CHAR;
 			buf : POINTER TO ARRAY OF CHAR;
 			ofs, num : LONGINT;
 			ofs, num : LONGINT;
-			res : LONGINT;
+			res : WORD;
 			temp: ARRAY 256 OF CHAR;
 			temp: ARRAY 256 OF CHAR;
 		BEGIN
 		BEGIN
 			ASSERT(from < to);
 			ASSERT(from < to);

+ 21 - 21
source/FATVolumes.Mod

@@ -218,11 +218,11 @@ TYPE
 		END FlushCache;
 		END FlushCache;
 
 
 		(** ReadSector: reads a sector from the FAT area. Use ReadCluster to read a data cluster *)
 		(** ReadSector: reads a sector from the FAT area. Use ReadCluster to read a data cluster *)
-		PROCEDURE ReadSector*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE ReadSector*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN {EXCLUSIVE} ReadSectorX(adr, data, 0, res)
 		BEGIN {EXCLUSIVE} ReadSectorX(adr, data, 0, res)
 		END ReadSector;
 		END ReadSector;
 
 
-		PROCEDURE ReadSectorX(adr: Address; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: LONGINT);
+		PROCEDURE ReadSectorX(adr: Address; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: WORD);
 		VAR block, idx: LONGINT;
 		VAR block, idx: LONGINT;
 		BEGIN
 		BEGIN
 			INC(NreadSector);
 			INC(NreadSector);
@@ -245,11 +245,11 @@ TYPE
 		END ReadSectorX;
 		END ReadSectorX;
 
 
 		(** WriteSector: writes a sector to the FAT area. Use WriteCluster to write a data cluster *)
 		(** WriteSector: writes a sector to the FAT area. Use WriteCluster to write a data cluster *)
-		PROCEDURE WriteSector*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE WriteSector*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN {EXCLUSIVE} WriteSectorX(adr, data, 0, res)
 		BEGIN {EXCLUSIVE} WriteSectorX(adr, data, 0, res)
 		END WriteSector;
 		END WriteSector;
 
 
-		PROCEDURE WriteSectorX(adr: Address; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: LONGINT);
+		PROCEDURE WriteSectorX(adr: Address; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: WORD);
 		VAR block, idx: LONGINT;
 		VAR block, idx: LONGINT;
 		BEGIN
 		BEGIN
 			INC(NwriteSector);
 			INC(NwriteSector);
@@ -280,20 +280,20 @@ TYPE
 		BEGIN HALT(301) (* abstract *)
 		BEGIN HALT(301) (* abstract *)
 		END ReadFATEntryX;
 		END ReadFATEntryX;
 
 
-		PROCEDURE WriteFATEntry*(adr, link: Address; VAR res: LONGINT);
+		PROCEDURE WriteFATEntry*(adr, link: Address; VAR res: WORD);
 		BEGIN {EXCLUSIVE} WriteFATEntryX(adr, link, res)
 		BEGIN {EXCLUSIVE} WriteFATEntryX(adr, link, res)
 		END WriteFATEntry;
 		END WriteFATEntry;
 
 
-		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: LONGINT);
+		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: WORD);
 		BEGIN HALT(301) (* abstract *)
 		BEGIN HALT(301) (* abstract *)
 		END WriteFATEntryX;
 		END WriteFATEntryX;
 
 
 		(** ReadCluster: reads a cluster from the data area. Use ReadSector to read a sector from the FAT area *)
 		(** ReadCluster: reads a cluster from the data area. Use ReadSector to read a sector from the FAT area *)
-		PROCEDURE ReadCluster*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE ReadCluster*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN {EXCLUSIVE} ReadClusterX(adr, data, res)
 		BEGIN {EXCLUSIVE} ReadClusterX(adr, data, res)
 		END ReadCluster;
 		END ReadCluster;
 
 
-		PROCEDURE ReadClusterX(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE ReadClusterX(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		VAR block, idx: LONGINT;
 		VAR block, idx: LONGINT;
 		BEGIN
 		BEGIN
 			INC(NreadCluster);
 			INC(NreadCluster);
@@ -316,11 +316,11 @@ TYPE
 		END ReadClusterX;
 		END ReadClusterX;
 
 
 		(** WriteCluster: writes a cluster to the data area. Use WriteSector to write a sector to the FAT area *)
 		(** WriteCluster: writes a cluster to the data area. Use WriteSector to write a sector to the FAT area *)
-		PROCEDURE WriteCluster*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE WriteCluster*(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN {EXCLUSIVE} WriteClusterX(adr, data, res)
 		BEGIN {EXCLUSIVE} WriteClusterX(adr, data, res)
 		END WriteCluster;
 		END WriteCluster;
 
 
-		PROCEDURE WriteClusterX(adr: Address; VAR data: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE WriteClusterX(adr: Address; VAR data: ARRAY OF CHAR; VAR res: WORD);
 		VAR block, idx: LONGINT;
 		VAR block, idx: LONGINT;
 		BEGIN
 		BEGIN
 			INC(NwriteCluster);
 			INC(NwriteCluster);
@@ -343,7 +343,7 @@ TYPE
 			ioError := ioError OR (res # Ok)
 			ioError := ioError OR (res # Ok)
 		END WriteClusterX;
 		END WriteClusterX;
 
 
-		PROCEDURE AllocCluster*(link: Address; VAR res: LONGINT): Address;
+		PROCEDURE AllocCluster*(link: Address; VAR res: WORD): Address;
 		VAR c, cnt, entry: Address;
 		VAR c, cnt, entry: Address;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			INC(NallocCluster);
 			INC(NallocCluster);
@@ -374,7 +374,7 @@ TYPE
 			RETURN BAD
 			RETURN BAD
 		END AllocCluster;
 		END AllocCluster;
 
 
-		PROCEDURE FreeClusterChain*(cluster: Address; VAR res: LONGINT);
+		PROCEDURE FreeClusterChain*(cluster: Address; VAR res: WORD);
 		VAR c, new: Address;
 		VAR c, new: Address;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			c := cluster; res := Ok;
 			c := cluster; res := Ok;
@@ -508,7 +508,7 @@ TYPE
 			RETURN entry
 			RETURN entry
 		END ReadFATEntryX;
 		END ReadFATEntryX;
 
 
-		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: LONGINT);
+		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: WORD);
 		VAR offset, entry: Address; i: LONGINT;
 		VAR offset, entry: Address; i: LONGINT;
 			data: ARRAY 2*BS OF CHAR;
 			data: ARRAY 2*BS OF CHAR;
 		BEGIN
 		BEGIN
@@ -564,7 +564,7 @@ CONST
 TYPE
 TYPE
 	FAT16Volume* = OBJECT(FAT1216Volume)
 	FAT16Volume* = OBJECT(FAT1216Volume)
 		PROCEDURE Initialize(VAR bpb: BPB; MaxClusters: LONGINT): BOOLEAN;
 		PROCEDURE Initialize(VAR bpb: BPB; MaxClusters: LONGINT): BOOLEAN;
-		VAR vcf: SET; res: LONGINT;
+		VAR vcf: SET; res: WORD;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF Initialize^(bpb, MaxClusters) THEN	(* see note in Volumes.Initialize *)
 			IF Initialize^(bpb, MaxClusters) THEN	(* see note in Volumes.Initialize *)
 				unsafe := TRUE; vcf := SYSTEM.VAL(SET, ReadFATEntryX(1));
 				unsafe := TRUE; vcf := SYSTEM.VAL(SET, ReadFATEntryX(1));
@@ -587,7 +587,7 @@ TYPE
 		END Initialize;
 		END Initialize;
 
 
 		PROCEDURE Finalize*;
 		PROCEDURE Finalize*;
-		VAR vcf: SET; res: LONGINT;
+		VAR vcf: SET; res: WORD;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF ~(Files.ReadOnly IN flags) THEN
 			IF ~(Files.ReadOnly IN flags) THEN
 				unsafe := TRUE; vcf := SYSTEM.VAL(SET, ReadFATEntryX(1));
 				unsafe := TRUE; vcf := SYSTEM.VAL(SET, ReadFATEntryX(1));
@@ -600,7 +600,7 @@ TYPE
 
 
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
 		VAR offset, entry: Address;
 		VAR offset, entry: Address;
-			res: LONGINT;
+			res: WORD;
 			data: ARRAY BS OF CHAR;
 			data: ARRAY BS OF CHAR;
 		BEGIN
 		BEGIN
 			INC(NreadFAT);
 			INC(NreadFAT);
@@ -623,7 +623,7 @@ TYPE
 			RETURN entry
 			RETURN entry
 		END ReadFATEntryX;
 		END ReadFATEntryX;
 
 
-		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: LONGINT);
+		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: WORD);
 		VAR offset: Address; i: LONGINT;
 		VAR offset: Address; i: LONGINT;
 			data: ARRAY BS OF CHAR;
 			data: ARRAY BS OF CHAR;
 		BEGIN
 		BEGIN
@@ -731,7 +731,7 @@ TYPE
 		END Initialize;
 		END Initialize;
 
 
 		PROCEDURE Finalize*;
 		PROCEDURE Finalize*;
-		VAR vcf: SET; res: LONGINT; info: ARRAY BS OF CHAR;
+		VAR vcf: SET; res: WORD; info: ARRAY BS OF CHAR;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF ~(Files.ReadOnly IN flags) THEN
 			IF ~(Files.ReadOnly IN flags) THEN
 				dev.Transfer(Disks.Read, start + fsInfo, 1, info, 0, res);
 				dev.Transfer(Disks.Read, start + fsInfo, 1, info, 0, res);
@@ -754,7 +754,7 @@ TYPE
 		END Finalize;
 		END Finalize;
 
 
 		PROCEDURE InitRoot;
 		PROCEDURE InitRoot;
-		VAR cluster: POINTER TO ARRAY OF CHAR; res: LONGINT;
+		VAR cluster: POINTER TO ARRAY OF CHAR; res: WORD;
 		BEGIN
 		BEGIN
 			NEW(cluster,clusterSize);
 			NEW(cluster,clusterSize);
 			WriteFATEntryX(rootCluster, EOC, res); (* ignore res *)
 			WriteFATEntryX(rootCluster, EOC, res); (* ignore res *)
@@ -762,7 +762,7 @@ TYPE
 		END InitRoot;
 		END InitRoot;
 
 
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
 		PROCEDURE ReadFATEntryX(adr: Address): Address;
-		VAR offset, entry: Address; res: LONGINT; data: ARRAY BS OF CHAR;
+		VAR offset, entry: Address; res: WORD; data: ARRAY BS OF CHAR;
 		BEGIN
 		BEGIN
 			INC(NreadFAT);
 			INC(NreadFAT);
 			IF ~unsafe & ((adr < 2) OR (adr > maxClusters+1)) THEN HALT(ErrInvalidParams) END;
 			IF ~unsafe & ((adr < 2) OR (adr > maxClusters+1)) THEN HALT(ErrInvalidParams) END;
@@ -784,7 +784,7 @@ TYPE
 			RETURN entry
 			RETURN entry
 		END ReadFATEntryX;
 		END ReadFATEntryX;
 
 
-		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: LONGINT);
+		PROCEDURE WriteFATEntryX(adr, link: Address; VAR res: WORD);
 		VAR offset: Address; i: LONGINT; data: ARRAY BS OF CHAR;
 		VAR offset: Address; i: LONGINT; data: ARRAY BS OF CHAR;
 		BEGIN
 		BEGIN
 			INC(NwriteFAT);
 			INC(NwriteFAT);

+ 5 - 5
source/FSTools.Mod

@@ -105,7 +105,7 @@ END ExpandAlias;
 PROCEDURE GetFileSystemFactory(CONST name : ARRAY OF CHAR; error : Streams.Writer) : Files.FileSystemFactory;
 PROCEDURE GetFileSystemFactory(CONST name : ARRAY OF CHAR; error : Streams.Writer) : Files.FileSystemFactory;
 VAR
 VAR
 	factory : Files.FileSystemFactory;
 	factory : Files.FileSystemFactory;
-	moduleName, procedureName : Modules.Name; msg : ARRAY 128 OF CHAR; res : LONGINT;
+	moduleName, procedureName : Modules.Name; msg : ARRAY 128 OF CHAR; res : WORD;
 BEGIN
 BEGIN
 	factory := NIL;
 	factory := NIL;
 	Commands.Split(name, moduleName, procedureName, res, msg);
 	Commands.Split(name, moduleName, procedureName, res, msg);
@@ -399,7 +399,7 @@ VAR
 	enum : Files.Enumerator;
 	enum : Files.Enumerator;
 	enumContext : Commands.Context;
 	enumContext : Commands.Context;
 	arg : Streams.StringReader;
 	arg : Streams.StringReader;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);
 	options.Add("s", "subdirectories", Options.Flag);
 	options.Add("s", "subdirectories", Options.Flag);
@@ -692,7 +692,7 @@ BEGIN
 END RenameFiles;
 END RenameFiles;
 
 
 PROCEDURE CreateDirectory*(context : Commands.Context); (* path ~ *)
 PROCEDURE CreateDirectory*(context : Commands.Context); (* path ~ *)
-VAR path : Files.FileName; res : LONGINT;
+VAR path : Files.FileName; res : WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(path) THEN
 	IF context.arg.GetString(path) THEN
 		Files.CreateDirectory(path, res);
 		Files.CreateDirectory(path, res);
@@ -706,7 +706,7 @@ BEGIN
 END CreateDirectory;
 END CreateDirectory;
 
 
 PROCEDURE DeleteDirectory*(context : Commands.Context); (* path ~ *)
 PROCEDURE DeleteDirectory*(context : Commands.Context); (* path ~ *)
-VAR path : Files.FileName; res : LONGINT;
+VAR path : Files.FileName; res : WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(path) THEN
 	IF context.arg.GetString(path) THEN
 		Files.RemoveDirectory(path, FALSE, res);
 		Files.RemoveDirectory(path, FALSE, res);
@@ -1084,7 +1084,7 @@ BEGIN
 	out.String("FSTools: Pattern matching is disabled in SAFE mode. Press FSTools.Unsafe ~ to enable pattern matching."); out.Ln;
 	out.String("FSTools: Pattern matching is disabled in SAFE mode. Press FSTools.Unsafe ~ to enable pattern matching."); out.Ln;
 END ShowUnsafeMessage;
 END ShowUnsafeMessage;
 
 
-PROCEDURE ShowRes(out : Streams.Writer; res : LONGINT);
+PROCEDURE ShowRes(out : Streams.Writer; res : WORD);
 BEGIN
 BEGIN
 	out.String("(");
 	out.String("(");
 	CASE res OF
 	CASE res OF

+ 5 - 5
source/FSTools64.Mod

@@ -105,7 +105,7 @@ END ExpandAlias;
 PROCEDURE GetFileSystemFactory(CONST name : ARRAY OF CHAR; error : Streams.Writer) : Files.FileSystemFactory;
 PROCEDURE GetFileSystemFactory(CONST name : ARRAY OF CHAR; error : Streams.Writer) : Files.FileSystemFactory;
 VAR
 VAR
 	factory : Files.FileSystemFactory;
 	factory : Files.FileSystemFactory;
-	moduleName, procedureName : Modules.Name; msg : ARRAY 128 OF CHAR; res : LONGINT;
+	moduleName, procedureName : Modules.Name; msg : ARRAY 128 OF CHAR; res : WORD;
 BEGIN
 BEGIN
 	factory := NIL;
 	factory := NIL;
 	Commands.Split(name, moduleName, procedureName, res, msg);
 	Commands.Split(name, moduleName, procedureName, res, msg);
@@ -399,7 +399,7 @@ VAR
 	enum : Files.Enumerator;
 	enum : Files.Enumerator;
 	enumContext : Commands.Context;
 	enumContext : Commands.Context;
 	arg : Streams.StringReader;
 	arg : Streams.StringReader;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	NEW(options);
 	NEW(options);
 	options.Add("s", "subdirectories", Options.Flag);
 	options.Add("s", "subdirectories", Options.Flag);
@@ -692,7 +692,7 @@ BEGIN
 END RenameFiles;
 END RenameFiles;
 
 
 PROCEDURE CreateDirectory*(context : Commands.Context); (* path ~ *)
 PROCEDURE CreateDirectory*(context : Commands.Context); (* path ~ *)
-VAR path : Files.FileName; res : LONGINT;
+VAR path : Files.FileName; res : WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(path) THEN
 	IF context.arg.GetString(path) THEN
 		Files.CreateDirectory(path, res);
 		Files.CreateDirectory(path, res);
@@ -706,7 +706,7 @@ BEGIN
 END CreateDirectory;
 END CreateDirectory;
 
 
 PROCEDURE DeleteDirectory*(context : Commands.Context); (* path ~ *)
 PROCEDURE DeleteDirectory*(context : Commands.Context); (* path ~ *)
-VAR path : Files.FileName; res : LONGINT;
+VAR path : Files.FileName; res : WORD;
 BEGIN
 BEGIN
 	IF context.arg.GetString(path) THEN
 	IF context.arg.GetString(path) THEN
 		Files.RemoveDirectory(path, FALSE, res);
 		Files.RemoveDirectory(path, FALSE, res);
@@ -1084,7 +1084,7 @@ BEGIN
 	out.String("FSTools64: Pattern matching is disabled in SAFE mode. Press FSTools64.Unsafe ~ to enable pattern matching."); out.Ln;
 	out.String("FSTools64: Pattern matching is disabled in SAFE mode. Press FSTools64.Unsafe ~ to enable pattern matching."); out.Ln;
 END ShowUnsafeMessage;
 END ShowUnsafeMessage;
 
 
-PROCEDURE ShowRes(out : Streams.Writer; res : LONGINT);
+PROCEDURE ShowRes(out : Streams.Writer; res : WORD);
 BEGIN
 BEGIN
 	out.String("(");
 	out.String("(");
 	CASE res OF
 	CASE res OF

+ 10 - 10
source/FTP.Mod

@@ -10,7 +10,7 @@ CONST
 
 
 VAR ftp : FTPClient.FTPClient;
 VAR ftp : FTPClient.FTPClient;
 
 
-PROCEDURE PutFile(ftp : FTPClient.FTPClient; local, remote : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE PutFile(ftp : FTPClient.FTPClient; local, remote : ARRAY OF CHAR; VAR res : WORD);
 VAR buf: ARRAY BufSize OF CHAR; len: LONGINT;
 VAR buf: ARRAY BufSize OF CHAR; len: LONGINT;
 	f : Files.File; r : Files.Reader;
 	f : Files.File; r : Files.Reader;
 	w : Streams.Writer;
 	w : Streams.Writer;
@@ -29,7 +29,7 @@ BEGIN
 	END;
 	END;
 END PutFile;
 END PutFile;
 
 
-PROCEDURE PutText(ftp : FTPClient.FTPClient; local, remote : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE PutText(ftp : FTPClient.FTPClient; local, remote : ARRAY OF CHAR; VAR res : WORD);
 VAR w : Streams.Writer;
 VAR w : Streams.Writer;
         text: Texts.Text;
         text: Texts.Text;
         r: Texts.TextReader;
         r: Texts.TextReader;
@@ -53,7 +53,7 @@ BEGIN
 	text.ReleaseRead
 	text.ReleaseRead
 END PutText;
 END PutText;
 
 
-PROCEDURE GetFile(ftp : FTPClient.FTPClient; remote, local : ARRAY OF CHAR; VAR res : LONGINT);
+PROCEDURE GetFile(ftp : FTPClient.FTPClient; remote, local : ARRAY OF CHAR; VAR res : WORD);
 VAR buf: ARRAY BufSize OF CHAR; len: LONGINT;
 VAR buf: ARRAY BufSize OF CHAR; len: LONGINT;
 	f : Files.File; w : Files.Writer;
 	f : Files.File; w : Files.Writer;
 	r : Streams.Reader;
 	r : Streams.Reader;
@@ -76,7 +76,7 @@ END GetFile;
 PROCEDURE  Open*(context : Commands.Context);
 PROCEDURE  Open*(context : Commands.Context);
 VAR
 VAR
 	host, user, password : ARRAY 256 OF CHAR;
 	host, user, password : ARRAY 256 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp # NIL THEN
 	IF ftp # NIL THEN
 		context.out.String("Already open"); context.out.Ln;
 		context.out.String("Already open"); context.out.Ln;
@@ -107,7 +107,7 @@ PROCEDURE PutFiles*(context : Commands.Context);
 VAR
 VAR
 	local, path, remote : ARRAY 256 OF CHAR;
 	local, path, remote : ARRAY 256 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not connected"); context.out.Ln;
 		context.out.String("not connected"); context.out.Ln;
@@ -141,7 +141,7 @@ PROCEDURE PutTexts*(context : Commands.Context);
 VAR
 VAR
 	local, path, remote : ARRAY 256 OF CHAR;
 	local, path, remote : ARRAY 256 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not connected"); context.out.Ln;
 		context.out.String("not connected"); context.out.Ln;
@@ -174,7 +174,7 @@ PROCEDURE GetFiles*(context : Commands.Context);
 VAR
 VAR
 	local, remote : ARRAY 256 OF CHAR;
 	local, remote : ARRAY 256 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
 	tok : ARRAY 8 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not connected"); context.out.Ln;
 		context.out.String("not connected"); context.out.Ln;
@@ -206,7 +206,7 @@ END GetFiles;
 PROCEDURE MakeDir*(context : Commands.Context);
 PROCEDURE MakeDir*(context : Commands.Context);
 VAR
 VAR
 	path : ARRAY 256 OF CHAR;
 	path : ARRAY 256 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not open"); context.out.Ln;
 		context.out.String("not open"); context.out.Ln;
@@ -223,7 +223,7 @@ END MakeDir;
 PROCEDURE ChangeDir*(context : Commands.Context);
 PROCEDURE ChangeDir*(context : Commands.Context);
 VAR
 VAR
 	path : ARRAY 256 OF CHAR;
 	path : ARRAY 256 OF CHAR;
-	res : LONGINT;
+	res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not open"); context.out.Ln;
 		context.out.String("not open"); context.out.Ln;
@@ -253,7 +253,7 @@ BEGIN
 END Directory;
 END Directory;
 
 
 PROCEDURE Close*(context : Commands.Context);
 PROCEDURE Close*(context : Commands.Context);
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	IF ftp = NIL THEN
 	IF ftp = NIL THEN
 		context.out.String("not connected"); context.out.Ln;
 		context.out.String("not connected"); context.out.Ln;

+ 17 - 17
source/FTPClient.Mod

@@ -58,7 +58,7 @@ TYPE
 		END Init;
 		END Init;
 
 
 
 
-		PROCEDURE Open*(CONST host, user, password : ARRAY OF CHAR; port : LONGINT; VAR res : LONGINT);
+		PROCEDURE Open*(CONST host, user, password : ARRAY OF CHAR; port : LONGINT; VAR res : WORD);
 		VAR fadr : IP.Adr;
 		VAR fadr : IP.Adr;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			res := 0;
 			res := 0;
@@ -125,7 +125,7 @@ TYPE
 			END;
 			END;
 		END ReadResponse;
 		END ReadResponse;
 
 
-		PROCEDURE Close*(VAR res : LONGINT);
+		PROCEDURE Close*(VAR res : WORD);
 		BEGIN
 		BEGIN
 			w.String("QUIT"); w.Ln; w.Update;
 			w.String("QUIT"); w.Ln; w.Update;
 			ReadResponse(code, msg);
 			ReadResponse(code, msg);
@@ -147,7 +147,7 @@ TYPE
 			RETURN (ch >= '0') & (ch <='9')
 			RETURN (ch >= '0') & (ch <='9')
 		END IsNum;
 		END IsNum;
 
 
-		PROCEDURE GetDataConnection( VAR res : LONGINT);
+		PROCEDURE GetDataConnection( VAR res : WORD);
 		VAR ch : CHAR; i, j : LONGINT; ipstr : ARRAY 16 OF CHAR; p0, p1, port : LONGINT;
 		VAR ch : CHAR; i, j : LONGINT; ipstr : ARRAY 16 OF CHAR; p0, p1, port : LONGINT;
 			str : ARRAY 32 OF CHAR;
 			str : ARRAY 32 OF CHAR;
 
 
@@ -235,7 +235,7 @@ TYPE
 			END
 			END
 		END WaitEstablished;
 		END WaitEstablished;
 
 
-		PROCEDURE OpenDataConnection(VAR connection : TCP.Connection; VAR res : LONGINT);
+		PROCEDURE OpenDataConnection(VAR connection : TCP.Connection; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF passiveTransfer THEN
 			IF passiveTransfer THEN
 				NEW(connection); connection.Open(TCP.NilPort, dataIP, dataPort, res)
 				NEW(connection); connection.Open(TCP.NilPort, dataIP, dataPort, res)
@@ -256,7 +256,7 @@ TYPE
 			END
 			END
 		END OpenDataConnection;
 		END OpenDataConnection;
 
 
-		PROCEDURE OpenPut*(CONST remoteName : ARRAY OF CHAR; VAR outw : Streams.Writer; VAR res : LONGINT);
+		PROCEDURE OpenPut*(CONST remoteName : ARRAY OF CHAR; VAR outw : Streams.Writer; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			GetDataConnection(res);
 			GetDataConnection(res);
@@ -281,7 +281,7 @@ TYPE
 			END
 			END
 		END OpenPut;
 		END OpenPut;
 
 
-		PROCEDURE ClosePut*(VAR res : LONGINT);
+		PROCEDURE ClosePut*(VAR res : WORD);
 		BEGIN
 		BEGIN
 			busy := FALSE;
 			busy := FALSE;
 			IF dataCon # NIL THEN
 			IF dataCon # NIL THEN
@@ -297,7 +297,7 @@ TYPE
 			END
 			END
 		END ClosePut;
 		END ClosePut;
 
 
-		PROCEDURE OpenGet*(CONST remoteName : ARRAY OF CHAR; VAR r : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE OpenGet*(CONST remoteName : ARRAY OF CHAR; VAR r : Streams.Reader; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			busy := TRUE;
 			busy := TRUE;
@@ -322,7 +322,7 @@ TYPE
 			END
 			END
 		END OpenGet;
 		END OpenGet;
 
 
-		PROCEDURE CloseGet*(VAR res : LONGINT);
+		PROCEDURE CloseGet*(VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF dataCon # NIL THEN
 			IF dataCon # NIL THEN
 				dataCon.Close;
 				dataCon.Close;
@@ -338,7 +338,7 @@ TYPE
 			END
 			END
 		END CloseGet;
 		END CloseGet;
 
 
-		PROCEDURE DeleteFile*(CONST remoteName : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE DeleteFile*(CONST remoteName : ARRAY OF CHAR; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			w.String("DELE "); w.String(remoteName); w.Ln; w.Update;
 			w.String("DELE "); w.String(remoteName); w.Ln; w.Update;
@@ -346,7 +346,7 @@ TYPE
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 		END DeleteFile;
 		END DeleteFile;
 
 
-		PROCEDURE ChangeDir*(CONST dir : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE ChangeDir*(CONST dir : ARRAY OF CHAR; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			w.String("CWD "); w.String(dir); w.Ln; w.Update;
 			w.String("CWD "); w.String(dir); w.Ln; w.Update;
@@ -354,7 +354,7 @@ TYPE
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 		END ChangeDir;
 		END ChangeDir;
 
 
-		PROCEDURE MakeDir*(CONST dir : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE MakeDir*(CONST dir : ARRAY OF CHAR; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			w.String("MKD "); w.String(dir); w.Ln; w.Update;
 			w.String("MKD "); w.String(dir); w.Ln; w.Update;
@@ -362,7 +362,7 @@ TYPE
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 		END MakeDir;
 		END MakeDir;
 
 
-		PROCEDURE RemoveDir*(CONST dir : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE RemoveDir*(CONST dir : ARRAY OF CHAR; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			w.String("RMD "); w.String(dir); w.Ln; w.Update;
 			w.String("RMD "); w.String(dir); w.Ln; w.Update;
@@ -370,7 +370,7 @@ TYPE
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 			IF (code >= 200) & (code <300) THEN res := ResOk ELSE res := ResFailed END
 		END RemoveDir;
 		END RemoveDir;
 
 
-		PROCEDURE RenameFile*(CONST currentName, newName : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE RenameFile*(CONST currentName, newName : ARRAY OF CHAR; VAR res : WORD);
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
 			w.String("RNFR "); w.String(currentName); w.Ln; w.Update;
 			w.String("RNFR "); w.String(currentName); w.Ln; w.Update;
@@ -387,7 +387,7 @@ TYPE
 
 
 		PROCEDURE EnumerateNames*;
 		PROCEDURE EnumerateNames*;
 		VAR
 		VAR
-			res : LONGINT;
+			res : WORD;
 			r : Streams.Reader; s, filename : ARRAY 256 OF CHAR;
 			r : Streams.Reader; s, filename : ARRAY 256 OF CHAR;
 			flags : ARRAY 11 OF CHAR;
 			flags : ARRAY 11 OF CHAR;
 			type : ARRAY 4 OF CHAR;
 			type : ARRAY 4 OF CHAR;
@@ -474,7 +474,7 @@ TYPE
 		END EnumerateNames;
 		END EnumerateNames;
 
 
 		PROCEDURE EnumerateDir*(CONST args : ARRAY OF CHAR);
 		PROCEDURE EnumerateDir*(CONST args : ARRAY OF CHAR);
-		VAR  res : LONGINT;
+		VAR  res : WORD;
 			r : Streams.Reader; s, filename : ARRAY 256 OF CHAR;
 			r : Streams.Reader; s, filename : ARRAY 256 OF CHAR;
 			flags : ARRAY 11 OF CHAR;
 			flags : ARRAY 11 OF CHAR;
 			type : ARRAY 4 OF CHAR;
 			type : ARRAY 4 OF CHAR;
@@ -611,7 +611,7 @@ TYPE
 			listing[nofEntries-1] := entry;
 			listing[nofEntries-1] := entry;
 		END AddFTPEntryToListing;
 		END AddFTPEntryToListing;
 
 
-		PROCEDURE GetCurrentDir*(VAR dir : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE GetCurrentDir*(VAR dir : ARRAY OF CHAR; VAR res : WORD);
 		VAR p : LONGINT;
 		VAR p : LONGINT;
 		BEGIN
 		BEGIN
 			IF ~open OR busy THEN res := -2; RETURN END;
 			IF ~open OR busy THEN res := -2; RETURN END;
@@ -631,7 +631,7 @@ TYPE
 			END;
 			END;
 		END GetCurrentDir;
 		END GetCurrentDir;
 
 
-		PROCEDURE Raw*(CONST cmd : ARRAY OF CHAR; VAR res : LONGINT);
+		PROCEDURE Raw*(CONST cmd : ARRAY OF CHAR; VAR res : WORD);
 		VAR extMsg : ARRAY 4096 OF CHAR;
 		VAR extMsg : ARRAY 4096 OF CHAR;
 			command : ARRAY 32 OF CHAR; arguments : ARRAY 512 OF CHAR;
 			command : ARRAY 32 OF CHAR; arguments : ARRAY 512 OF CHAR;
 		BEGIN
 		BEGIN

+ 6 - 6
source/FTPFS.Mod

@@ -605,7 +605,7 @@ TYPE
 	 *Closes the FTP connection after some delay time.
 	 *Closes the FTP connection after some delay time.
 	 *)
 	 *)
 		PROCEDURE HandleClose;
 		PROCEDURE HandleClose;
-			VAR res : LONGINT;
+			VAR res : WORD;
 		BEGIN
 		BEGIN
 			SELF.ftp.Close (res);
 			SELF.ftp.Close (res);
 			KernelLog.Enter;
 			KernelLog.Enter;
@@ -651,7 +651,7 @@ TYPE
 			CONST
 			CONST
 				BufSize = 16*1024;
 				BufSize = 16*1024;
 
 
-			VAR res : LONGINT;
+			VAR res : WORD;
 				rd : Streams.Reader;
 				rd : Streams.Reader;
 				buf : ARRAY BufSize OF CHAR;
 				buf : ARRAY BufSize OF CHAR;
 				len : LONGINT;
 				len : LONGINT;
@@ -777,7 +777,7 @@ TYPE
 			lock.Release
 			lock.Release
 		END Delete0;
 		END Delete0;
 
 
-		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: LONGINT);
+		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: Files.File; VAR res: WORD);
 		VAR adr: DiskAdr; oldbuf, newbuf: FileName;  head: FileHeader;
 		VAR adr: DiskAdr; oldbuf, newbuf: FileName;  head: FileHeader;
 		BEGIN (*{EXCLUSIVE}*)
 		BEGIN (*{EXCLUSIVE}*)
 			lock.Acquire;
 			lock.Acquire;
@@ -811,7 +811,7 @@ TYPE
 		END Enumerate0;
 		END Enumerate0;
 
 
 		PROCEDURE FileKey*(name: ARRAY OF CHAR): LONGINT;
 		PROCEDURE FileKey*(name: ARRAY OF CHAR): LONGINT;
-			VAR res: LONGINT; namebuf: FileName; header: DiskAdr;
+			VAR res: WORD; namebuf: FileName; header: DiskAdr;
 		BEGIN (*{EXCLUSIVE}*)
 		BEGIN (*{EXCLUSIVE}*)
 			lock.Acquire;
 			lock.Acquire;
 			header := 0;
 			header := 0;
@@ -1010,7 +1010,7 @@ TYPE
 			Files.JoinName(fs.prefix, SELF.name, name)
 			Files.JoinName(fs.prefix, SELF.name, name)
 		END GetName;
 		END GetName;
 
 
-		PROCEDURE Register0*(VAR res: LONGINT);
+		PROCEDURE Register0*(VAR res: WORD);
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			Unbuffer(SELF);
 			Unbuffer(SELF);
 			IF ~registered & (name # "") THEN
 			IF ~registered & (name # "") THEN
@@ -1154,7 +1154,7 @@ END enumerate;
 
 
 (* Check a file name. *)
 (* Check a file name. *)
 
 
-PROCEDURE Check(VAR s: ARRAY OF CHAR; VAR name: FileName; VAR res: LONGINT);
+PROCEDURE Check(VAR s: ARRAY OF CHAR; VAR name: FileName; VAR res: WORD);
 	VAR i: LONGINT; ch: CHAR;
 	VAR i: LONGINT; ch: CHAR;
 BEGIN
 BEGIN
 	ch := s[0]; i := 0;
 	ch := s[0]; i := 0;

+ 14 - 14
source/Files.Mod

@@ -122,7 +122,7 @@ TYPE
 		file : File;
 		file : File;
 		r: Rider;
 		r: Rider;
 
 
-		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		BEGIN
 		BEGIN
 			r.file.WriteBytes(r, buf, ofs, len);
 			r.file.WriteBytes(r, buf, ofs, len);
 			IF propagate THEN r.file.Update END;
 			IF propagate THEN r.file.Update END;
@@ -286,7 +286,7 @@ TYPE
 
 
 		(** Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
 		(** Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
 
 
-		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: File; VAR res: LONGINT);
+		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: File; VAR res: WORD);
 		BEGIN HALT(301) END Rename0;	(* abstract *)
 		BEGIN HALT(301) END Rename0;	(* abstract *)
 
 
 		(** Enumerate canonical file names. mask may contain * wildcards.  For internal use only.  End users use Enumerator instead. *)
 		(** Enumerate canonical file names. mask may contain * wildcards.  For internal use only.  End users use Enumerator instead. *)
@@ -302,7 +302,7 @@ TYPE
 		(** Create a new directory structure. May not be supported by the actual implementation.
 		(** Create a new directory structure. May not be supported by the actual implementation.
 			End users use Files.CreateDirectory instead.*)
 			End users use Files.CreateDirectory instead.*)
 
 
-		PROCEDURE CreateDirectory0*(name: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE CreateDirectory0*(name: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN res := -1	(* not supported *)
 		BEGIN res := -1	(* not supported *)
 		END CreateDirectory0;
 		END CreateDirectory0;
 
 
@@ -408,7 +408,7 @@ TYPE
 		BEGIN HALT(301) END GetName;	(* abstract *)
 		BEGIN HALT(301) END GetName;	(* abstract *)
 
 
 		(** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically updated.  End users use Files.Register instead. *)
 		(** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically updated.  End users use Files.Register instead. *)
-		PROCEDURE Register0*(VAR res: LONGINT);
+		PROCEDURE Register0*(VAR res: WORD);
 		BEGIN HALT(301) END Register0;	(* abstract *)
 		BEGIN HALT(301) END Register0;	(* abstract *)
 
 
 		(** Flush the changes made to a file from its buffers. Register0 will automatically update a file. *)
 		(** Flush the changes made to a file from its buffers. Register0 will automatically update a file. *)
@@ -862,7 +862,7 @@ END New;
 
 
 (** Delete a file. res = 0 indicates success. *)
 (** Delete a file. res = 0 indicates success. *)
 
 
-PROCEDURE Delete*(VAR name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Delete*(VAR name: ARRAY OF CHAR; VAR res: WORD);
 VAR fs: FileSystem; f: File; key: LONGINT; prefix: Prefix; fname: FileName;
 VAR fs: FileSystem; f: File; key: LONGINT; prefix: Prefix; fname: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(name, prefix, fname);
 	SplitName(name, prefix, fname);
@@ -887,7 +887,7 @@ BEGIN {EXCLUSIVE}
 END Delete;
 END Delete;
 
 
 (* copies the file with the given name to the fileClipboard *)
 (* copies the file with the given name to the fileClipboard *)
-PROCEDURE Copy*(name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Copy*(name: ARRAY OF CHAR; VAR res: WORD);
 VAR file: File;
 VAR file: File;
 BEGIN
 BEGIN
 	res := -1;
 	res := -1;
@@ -898,7 +898,7 @@ BEGIN
 END Copy;
 END Copy;
 
 
 (* pastes the fileClipboard into the file with the given name if it doesn't exist already *)
 (* pastes the fileClipboard into the file with the given name if it doesn't exist already *)
-PROCEDURE Paste*(name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Paste*(name: ARRAY OF CHAR; VAR res: WORD);
 VAR writer : Writer;
 VAR writer : Writer;
 	reader : Reader;
 	reader : Reader;
 	file : File;
 	file : File;
@@ -929,7 +929,7 @@ END Paste;
  * @param overwrite: @in: Overwrite existing files? @out: Has an existing file been overwritten?
  * @param overwrite: @in: Overwrite existing files? @out: Has an existing file been overwritten?
  * @param res: @out: Result code
  * @param res: @out: Result code
  *)
  *)
-PROCEDURE CopyFile*(source, destination : ARRAY OF CHAR; VAR overwrite : BOOLEAN; VAR res : LONGINT);
+PROCEDURE CopyFile*(source, destination : ARRAY OF CHAR; VAR overwrite : BOOLEAN; VAR res : WORD);
 VAR
 VAR
 	sprefix, dprefix : Prefix;
 	sprefix, dprefix : Prefix;
 	sname, dname, dpath, dfilename: FileName;
 	sname, dname, dpath, dfilename: FileName;
@@ -993,7 +993,7 @@ END CopyFile;
 
 
 (** Rename a file. res = 0 indicates success. *)
 (** Rename a file. res = 0 indicates success. *)
 
 
-PROCEDURE Rename*(CONST old, new: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Rename*(CONST old, new: ARRAY OF CHAR; VAR res: WORD);
 VAR
 VAR
 	key: LONGINT; ofs, nfs: FileSystem; f: File; pold, pnew: Prefix;
 	key: LONGINT; ofs, nfs: FileSystem; f: File; pold, pnew: Prefix;
 	fold, fnew: FileName;
 	fold, fnew: FileName;
@@ -1018,7 +1018,7 @@ END Rename;
 (** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically closed. *)
 (** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically closed. *)
 
 
 PROCEDURE Register*(f: File);
 PROCEDURE Register*(f: File);
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	IF f # NIL THEN
 	IF f # NIL THEN
 		f.Register0(res);
 		f.Register0(res);
@@ -1031,7 +1031,7 @@ END Register;
 
 
 (** Create a directory structure. Directories are automatically registered. res=0 indicates success.
 (** Create a directory structure. Directories are automatically registered. res=0 indicates success.
 	Use Files.RemoveDirectory to delete a directory *)
 	Use Files.RemoveDirectory to delete a directory *)
-PROCEDURE CreateDirectory*(path: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE CreateDirectory*(path: ARRAY OF CHAR; VAR res: WORD);
 VAR prefix: Prefix; fs: FileSystem; fpath: FileName;
 VAR prefix: Prefix; fs: FileSystem; fpath: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(path, prefix, fpath);
 	SplitName(path, prefix, fpath);
@@ -1044,7 +1044,7 @@ BEGIN {EXCLUSIVE}
 END CreateDirectory;
 END CreateDirectory;
 
 
 (** Remove a directory. res=0 indicates success. If force=TRUE, any files and subdirectories are automatically deleted. *)
 (** Remove a directory. res=0 indicates success. If force=TRUE, any files and subdirectories are automatically deleted. *)
-PROCEDURE RemoveDirectory*(path: ARRAY OF CHAR; force: BOOLEAN; VAR res: LONGINT);
+PROCEDURE RemoveDirectory*(path: ARRAY OF CHAR; force: BOOLEAN; VAR res: WORD);
 VAR prefix: Prefix; fs: FileSystem; f: File; key: LONGINT; fpath: FileName;
 VAR prefix: Prefix; fs: FileSystem; f: File; key: LONGINT; fpath: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(path, prefix, fpath);
 	SplitName(path, prefix, fpath);
@@ -1115,7 +1115,7 @@ END Exists;
 
 
 (* add a search path to the system *)
 (* add a search path to the system *)
 PROCEDURE AddSearchPath*(context: Commands.Context);
 PROCEDURE AddSearchPath*(context: Commands.Context);
-VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: LONGINT;
+VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: WORD;
 BEGIN
 BEGIN
 	(* preliminary implementation until we know how to solve this generically *)
 	(* preliminary implementation until we know how to solve this generically *)
 	IF Modules.ModuleByName("WinFS") # NIL THEN
 	IF Modules.ModuleByName("WinFS") # NIL THEN
@@ -1131,7 +1131,7 @@ END AddSearchPath;
 
 
 (* add a search path to the system *)
 (* add a search path to the system *)
 PROCEDURE SetWorkPath*(context: Commands.Context);
 PROCEDURE SetWorkPath*(context: Commands.Context);
-VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: LONGINT;
+VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: WORD;
 BEGIN
 BEGIN
 	(* preliminary implementation until we know how to solve this generically *)
 	(* preliminary implementation until we know how to solve this generically *)
 	IF Modules.ModuleByName("WinFS") # NIL THEN
 	IF Modules.ModuleByName("WinFS") # NIL THEN

+ 15 - 15
source/Files64.Mod

@@ -87,7 +87,7 @@ TYPE
 		file : File;
 		file : File;
 		r: Rider;
 		r: Rider;
 
 
-		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min: TSize; VAR len: TSize; VAR res: LONGINT);
+		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min: TSize; VAR len: TSize; VAR res: WORD);
 		BEGIN
 		BEGIN
 			file.ReadBytes(r, buf, ofs, size);
 			file.ReadBytes(r, buf, ofs, size);
 			len := size - r.res;
 			len := size - r.res;
@@ -125,7 +125,7 @@ TYPE
 		file : File;
 		file : File;
 		r: Rider;
 		r: Rider;
 
 
-		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: TSize; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: TSize; propagate: BOOLEAN; VAR res: WORD);
 		BEGIN
 		BEGIN
 			r.file.WriteBytes(r, buf, ofs, len);
 			r.file.WriteBytes(r, buf, ofs, len);
 			IF propagate THEN r.file.Update END;
 			IF propagate THEN r.file.Update END;
@@ -198,7 +198,7 @@ TYPE
 
 
 		(** Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
 		(** Rename a file. res = 0 indicates success.  End users use Files.Rename instead. *)
 
 
-		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: File; VAR res: LONGINT);
+		PROCEDURE Rename0*(old, new: ARRAY OF CHAR; f: File; VAR res: WORD);
 		BEGIN HALT(301) END Rename0;	(* abstract *)
 		BEGIN HALT(301) END Rename0;	(* abstract *)
 
 
 		(** Enumerate canonical file names. mask may contain * wildcards.  For internal use only.  End users use Enumerator instead. *)
 		(** Enumerate canonical file names. mask may contain * wildcards.  For internal use only.  End users use Enumerator instead. *)
@@ -214,7 +214,7 @@ TYPE
 		(** Create a new directory structure. May not be supported by the actual implementation.
 		(** Create a new directory structure. May not be supported by the actual implementation.
 			End users use Files.CreateDirectory instead.*)
 			End users use Files.CreateDirectory instead.*)
 
 
-		PROCEDURE CreateDirectory0*(name: ARRAY OF CHAR; VAR res: LONGINT);
+		PROCEDURE CreateDirectory0*(name: ARRAY OF CHAR; VAR res: WORD);
 		BEGIN res := -1	(* not supported *)
 		BEGIN res := -1	(* not supported *)
 		END CreateDirectory0;
 		END CreateDirectory0;
 
 
@@ -320,7 +320,7 @@ TYPE
 		BEGIN HALT(301) END GetName;	(* abstract *)
 		BEGIN HALT(301) END GetName;	(* abstract *)
 
 
 		(** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically updated.  End users use Files.Register instead. *)
 		(** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically updated.  End users use Files.Register instead. *)
-		PROCEDURE Register0*(VAR res: LONGINT);
+		PROCEDURE Register0*(VAR res: WORD);
 		BEGIN HALT(301) END Register0;	(* abstract *)
 		BEGIN HALT(301) END Register0;	(* abstract *)
 
 
 		(** Flush the changes made to a file from its buffers. Register0 will automatically update a file. *)
 		(** Flush the changes made to a file from its buffers. Register0 will automatically update a file. *)
@@ -770,7 +770,7 @@ END New;
 
 
 (** Delete a file. res = 0 indicates success. *)
 (** Delete a file. res = 0 indicates success. *)
 
 
-PROCEDURE Delete*(VAR name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Delete*(VAR name: ARRAY OF CHAR; VAR res: WORD);
 VAR fs: FileSystem; f: File; key: LONGINT; prefix: Prefix; fname: FileName;
 VAR fs: FileSystem; f: File; key: LONGINT; prefix: Prefix; fname: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(name, prefix, fname);
 	SplitName(name, prefix, fname);
@@ -795,7 +795,7 @@ BEGIN {EXCLUSIVE}
 END Delete;
 END Delete;
 
 
 (* copies the file with the given name to the fileClipboard *)
 (* copies the file with the given name to the fileClipboard *)
-PROCEDURE Copy*(name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Copy*(name: ARRAY OF CHAR; VAR res: WORD);
 VAR file: File;
 VAR file: File;
 BEGIN
 BEGIN
 	res := -1;
 	res := -1;
@@ -806,7 +806,7 @@ BEGIN
 END Copy;
 END Copy;
 
 
 (* pastes the fileClipboard into the file with the given name if it doesn't exist already *)
 (* pastes the fileClipboard into the file with the given name if it doesn't exist already *)
-PROCEDURE Paste*(name: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Paste*(name: ARRAY OF CHAR; VAR res: WORD);
 VAR writer : Writer;
 VAR writer : Writer;
 	reader : Reader;
 	reader : Reader;
 	file : File;
 	file : File;
@@ -837,7 +837,7 @@ END Paste;
  * @param overwrite: @in: Overwrite existing files? @out: Has an existing file been overwritten?
  * @param overwrite: @in: Overwrite existing files? @out: Has an existing file been overwritten?
  * @param res: @out: Result code
  * @param res: @out: Result code
  *)
  *)
-PROCEDURE CopyFile*(source, destination : ARRAY OF CHAR; VAR overwrite : BOOLEAN; VAR res : LONGINT);
+PROCEDURE CopyFile*(source, destination : ARRAY OF CHAR; VAR overwrite : BOOLEAN; VAR res : WORD);
 VAR
 VAR
 	sprefix, dprefix : Prefix;
 	sprefix, dprefix : Prefix;
 	sname, dname, dpath, dfilename: FileName;
 	sname, dname, dpath, dfilename: FileName;
@@ -901,7 +901,7 @@ END CopyFile;
 
 
 (** Rename a file. res = 0 indicates success. *)
 (** Rename a file. res = 0 indicates success. *)
 
 
-PROCEDURE Rename*(CONST old, new: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE Rename*(CONST old, new: ARRAY OF CHAR; VAR res: WORD);
 VAR
 VAR
 	key: LONGINT; ofs, nfs: FileSystem; f: File; pold, pnew: Prefix;
 	key: LONGINT; ofs, nfs: FileSystem; f: File; pold, pnew: Prefix;
 	fold, fnew: FileName;
 	fold, fnew: FileName;
@@ -926,7 +926,7 @@ END Rename;
 (** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically closed. *)
 (** Register a file created with New in the directory, replacing the previous file in the directory with the same name. The file is automatically closed. *)
 
 
 PROCEDURE Register*(f: File);
 PROCEDURE Register*(f: File);
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	IF f # NIL THEN
 	IF f # NIL THEN
 		f.Register0(res);
 		f.Register0(res);
@@ -939,7 +939,7 @@ END Register;
 
 
 (** Create a directory structure. Directories are automatically registered. res=0 indicates success.
 (** Create a directory structure. Directories are automatically registered. res=0 indicates success.
 	Use Files.RemoveDirectory to delete a directory *)
 	Use Files.RemoveDirectory to delete a directory *)
-PROCEDURE CreateDirectory*(path: ARRAY OF CHAR; VAR res: LONGINT);
+PROCEDURE CreateDirectory*(path: ARRAY OF CHAR; VAR res: WORD);
 VAR prefix: Prefix; fs: FileSystem; fpath: FileName;
 VAR prefix: Prefix; fs: FileSystem; fpath: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(path, prefix, fpath);
 	SplitName(path, prefix, fpath);
@@ -952,7 +952,7 @@ BEGIN {EXCLUSIVE}
 END CreateDirectory;
 END CreateDirectory;
 
 
 (** Remove a directory. res=0 indicates success. If force=TRUE, any files and subdirectories are automatically deleted. *)
 (** Remove a directory. res=0 indicates success. If force=TRUE, any files and subdirectories are automatically deleted. *)
-PROCEDURE RemoveDirectory*(path: ARRAY OF CHAR; force: BOOLEAN; VAR res: LONGINT);
+PROCEDURE RemoveDirectory*(path: ARRAY OF CHAR; force: BOOLEAN; VAR res: WORD);
 VAR prefix: Prefix; fs: FileSystem; f: File; key: LONGINT; fpath: FileName;
 VAR prefix: Prefix; fs: FileSystem; f: File; key: LONGINT; fpath: FileName;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	SplitName(path, prefix, fpath);
 	SplitName(path, prefix, fpath);
@@ -1023,7 +1023,7 @@ END Exists;
 
 
 (* add a search path to the system *)
 (* add a search path to the system *)
 PROCEDURE AddSearchPath*(context: Commands.Context);
 PROCEDURE AddSearchPath*(context: Commands.Context);
-VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: LONGINT;
+VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: WORD;
 BEGIN
 BEGIN
 	(* preliminary implementation until we know how to solve this generically *)
 	(* preliminary implementation until we know how to solve this generically *)
 	IF Modules.ModuleByName("HostFiles64") # NIL THEN
 	IF Modules.ModuleByName("HostFiles64") # NIL THEN
@@ -1037,7 +1037,7 @@ END AddSearchPath;
 
 
 (* add a search path to the system *)
 (* add a search path to the system *)
 PROCEDURE SetWorkPath*(context: Commands.Context);
 PROCEDURE SetWorkPath*(context: Commands.Context);
-VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: LONGINT;
+VAR cmd: ARRAY 32 OF CHAR; msg: ARRAY 256 OF CHAR;  res: WORD;
 BEGIN
 BEGIN
 	(* preliminary implementation until we know how to solve this generically *)
 	(* preliminary implementation until we know how to solve this generically *)
 	IF Modules.ModuleByName("HostFiles64") # NIL THEN
 	IF Modules.ModuleByName("HostFiles64") # NIL THEN

+ 1 - 1
source/FirewireSBP2.Mod

@@ -1081,7 +1081,7 @@ BEGIN
 END ScanUD;
 END ScanUD;
 
 
 PROCEDURE AddStorageDevices(VAR dev: Sbp2Dev);
 PROCEDURE AddStorageDevices(VAR dev: Sbp2Dev);
-VAR res: LONGINT;
+VAR res: WORD;
 BEGIN
 BEGIN
 	(* now add to disk system *)
 	(* now add to disk system *)
 	Disks.registry.Add(dev,res);
 	Disks.registry.Add(dev,res);

+ 3 - 3
source/FoxAMDBackend.Mod

@@ -211,7 +211,7 @@ TYPE
 		VAR i,sizeInBits,length, form: LONGINT;
 		VAR i,sizeInBits,length, form: LONGINT;
 
 
 			PROCEDURE GetGPHint(offset: LONGINT): LONGINT;
 			PROCEDURE GetGPHint(offset: LONGINT): LONGINT;
-			VAR res: LONGINT;
+			VAR res: WORD;
 			BEGIN
 			BEGIN
 				IF (hint # none) & (hint >= AL) & (hint <= EDI) & (toVirtual[hint MOD 32 + offset]=free) & ~Reserved(hint) THEN res := hint MOD 32 + offset ELSE res := none END;
 				IF (hint # none) & (hint >= AL) & (hint <= EDI) & (toVirtual[hint MOD 32 + offset]=free) & ~Reserved(hint) THEN res := hint MOD 32 + offset ELSE res := none END;
 				hint := none;
 				hint := none;
@@ -219,7 +219,7 @@ TYPE
 			END GetGPHint;
 			END GetGPHint;
 
 
 			PROCEDURE GetHint(from,to: LONGINT): LONGINT;
 			PROCEDURE GetHint(from,to: LONGINT): LONGINT;
-			VAR res: LONGINT;
+			VAR res: WORD;
 			BEGIN
 			BEGIN
 				IF (hint # none) & (hint >= from) & (hint <= to) & (toVirtual[hint]=free) & ~Reserved(hint) THEN res := hint ELSE res := none END;
 				IF (hint # none) & (hint >= from) & (hint <= to) & (toVirtual[hint]=free) & ~Reserved(hint) THEN res := hint ELSE res := none END;
 				hint := none;
 				hint := none;
@@ -422,7 +422,7 @@ TYPE
 		VAR i: LONGINT;
 		VAR i: LONGINT;
 
 
 			PROCEDURE GetGPHint(offset: LONGINT): LONGINT;
 			PROCEDURE GetGPHint(offset: LONGINT): LONGINT;
-			VAR res: LONGINT;
+			VAR res: WORD;
 			BEGIN
 			BEGIN
 				IF (hint # none) & (hint >= AL) & (hint <= R15) & (toVirtual[hint MOD 32 + offset]=free) & ~Reserved(hint) THEN res := hint MOD 32 + offset ELSE res := none END;
 				IF (hint # none) & (hint >= AL) & (hint <= R15) & (toVirtual[hint MOD 32 + offset]=free) & ~Reserved(hint) THEN res := hint MOD 32 + offset ELSE res := none END;
 				hint := none;
 				hint := none;

+ 1 - 1
source/FoxActiveCells.Mod

@@ -1585,7 +1585,7 @@ TYPE
 		platform: PlatformDesc;
 		platform: PlatformDesc;
 		fileName: Files.FileName;
 		fileName: Files.FileName;
 		mod: Modules.Module;
 		mod: Modules.Module;
-		res: LONGINT;
+		res: WORD;
 		msg: ARRAY 8 OF CHAR;
 		msg: ARRAY 8 OF CHAR;
 	BEGIN
 	BEGIN
 
 

+ 1 - 1
source/FoxBasic.Mod

@@ -1621,7 +1621,7 @@ TYPE
 			InitWriter(Send, 256)
 			InitWriter(Send, 256)
 		END InitStream;
 		END InitStream;
 
 
-		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR idx: LONGINT;
 		VAR idx: LONGINT;
 		BEGIN
 		BEGIN
 			WHILE len > 0 DO
 			WHILE len > 0 DO

+ 2 - 2
source/FoxInterpreter.Mod

@@ -459,7 +459,7 @@ TYPE
 *)
 *)
 
 
 		PROCEDURE VisitIdentifierDesignator*(x: SyntaxTree.IdentifierDesignator);
 		PROCEDURE VisitIdentifierDesignator*(x: SyntaxTree.IdentifierDesignator);
-		VAR moduleName: Modules.Name; msg: ARRAY 128 OF CHAR; res: LONGINT;
+		VAR moduleName: Modules.Name; msg: ARRAY 128 OF CHAR; res: WORD;
 			 builtin : Builtin; anyValue: Any;
 			 builtin : Builtin; anyValue: Any;
 		BEGIN
 		BEGIN
 			ASSERT(x.left = NIL);
 			ASSERT(x.left = NIL);
@@ -884,7 +884,7 @@ TYPE
 		END TranslateString;
 		END TranslateString;
 		
 		
 		PROCEDURE VisitCommandStatement(x: CommandStatement);
 		PROCEDURE VisitCommandStatement(x: CommandStatement);
-		VAR t: Strings.String; res: LONGINT; msg: ARRAY 128 OF CHAR; i: LONGINT; array: Strings.StringArray; pos: LONGINT;
+		VAR t: Strings.String; res: WORD; msg: ARRAY 128 OF CHAR; i: LONGINT; array: Strings.StringArray; pos: LONGINT;
 			command: ARRAY 256 OF CHAR; context: Commands.Context;
 			command: ARRAY 256 OF CHAR; context: Commands.Context;
 
 
 			PROCEDURE CreateContext(paramString : Strings.String; pos: LONGINT) : Commands.Context;
 			PROCEDURE CreateContext(paramString : Strings.String; pos: LONGINT) : Commands.Context;

+ 1 - 1
source/FoxInterpreterSymbols.Mod

@@ -1708,7 +1708,7 @@ TYPE
 	*)
 	*)
 	
 	
 	PROCEDURE GetModule*(CONST name: ARRAY OF CHAR): ModuleResult;
 	PROCEDURE GetModule*(CONST name: ARRAY OF CHAR): ModuleResult;
-	VAR msg: ARRAY 128 OF CHAR; res: LONGINT; mod:ModuleResult; m: Modules.Module; meta: Meta;
+	VAR msg: ARRAY 128 OF CHAR; res: WORD; mod:ModuleResult; m: Modules.Module; meta: Meta;
 	BEGIN
 	BEGIN
 		m := Modules.ThisModule(name, res, msg);
 		m := Modules.ThisModule(name, res, msg);
 		IF m # NIL THEN 
 		IF m # NIL THEN 

+ 1 - 1
source/FoxScanner.Mod

@@ -198,7 +198,7 @@ TYPE
 			NEW(data, initialSize); length := 0;
 			NEW(data, initialSize); length := 0;
 		END Init;
 		END Init;
 
 
-		PROCEDURE Add*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Add*(CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR i : LONGINT; n: StringType;
 		VAR i : LONGINT; n: StringType;
 		BEGIN
 		BEGIN
 			IF length + len + 1 >= LEN(data) THEN
 			IF length + len + 1 >= LEN(data) THEN

+ 1 - 1
source/FoxSections.Mod

@@ -206,7 +206,7 @@ TYPE
 		firstComment-,lastComment-: Comment; comments-: LONGINT;
 		firstComment-,lastComment-: Comment; comments-: LONGINT;
 		getPC: GetPCProcedure;
 		getPC: GetPCProcedure;
 
 
-		PROCEDURE AppendToLine*( CONST buf: ARRAY OF CHAR;  ofs, len: LONGINT; propagate: BOOLEAN;  VAR res: LONGINT );
+		PROCEDURE AppendToLine*( CONST buf: ARRAY OF CHAR;  ofs, len: LONGINT; propagate: BOOLEAN;  VAR res: WORD );
 		VAR pos: LONGINT;
 		VAR pos: LONGINT;
 		BEGIN
 		BEGIN
 			IF len = 0 THEN RETURN END;
 			IF len = 0 THEN RETURN END;

+ 1 - 1
source/FoxSyntaxTree.Mod

@@ -1539,7 +1539,7 @@ TYPE
 		END SetProtected;
 		END SetProtected;
 
 
 		PROCEDURE Level*():LONGINT;
 		PROCEDURE Level*():LONGINT;
-		VAR type: RecordType; res: LONGINT;
+		VAR type: RecordType; res: WORD;
 		BEGIN
 		BEGIN
 			type := SELF;
 			type := SELF;
 			res := 0;
 			res := 0;

+ 1 - 1
source/FoxTRMTools.Mod

@@ -432,7 +432,7 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 	END SameFiles;
 	END SameFiles;
 	*)
 	*)
 	(*
 	(*
-	PROCEDURE DeleteFiles(CONST fileSelectionMask: ARRAY OF CHAR; context: Commands.Context; VAR res: LONGINT);
+	PROCEDURE DeleteFiles(CONST fileSelectionMask: ARRAY OF CHAR; context: Commands.Context; VAR res: WORD);
 	VAR
 	VAR
 		enum: Files.Enumerator;
 		enum: Files.Enumerator;
 		flags: SET;
 		flags: SET;

+ 1 - 1
source/FoxTest.Mod

@@ -29,7 +29,7 @@ TYPE
 		END InitTester;
 		END InitTester;
 
 
 		PROCEDURE Handle* (r: Streams.Reader; position: LONGINT; CONST name: ARRAY OF CHAR; type: TestSuite.TestType): INTEGER;
 		PROCEDURE Handle* (r: Streams.Reader; position: LONGINT; CONST name: ARRAY OF CHAR; type: TestSuite.TestType): INTEGER;
-		VAR result: INTEGER; msg: ARRAY 128 OF CHAR; res: LONGINT; f: Files.File; w: Files.Writer; ch: CHAR;
+		VAR result: INTEGER; msg: ARRAY 128 OF CHAR; res: WORD; f: Files.File; w: Files.Writer; ch: CHAR;
 		BEGIN
 		BEGIN
 			result := TestSuite.Failure;
 			result := TestSuite.Failure;
 			IF log # NIL THEN log.String ("testing: "); log.String (name); log.String("@"); log.Int(position,0); log.Ln; log.Update; END;
 			IF log # NIL THEN log.String ("testing: "); log.String (name); log.String("@"); log.Int(position,0); log.Ln; log.Update; END;

+ 4 - 4
source/GIFCodec.Mod

@@ -39,7 +39,7 @@ TYPE
 		PROCEDURE SetQuality*(quality : LONGINT);
 		PROCEDURE SetQuality*(quality : LONGINT);
 		END SetQuality;
 		END SetQuality;
 
 
-		PROCEDURE WriteImage*(img : Raster.Image; VAR res : LONGINT);
+		PROCEDURE WriteImage*(img : Raster.Image; VAR res : WORD);
 		VAR pal : Raster.Palette;
 		VAR pal : Raster.Palette;
 		BEGIN
 		BEGIN
 			NEW(pal); Raster.ComputePalette(img, pal, 0,256, 8);
 			NEW(pal); Raster.ComputePalette(img, pal, 0,256, 8);
@@ -217,7 +217,7 @@ TYPE
 		END Error;
 		END Error;
 
 
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR
 		VAR
 			header : Header;
 			header : Header;
 			ch : CHAR;
 			ch : CHAR;
@@ -370,7 +370,7 @@ TYPE
 		END Error;
 		END Error;
 
 
 		(* open the decoder on an InputStream *)
 		(* open the decoder on an InputStream *)
-		PROCEDURE Open*(in : Streams.Reader; VAR res : LONGINT);
+		PROCEDURE Open*(in : Streams.Reader; VAR res : WORD);
 		VAR
 		VAR
 			header : Header;
 			header : Header;
 			ch : CHAR;
 			ch : CHAR;
@@ -418,7 +418,7 @@ TYPE
 			res := 0;
 			res := 0;
 		END Open;
 		END Open;
 
 
-		PROCEDURE GetImageSequence*(VAR sequence : Codecs.ImageSequence; VAR res : LONGINT);
+		PROCEDURE GetImageSequence*(VAR sequence : Codecs.ImageSequence; VAR res : WORD);
 		VAR
 		VAR
 			first, last, current : Codecs.ImageDescriptor;
 			first, last, current : Codecs.ImageDescriptor;
 			label, ch, transPix, idFlags : CHAR;
 			label, ch, transPix, idFlags : CHAR;

+ 3 - 3
source/GZip.Mod

@@ -38,7 +38,7 @@ TYPE
 		VAR
 		VAR
 			writer: Streams.Writer;
 			writer: Streams.Writer;
 			s : ZlibDeflate.Stream;
 			s : ZlibDeflate.Stream;
-			res : LONGINT;
+			res : WORD;
 			crc32-: LONGINT; (*crc32 of uncompressed data*)
 			crc32-: LONGINT; (*crc32 of uncompressed data*)
 			out : POINTER TO ARRAY BufSize OF CHAR;
 			out : POINTER TO ARRAY BufSize OF CHAR;
 			flush: SHORTINT;
 			flush: SHORTINT;
@@ -77,7 +77,7 @@ TYPE
 			END;
 			END;
 		END Init;
 		END Init;
 
 
-		PROCEDURE Send* (CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
+		PROCEDURE Send* (CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: WORD);
 		VAR
 		VAR
 			done : BOOLEAN;
 			done : BOOLEAN;
 		BEGIN
 		BEGIN
@@ -136,7 +136,7 @@ TYPE
 	Inflator* = OBJECT	(** not sharable between multiple processes *)
 	Inflator* = OBJECT	(** not sharable between multiple processes *)
 		VAR
 		VAR
 			reader: Streams.Reader;
 			reader: Streams.Reader;
-			res: LONGINT;
+			res: WORD;
 			transparent : BOOLEAN;
 			transparent : BOOLEAN;
 			crc32-: LONGINT; (*crc32 of uncompressed data*)
 			crc32-: LONGINT; (*crc32 of uncompressed data*)
 			in : POINTER TO ARRAY BufSize OF CHAR;
 			in : POINTER TO ARRAY BufSize OF CHAR;

+ 6 - 6
source/HierarchicalProfiler.Mod

@@ -517,7 +517,7 @@ BEGIN
 END GetBufferSize;
 END GetBufferSize;
 
 
 (**	Generate hierarchical profile of the last profiler run's data. Returns NIL if no data available *)
 (**	Generate hierarchical profile of the last profiler run's data. Returns NIL if no data available *)
-PROCEDURE GetProfile*(type, info : LONGINT; VAR profile : Profile; VAR res : LONGINT);
+PROCEDURE GetProfile*(type, info : LONGINT; VAR profile : Profile; VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	profile := NIL;
 	profile := NIL;
 	IF (state # Running) THEN
 	IF (state # Running) THEN
@@ -563,7 +563,7 @@ BEGIN
 END Start;
 END Start;
 
 
 (** Start profiling. If the profiler is already running, it is stopped and the sample data is discarded before re-starting it *)
 (** Start profiling. If the profiler is already running, it is stopped and the sample data is discarded before re-starting it *)
-PROCEDURE StartProfiling*(maxTime : LONGINT; VAR res : LONGINT);
+PROCEDURE StartProfiling*(maxTime : LONGINT; VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	ASSERT(maxTime > 0);
 	ASSERT(maxTime > 0);
 	IF (state # Running) THEN
 	IF (state # Running) THEN
@@ -586,7 +586,7 @@ END StartProfiling;
 
 
 (** Stop profiling. The profile data is not discarded. It can be retrieved using the procedure 'GetProfile' *)
 (** Stop profiling. The profile data is not discarded. It can be retrieved using the procedure 'GetProfile' *)
 PROCEDURE Stop*(context : Commands.Context);
 PROCEDURE Stop*(context : Commands.Context);
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	StopProfiling(res);
 	StopProfiling(res);
 	IF (res = Ok) THEN
 	IF (res = Ok) THEN
@@ -599,7 +599,7 @@ BEGIN
 END Stop;
 END Stop;
 
 
 (** Stop profiling. The profile data is not discarded. It can be retrieved using the procedure 'GetProfile' *)
 (** Stop profiling. The profile data is not discarded. It can be retrieved using the procedure 'GetProfile' *)
-PROCEDURE StopProfiling*(VAR res : LONGINT);
+PROCEDURE StopProfiling*(VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	IF (state = Running) THEN
 	IF (state = Running) THEN
 		HierarchicalProfiler0.Disable;
 		HierarchicalProfiler0.Disable;
@@ -611,7 +611,7 @@ BEGIN {EXCLUSIVE}
 END StopProfiling;
 END StopProfiling;
 
 
 PROCEDURE Continue*(context : Commands.Context); (** ~ *)
 PROCEDURE Continue*(context : Commands.Context); (** ~ *)
-VAR res : LONGINT;
+VAR res : WORD;
 BEGIN
 BEGIN
 	ContinueProfiling(res);
 	ContinueProfiling(res);
 	IF (res = Ok) THEN
 	IF (res = Ok) THEN
@@ -622,7 +622,7 @@ BEGIN
 	context.out.Ln;
 	context.out.Ln;
 END Continue;
 END Continue;
 
 
-PROCEDURE ContinueProfiling*(VAR res : LONGINT);
+PROCEDURE ContinueProfiling*(VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	IF (state # Running) THEN
 	IF (state # Running) THEN
 		IF (samples # NIL) THEN
 		IF (samples # NIL) THEN

+ 2 - 2
source/HostClipboard.Mod

@@ -16,7 +16,7 @@ TYPE
 VAR
 VAR
 	getFromClipboard, putToClipboard : ClipboardHandler;
 	getFromClipboard, putToClipboard : ClipboardHandler;
 
 
-PROCEDURE Get*(text : Texts.Text; VAR res : LONGINT);
+PROCEDURE Get*(text : Texts.Text; VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	ASSERT((text # NIL) & (text.HasWriteLock()));
 	ASSERT((text # NIL) & (text.HasWriteLock()));
 	IF (getFromClipboard # NIL) THEN
 	IF (getFromClipboard # NIL) THEN
@@ -27,7 +27,7 @@ BEGIN {EXCLUSIVE}
 	END;
 	END;
 END Get;
 END Get;
 
 
-PROCEDURE Put*(text : Texts.Text; VAR res : LONGINT);
+PROCEDURE Put*(text : Texts.Text; VAR res : WORD);
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}
 	ASSERT((text # NIL) & (text.HasReadLock()));
 	ASSERT((text # NIL) & (text.HasReadLock()));
 	IF (putToClipboard # NIL) THEN
 	IF (putToClipboard # NIL) THEN

+ 1 - 1
source/HotKeys.Mod

@@ -281,7 +281,7 @@ VAR
 	caller: OBJECT
 	caller: OBJECT
 	VAR
 	VAR
 		command: XML.String;
 		command: XML.String;
-		msg : ARRAY 256 OF CHAR; res : LONGINT;
+		msg : ARRAY 256 OF CHAR; res : WORD;
 
 
 		PROCEDURE & Init(c: XML.String);
 		PROCEDURE & Init(c: XML.String);
 		BEGIN
 		BEGIN

+ 1 - 1
source/HotKeysCommands.Mod

@@ -38,7 +38,7 @@ TYPE
 		editor : WMEditors.Editor;
 		editor : WMEditors.Editor;
 
 
 		PROCEDURE HandleEnter(sender, data : ANY);
 		PROCEDURE HandleEnter(sender, data : ANY);
-		VAR commandString : ARRAY 4096 OF CHAR; msg : ARRAY 128 OF CHAR; res : LONGINT;
+		VAR commandString : ARRAY 4096 OF CHAR; msg : ARRAY 128 OF CHAR; res : WORD;
 		BEGIN
 		BEGIN
 			editor.GetAsString(commandString);
 			editor.GetAsString(commandString);
 			IF commandString # "" THEN
 			IF commandString # "" THEN

+ 21 - 21
source/I386.ATADisks.Mod

@@ -224,7 +224,7 @@ TYPE
 			DeviceReset = SYSTEM.VAL(LONGINT, Protocol_DeviceReset);
 			DeviceReset = SYSTEM.VAL(LONGINT, Protocol_DeviceReset);
 			NonData = SYSTEM.VAL(LONGINT, Protocol_NonData);
 			NonData = SYSTEM.VAL(LONGINT, Protocol_NonData);
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			ch: CHAR;
 			ch: CHAR;
 			dma: BOOLEAN;
 			dma: BOOLEAN;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
@@ -390,7 +390,7 @@ TYPE
 		VAR
 		VAR
 			ch: CHAR;
 			ch: CHAR;
 			s: SET;
 			s: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			(* Clear Interrupt & Errror *)
 			(* Clear Interrupt & Errror *)
 			Machine.Portin8(bmbase + Ofs_BMStatus, ch); s := SYSTEM.VAL(SET, ORD(ch));
 			Machine.Portin8(bmbase + Ofs_BMStatus, ch); s := SYSTEM.VAL(SET, ORD(ch));
@@ -460,7 +460,7 @@ TYPE
 		VAR
 		VAR
 			t: Kernel.MilliTimer;
 			t: Kernel.MilliTimer;
 			status: SET;
 			status: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			IF state = 1 THEN RETURN Res_Err; END;
 			IF state = 1 THEN RETURN Res_Err; END;
 			(* HSR0 *)
 			(* HSR0 *)
@@ -485,7 +485,7 @@ TYPE
 			cmdPacket: CommandPacket;
 			cmdPacket: CommandPacket;
 			ch: CHAR;
 			ch: CHAR;
 			status, devReg: SET;
 			status, devReg: SET;
-			res: LONGINT;
+			res: WORD;
 		BEGIN
 		BEGIN
 			(* HI1 *)
 			(* HI1 *)
 			res := WaitStatus({Status_BSY, Status_DRQ}, {}, {}, ms, status);
 			res := WaitStatus({Status_BSY, Status_DRQ}, {}, {}, ms, status);
@@ -749,7 +749,7 @@ TYPE
 			States: HPD0(Check_Status_A), HPD1 (Send_Packet), HPD2 (Check_Status_B), HPD3 (INTRQ_wait), HPD4 (Transfer_Data) *)
 			States: HPD0(Check_Status_A), HPD1 (Send_Packet), HPD2 (Check_Status_B), HPD3 (INTRQ_wait), HPD4 (Transfer_Data) *)
 		PROCEDURE ProtPacketDMA(command: CommandPacket; ms: LONGINT; VAR status: SET): LONGINT;
 		PROCEDURE ProtPacketDMA(command: CommandPacket; ms: LONGINT; VAR status: SET): LONGINT;
 		VAR
 		VAR
-			res: LONGINT;
+			res: WORD;
 			ch: CHAR;
 			ch: CHAR;
 			s: SET;
 			s: SET;
 			t: Kernel.MilliTimer;
 			t: Kernel.MilliTimer;
@@ -801,7 +801,7 @@ TYPE
 
 
 		PROCEDURE CreateDevice(devNum: LONGINT): LONGINT;
 		PROCEDURE CreateDevice(devNum: LONGINT): LONGINT;
 		VAR status: SET;
 		VAR status: SET;
-			res: LONGINT; dev, devATA: Device; devATAPI: DeviceATAPI; ch: CHAR;
+			res: WORD; dev, devATA: Device; devATAPI: DeviceATAPI; ch: CHAR;
 			buf: ARRAY BS DIV 2 OF INTEGER;
 			buf: ARRAY BS DIV 2 OF INTEGER;
 			command: Command;
 			command: Command;
 			devReg: SET;
 			devReg: SET;
@@ -967,7 +967,7 @@ TYPE
 		cmdLBA: CommandLBA;
 		cmdLBA: CommandLBA;
 		cmdLBA48: CommandLBA48;
 		cmdLBA48: CommandLBA48;
 
 
-		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: LONGINT);
+		PROCEDURE Transfer*(op, block, num: LONGINT; VAR data: ARRAY OF CHAR; ofs: LONGINT; VAR res: WORD);
 		VAR
 		VAR
 			num1, try, ignore: LONGINT; bufAdr: ADDRESS;
 			num1, try, ignore: LONGINT; bufAdr: ADDRESS;
 			dma: BOOLEAN;
 			dma: BOOLEAN;
@@ -1027,7 +1027,7 @@ TYPE
 			res := Disks.Ok;
 			res := Disks.Ok;
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF msg IS Disks.GetGeometryMsg THEN
 			IF msg IS Disks.GetGeometryMsg THEN
@@ -1080,7 +1080,7 @@ TYPE
 		END TransferEx;
 		END TransferEx;
 
 
 		PROCEDURE Reset(): LONGINT;
 		PROCEDURE Reset(): LONGINT;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * TraceCommands # {})  THEN Show(name); KernelLog.String(" reset controller"); KernelLog.Ln; END;
 			IF TraceVerbose & (trace * TraceCommands # {})  THEN Show(name); KernelLog.String(" reset controller"); KernelLog.Ln; END;
 			res := controller.Reset();
 			res := controller.Reset();
@@ -1104,7 +1104,7 @@ TYPE
 		END InitDevice;
 		END InitDevice;
 
 
 		PROCEDURE Flush(): LONGINT;
 		PROCEDURE Flush(): LONGINT;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF FlushBit IN id.type THEN
 			IF FlushBit IN id.type THEN
@@ -1122,7 +1122,7 @@ TYPE
 		PROCEDURE MediaLock(lock: BOOLEAN): LONGINT;
 		PROCEDURE MediaLock(lock: BOOLEAN): LONGINT;
 		VAR
 		VAR
 			command: CommandLBA;
 			command: CommandLBA;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			IF RMSNBit IN id.type THEN
 			IF RMSNBit IN id.type THEN
@@ -1392,7 +1392,7 @@ TYPE
 		END Create;
 		END Create;
 
 
 		PROCEDURE Finalize;
 		PROCEDURE Finalize;
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			(* unregister device *)
 			(* unregister device *)
 			Disks.registry.Remove(SELF);
 			Disks.registry.Remove(SELF);
@@ -1439,7 +1439,7 @@ TYPE
 			END;
 			END;
 		END GetSize;
 		END GetSize;
 
 
-		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: LONGINT);
+		PROCEDURE Handle*(VAR msg: Disks.Message; VAR res: WORD);
 		BEGIN
 		BEGIN
 			res := Disks.Unsupported;
 			res := Disks.Unsupported;
 			IF msg IS Disks.GetGeometryMsg THEN
 			IF msg IS Disks.GetGeometryMsg THEN
@@ -1488,7 +1488,7 @@ TYPE
 			RETURN res;
 			RETURN res;
 		END ExecuteCommand;
 		END ExecuteCommand;
 
 
-		PROCEDURE ProcessSense(VAR res: LONGINT);
+		PROCEDURE ProcessSense(VAR res: WORD);
 		BEGIN
 		BEGIN
 			IF res = Res_OK THEN
 			IF res = Res_OK THEN
 				sense := 0; asc := 0; ascq := 0;
 				sense := 0; asc := 0; ascq := 0;
@@ -1529,7 +1529,7 @@ TYPE
 		END TransferEx;
 		END TransferEx;
 
 
 		PROCEDURE WaitUntilReady(): LONGINT;
 		PROCEDURE WaitUntilReady(): LONGINT;
-		VAR res: LONGINT; retry: BOOLEAN;
+		VAR res: WORD; retry: BOOLEAN;
 		BEGIN
 		BEGIN
 			REPEAT
 			REPEAT
 				retry := FALSE;
 				retry := FALSE;
@@ -1581,7 +1581,7 @@ TYPE
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
 			buf: ARRAY 18 OF CHAR;
 			buf: ARRAY 18 OF CHAR;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
@@ -1617,7 +1617,7 @@ TYPE
 		PROCEDURE TestUnitReady*(): LONGINT;
 		PROCEDURE TestUnitReady*(): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN
 		BEGIN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
 			IF TraceVerbose & (trace * (TraceCommands + TraceAtapi) # {}) THEN
@@ -1670,7 +1670,7 @@ TYPE
 		PROCEDURE MediaLock*(lock: BOOLEAN): LONGINT;
 		PROCEDURE MediaLock*(lock: BOOLEAN): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			command := NewCommandPacket(1EH); (* prevent/allow medium removal *)
 			command := NewCommandPacket(1EH); (* prevent/allow medium removal *)
@@ -1687,7 +1687,7 @@ TYPE
 		PROCEDURE Powersave(): LONGINT;
 		PROCEDURE Powersave(): LONGINT;
 		VAR
 		VAR
 			command: CommandPacket;
 			command: CommandPacket;
-			res: LONGINT;
+			res: WORD;
 			status: SET;
 			status: SET;
 		BEGIN {EXCLUSIVE}
 		BEGIN {EXCLUSIVE}
 			command := NewCommandPacket(1BH); (* start/stop unit *)
 			command := NewCommandPacket(1BH); (* start/stop unit *)
@@ -1799,7 +1799,7 @@ TYPE
 		END NewCommandPacket;
 		END NewCommandPacket;
 
 
 		PROCEDURE IdentifyDevice(buf: ARRAY OF INTEGER): LONGINT;
 		PROCEDURE IdentifyDevice(buf: ARRAY OF INTEGER): LONGINT;
-		VAR res : LONGINT;
+		VAR res : WORD;
 		BEGIN
 		BEGIN
 			maxTransfer := 65535;
 			maxTransfer := 65535;
 
 
@@ -1878,7 +1878,7 @@ TYPE
 		END ShowDevice;
 		END ShowDevice;
 
 
 		PROCEDURE &Create*(acontroller: Controller; adev: LONGINT; identifyDevice: ARRAY OF INTEGER);
 		PROCEDURE &Create*(acontroller: Controller; adev: LONGINT; identifyDevice: ARRAY OF INTEGER);
-		VAR res: LONGINT;
+		VAR res: WORD;
 		BEGIN
 		BEGIN
 			INCL(id.type, AtapiBit);
 			INCL(id.type, AtapiBit);
 			NEW(cmdPacket);
 			NEW(cmdPacket);

+ 3 - 3
source/I386.DivXDecoder.Mod

@@ -1797,7 +1797,7 @@ TYPE DivXDecoder* = OBJECT(Codecs.VideoDecoder)
 
 
 
 
 		(* Sets the the stream on which to read *)
 		(* Sets the the stream on which to read *)
-		PROCEDURE Open*(in: Streams.Reader; VAR res: LONGINT );
+		PROCEDURE Open*(in: Streams.Reader; VAR res: WORD );
 		BEGIN
 		BEGIN
 			SELF.s := in;
 			SELF.s := in;
 			NEW( mp4State);
 			NEW( mp4State);
@@ -1838,7 +1838,7 @@ TYPE DivXDecoder* = OBJECT(Codecs.VideoDecoder)
 			RETURN frameCounter;
 			RETURN frameCounter;
 		END GetCurrentFrame;
 		END GetCurrentFrame;
 
 
-		PROCEDURE SeekFrame*(frame : LONGINT; goKeyFrame : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekFrame*(frame : LONGINT; goKeyFrame : BOOLEAN; VAR res : WORD);
 		VAR
 		VAR
 			seekType: LONGINT;
 			seekType: LONGINT;
 			dummy: LONGINT;
 			dummy: LONGINT;
@@ -1856,7 +1856,7 @@ TYPE DivXDecoder* = OBJECT(Codecs.VideoDecoder)
 		END SeekFrame;
 		END SeekFrame;
 
 
 		(* Seeks a position based on timevalue. If gokeyframe is set, the next following keyframe is searched *)
 		(* Seeks a position based on timevalue. If gokeyframe is set, the next following keyframe is searched *)
-		PROCEDURE SeekMillisecond*(millisecond: LONGINT; goKeyFrame : BOOLEAN; VAR res : LONGINT);
+		PROCEDURE SeekMillisecond*(millisecond: LONGINT; goKeyFrame : BOOLEAN; VAR res : WORD);
 		VAR
 		VAR
 			frame: LONGINT;
 			frame: LONGINT;
 			dummy: LONGINT;
 			dummy: LONGINT;

+ 2 - 2
source/I386.IP.Mod

@@ -89,7 +89,7 @@ TYPE
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly.
 			In IPv6 maskAdr is the prefix of the currently IP address *)
 			In IPv6 maskAdr is the prefix of the currently IP address *)
-		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskOrPrefixAdr, gatewayAdr: Adr; VAR res: WORD);
 		BEGIN
 		BEGIN
 			(* Extensions have to override this method.*)
 			(* Extensions have to override this method.*)
 			HALT(99);
 			HALT(99);
@@ -1482,7 +1482,7 @@ END SetIPv6AdrNil;
 
 
 
 
 (* Add the interface to the IP configuration. *)
 (* Add the interface to the IP configuration. *)
-PROCEDURE AddInterface*(int: Interface; VAR res: LONGINT);
+PROCEDURE AddInterface*(int: Interface; VAR res: WORD);
 VAR
 VAR
 	item: Interface;
 	item: Interface;
 BEGIN {EXCLUSIVE}
 BEGIN {EXCLUSIVE}

+ 2 - 2
source/I386.IPv4.Mod

@@ -48,7 +48,7 @@ TYPE
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"name" must be a unique name for this interface (tested in "AddInterface").
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			"dev" must be a Network.LinkDevice that can be used in other interfaces => multiple IP addresses on the
 			same interface. *)
 			same interface. *)
-		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: LONGINT);
+		PROCEDURE &Constr*(name: IP.Name; dev: Network.LinkDevice; VAR res: WORD);
 		VAR
 		VAR
 			i: LONGINT;
 			i: LONGINT;
 
 
@@ -338,7 +338,7 @@ TYPE
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			If "gatewayAdr" is "NilAdr", the subnet is considered to have no gateway, else it must be in the same
 			subnet as the "localAdr".
 			subnet as the "localAdr".
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
 			"domain" can be an empty string. It is normally used by a DNS implementation. It is not used in IP directly. *)
-		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: LONGINT);
+		PROCEDURE SetAdrs*(localAdr, maskAdr, gatewayAdr: IP.Adr; VAR res: WORD);
 		VAR
 		VAR
 			maskSet: SET;
 			maskSet: SET;
 
 

+ 1 - 1
source/I386.MPEGUtilities.Mod

@@ -681,7 +681,7 @@ TYPE
 		PROCEDURE ReadMotionCode*(): LONGINT;
 		PROCEDURE ReadMotionCode*(): LONGINT;
 		VAR
 		VAR
 			bits: LONGINT;
 			bits: LONGINT;
-			res: LONGINT;
+			res: WORD;
 
 
 		BEGIN
 		BEGIN
 			IF eof THEN RETURN 0 END;
 			IF eof THEN RETURN 0 END;

+ 2 - 2
source/I386.MemCache.Mod

@@ -83,7 +83,7 @@ END SetMTTRphysMask;
 
 
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 (** Set the cache properties of the specified physical memory area on the current processor. {physAdr, size MOD PS = 0}  Must be called from supervisor mode. *)
 
 
-PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE LocalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 VAR i, n, f: LONGINT; mask, base: SET; j, k: ADDRESS;
 BEGIN
 BEGIN
 	ASSERT((physAdr MOD PS = 0) & (size MOD PS = 0) & (size # 0));
 	ASSERT((physAdr MOD PS = 0) & (size MOD PS = 0) & (size # 0));
@@ -148,7 +148,7 @@ END HandleSetCacheProperties;
 
 
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 (** Broadcast a LocalSetCacheProperties operation to all processors. *)
 
 
-PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: LONGINT);
+PROCEDURE GlobalSetCacheProperties*(physAdr: ADDRESS; size, type: LONGINT; VAR res: WORD);
 VAR i: LONGINT; msg: SetCacheMessage;
 VAR i: LONGINT; msg: SetCacheMessage;
 BEGIN
 BEGIN
 	NEW(msg); msg.physAdr := physAdr; msg.size := size; msg.type := type;
 	NEW(msg); msg.physAdr := physAdr; msg.size := size; msg.type := type;

Vissa filer visades inte eftersom för många filer har ändrats