Browse Source

* Char -> AnsiChar

Michael VAN CANNEYT 2 years ago
parent
commit
7559c75201
2 changed files with 20 additions and 20 deletions
  1. 6 6
      rtl/zxspectrum/sysfile.inc
  2. 14 14
      rtl/zxspectrum/system.pp

+ 6 - 6
rtl/zxspectrum/sysfile.inc

@@ -23,12 +23,12 @@ begin
 end;
 end;
 
 
 
 
-procedure do_erase(p : pchar; pchangeable: boolean);inline;
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);inline;
 begin
 begin
 end;
 end;
 
 
 
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);inline;
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);inline;
 begin
 begin
 end;
 end;
 
 
@@ -38,7 +38,7 @@ begin
   do_write:=len;
   do_write:=len;
   while len>0 do
   while len>0 do
   begin
   begin
-    PrintChar(PChar(addr)^);
+    PrintChar(PAnsiChar(addr)^);
     Inc(addr);
     Inc(addr);
     Dec(len);
     Dec(len);
   end;
   end;
@@ -47,14 +47,14 @@ end;
 
 
 function do_read(h:thandle;addr:pointer;len : longint) : longint;
 function do_read(h:thandle;addr:pointer;len : longint) : longint;
 var
 var
-  ch: Char;
+  ch: AnsiChar;
 begin
 begin
   do_read:=0;
   do_read:=0;
   while len>0 do
   while len>0 do
   begin
   begin
     ch:=ReadKey;
     ch:=ReadKey;
     PrintChar(ch);
     PrintChar(ch);
-    PChar(addr)^:=ch;
+    PAnsiChar(addr)^:=ch;
     Inc(addr);
     Inc(addr);
     Inc(do_read);
     Inc(do_read);
     Dec(len);
     Dec(len);
@@ -90,7 +90,7 @@ procedure do_truncate (handle:thandle;pos:longint);inline;
 begin
 begin
 end;
 end;
 
 
-procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);inline;
+procedure do_open(var f;p:PAnsiChar;flags:longint; pchangeable: boolean);inline;
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.

+ 14 - 14
rtl/zxspectrum/system.pp

@@ -10,7 +10,7 @@ interface
 
 
 {$define HAS_MEMORYMANAGER}
 {$define HAS_MEMORYMANAGER}
 
 
-{ Use Ansi Char for files }
+{ Use AnsiChar for files }
 {$define FPC_ANSI_TEXTFILEREC}
 {$define FPC_ANSI_TEXTFILEREC}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_STDERR_IS_ALIAS_FOR_STDOUT}
 {$define FPC_STDERR_IS_ALIAS_FOR_STDOUT}
@@ -39,7 +39,7 @@ var
   OpenChannel(1) opens the lower screen
   OpenChannel(1) opens the lower screen
   OpenChannel(3) opens the ZX Printer }
   OpenChannel(3) opens the ZX Printer }
 procedure OpenChannel(Chan: Byte);
 procedure OpenChannel(Chan: Byte);
-procedure PrintChar(Ch: Char);
+procedure PrintChar(Ch: AnsiChar);
 procedure PrintLn;
 procedure PrintLn;
 procedure PrintShortString(const s: ShortString);
 procedure PrintShortString(const s: ShortString);
 procedure PrintHexDigit(const d: byte);
 procedure PrintHexDigit(const d: byte);
@@ -48,7 +48,7 @@ procedure PrintHexWord(const w: word);
 procedure Ink(colour: Byte);
 procedure Ink(colour: Byte);
 procedure Paper(colour: Byte);
 procedure Paper(colour: Byte);
 procedure GotoXY(X, Y: Byte);
 procedure GotoXY(X, Y: Byte);
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 function KeyPressed: Boolean;
 function KeyPressed: Boolean;
 
 
 implementation
 implementation
@@ -60,8 +60,8 @@ const
   DriveSeparator = ':';
   DriveSeparator = ':';
   ExtensionSeparator = '.';
   ExtensionSeparator = '.';
   PathSeparator = ';';
   PathSeparator = ';';
-  AllowDirectorySeparators : set of char = ['\','/'];
-  AllowDriveSeparators : set of char = [':'];
+  AllowDirectorySeparators : set of AnsiChar = ['\','/'];
+  AllowDriveSeparators : set of AnsiChar = [':'];
   { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
   { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
   maxExitCode = 255;
   maxExitCode = 255;
   MaxPathLen = 256;
   MaxPathLen = 256;
@@ -133,9 +133,9 @@ end;
 
 
 var
 var
   save_iy: Word; public name 'FPC_SAVE_IY';
   save_iy: Word; public name 'FPC_SAVE_IY';
-  LastKey: Char absolute 23560;
+  LastKey: AnsiChar absolute 23560;
 
 
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 begin
 begin
   repeat
   repeat
     ReadKey:=LastKey;
     ReadKey:=LastKey;
@@ -158,7 +158,7 @@ asm
   ld (save_iy),iy
   ld (save_iy),iy
 end;
 end;
 
 
-procedure PrintChar(Ch: Char);assembler;
+procedure PrintChar(Ch: AnsiChar);assembler;
 asm
 asm
   ld iy,(save_iy)
   ld iy,(save_iy)
   ld a, (Ch)
   ld a, (Ch)
@@ -177,9 +177,9 @@ procedure PrintHexDigit(const d: byte);
 begin
 begin
   { the code generator is still to broken to compile this, so we do it in a stupid way }
   { the code generator is still to broken to compile this, so we do it in a stupid way }
 {  if (d >= 0) or (d <= 9) then
 {  if (d >= 0) or (d <= 9) then
-    PrintChar(Char(d + Ord('0')))
+    PrintChar(AnsiChar(d + Ord('0')))
   else if (d >= 10) and (d <= 15) then
   else if (d >= 10) and (d <= 15) then
-    PrintChar(Char(d + (Ord('A') - 10)));}
+    PrintChar(AnsiChar(d + (Ord('A') - 10)));}
   if d=0 then
   if d=0 then
     PrintChar('0')
     PrintChar('0')
   else if d=1 then
   else if d=1 then
@@ -231,20 +231,20 @@ end;
 procedure Ink(colour: Byte);
 procedure Ink(colour: Byte);
 begin
 begin
   PrintChar(#16);
   PrintChar(#16);
-  PrintChar(Char(colour));
+  PrintChar(AnsiChar(colour));
 end;
 end;
 
 
 procedure Paper(colour: Byte);
 procedure Paper(colour: Byte);
 begin
 begin
   PrintChar(#17);
   PrintChar(#17);
-  PrintChar(Char(colour));
+  PrintChar(AnsiChar(colour));
 end;
 end;
 
 
 procedure GotoXY(X, Y: Byte);
 procedure GotoXY(X, Y: Byte);
 begin
 begin
   PrintChar(#22);
   PrintChar(#22);
-  PrintChar(Char(Y-1));
-  PrintChar(Char(X-1));
+  PrintChar(AnsiChar(Y-1));
+  PrintChar(AnsiChar(X-1));
 end;
 end;
 
 
 procedure PrintShortString(const s: ShortString);
 procedure PrintShortString(const s: ShortString);