2
0
Michael VAN CANNEYT 2 жил өмнө
parent
commit
ec8d82332a

+ 3 - 3
rtl/msxdos/sysdir.inc

@@ -97,7 +97,7 @@ end;
 procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
 procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
 {$ifdef todo}
 {$ifdef todo}
 var
 var
-  temp : array[0..260] of char;
+  temp : array[0..260] of AnsiChar;
   i    : integer;
   i    : integer;
   regs : Registers;
   regs : Registers;
 {$endif}
 {$endif}
@@ -115,7 +115,7 @@ begin
   if (regs.Flags and fCarry) <> 0 then
   if (regs.Flags and fCarry) <> 0 then
    Begin
    Begin
      GetInOutRes (regs.AX);
      GetInOutRes (regs.AX);
-     Dir := char (DriveNr + 64) + ':\';
+     Dir := AnsiChar (DriveNr + 64) + ':\';
      SetCodePage (Dir,DefaultFileSystemCodePage,false);
      SetCodePage (Dir,DefaultFileSystemCodePage,false);
      exit;
      exit;
    end
    end
@@ -139,7 +139,7 @@ begin
   if not FileNameCasePreserving then
   if not FileNameCasePreserving then
    dir:=upcase(dir);
    dir:=upcase(dir);
   if drivenr<>0 then   { Drive was supplied. We know it }
   if drivenr<>0 then   { Drive was supplied. We know it }
-   dir[1]:=char(65+drivenr-1)
+   dir[1]:=AnsiChar(65+drivenr-1)
   else
   else
    begin
    begin
    { We need to get the current drive from DOS function 19H  }
    { We need to get the current drive from DOS function 19H  }

+ 7 - 7
rtl/msxdos/sysfile.inc

@@ -19,7 +19,7 @@
    var
    var
       openfiles : array [0..max_files-1] of boolean;
       openfiles : array [0..max_files-1] of boolean;
 {$ifdef SYSTEMDEBUG}
 {$ifdef SYSTEMDEBUG}
-      opennames : array [0..max_files-1] of pchar;
+      opennames : array [0..max_files-1] of PAnsiChar;
    const
    const
       free_closed_names : boolean = true;
       free_closed_names : boolean = true;
       verbose_files : boolean = true;
       verbose_files : boolean = true;
@@ -68,10 +68,10 @@ begin
 end;
 end;
 
 
 
 
-procedure do_erase(p : pchar; pchangeable: boolean);
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);
 var
 var
   regs: Registers;
   regs: Registers;
-  oldp: pchar;
+  oldp: PAnsiChar;
 begin
 begin
   oldp := p;
   oldp := p;
   DoDirSeparators(p, pchangeable);
   DoDirSeparators(p, pchangeable);
@@ -86,10 +86,10 @@ begin
 end;
 end;
 
 
 
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);
 var
 var
   regs: Registers;
   regs: Registers;
-  oldp1, oldp2: pchar;
+  oldp1, oldp2: PAnsiChar;
 begin
 begin
   oldp1 := p1;
   oldp1 := p1;
   oldp2 := p2;
   oldp2 := p2;
@@ -228,7 +228,7 @@ begin
    GetInOutRes(regs.A);}
    GetInOutRes(regs.A);}
 end;
 end;
 
 
-procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);
+procedure do_open(var f;p:PAnsiChar;flags:longint; pchangeable: boolean);
 {
 {
   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.
@@ -239,7 +239,7 @@ procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);
 var
 var
   regs   : Registers;
   regs   : Registers;
   action : word;
   action : word;
-  oldp : pchar;
+  oldp : PAnsiChar;
 begin
 begin
 {$ifdef SYSTEMDEBUG}
 {$ifdef SYSTEMDEBUG}
   if verbose_files then
   if verbose_files then

+ 3 - 3
rtl/msxdos/sysheap.inc

@@ -24,11 +24,11 @@
 { Internal structure used by MSDOS }
 { Internal structure used by MSDOS }
 type
 type
   MCB = packed record
   MCB = packed record
-    sig : char;
+    sig : AnsiChar;
     psp : word;
     psp : word;
     paragraphs : word;
     paragraphs : word;
-    res : array [0..2] of char;
-    exename : array [0..7] of char;
+    res : array [0..2] of AnsiChar;
+    exename : array [0..7] of AnsiChar;
   end;
   end;
   PMCB = ^MCB;
   PMCB = ^MCB;
 {$endif def DEBUG_TINY_HEAP}
 {$endif def DEBUG_TINY_HEAP}

+ 22 - 22
rtl/msxdos/system.pp

@@ -22,12 +22,12 @@ interface
   systemh.inc is included otherwise the
   systemh.inc is included otherwise the
   $mode switch is not effective }
   $mode switch is not effective }
 
 
-{ 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}
 
 
 {$ifdef NO_WIDESTRINGS}
 {$ifdef NO_WIDESTRINGS}
-  { Do NOT use wide Char for files }
+  { Do NOT use widechar for files }
   {$undef FPC_HAS_FEATURE_WIDESTRINGS}
   {$undef FPC_HAS_FEATURE_WIDESTRINGS}
 {$endif NO_WIDESTRINGS}
 {$endif NO_WIDESTRINGS}
 
 
@@ -52,8 +52,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;
@@ -80,7 +80,7 @@ var
   meml : array[0..($7fff div sizeof(longint))-1] of longint absolute $0;
   meml : array[0..($7fff div sizeof(longint))-1] of longint absolute $0;
 { C-compatible arguments and environment }
 { C-compatible arguments and environment }
   argc:smallint; //!! public name 'operatingsystem_parameter_argc';
   argc:smallint; //!! public name 'operatingsystem_parameter_argc';
-  argv:PPchar; //!! public name 'operatingsystem_parameter_argv';
+  argv:PPAnsiChar; //!! public name 'operatingsystem_parameter_argv';
 
 
 { The DOS Program Segment Prefix segment (TP7 compatibility) }
 { The DOS Program Segment Prefix segment (TP7 compatibility) }
   PrefixSeg:Word;public name '__fpc_PrefixSeg';
   PrefixSeg:Word;public name '__fpc_PrefixSeg';
@@ -98,7 +98,7 @@ const
 
 
 implementation
 implementation
 
 
-procedure DebugWrite(s: PChar); forward;
+procedure DebugWrite(s: PAnsiChar); forward;
 procedure DebugWrite(const S: string); forward;
 procedure DebugWrite(const S: string); forward;
 procedure DebugWriteLn(const S: string); forward;
 procedure DebugWriteLn(const S: string); forward;
 
 
@@ -120,7 +120,7 @@ const
 
 
 type
 type
   PFarByte = ^Byte;//far;
   PFarByte = ^Byte;//far;
-  PFarChar = ^Char;//far;
+  PFarChar = ^AnsiChar;//far;
   PFarWord = ^Word;//far;
   PFarWord = ^Word;//far;
   PPFarChar = ^PFarChar;
   PPFarChar = ^PFarChar;
 {$endif}
 {$endif}
@@ -135,7 +135,7 @@ var
   __stktop : pointer;public name '__stktop';
   __stktop : pointer;public name '__stktop';
   dos_version:Word;public name 'dos_version';
   dos_version:Word;public name 'dos_version';
   dos_env_count:smallint;public name '__dos_env_count';
   dos_env_count:smallint;public name '__dos_env_count';
-  dos_argv0 : PChar;public name '__fpc_dos_argv0';
+  dos_argv0 : PAnsiChar;public name '__fpc_dos_argv0';
 
 
 {$I registers.inc}
 {$I registers.inc}
 
 
@@ -258,7 +258,7 @@ function CheckNullArea: Boolean; external name 'FPC_CHECK_NULLAREA';
 {$endif FPC_HAS_FEATURE_SOFTFPU}
 {$endif FPC_HAS_FEATURE_SOFTFPU}
 {$endif FPUNONE}
 {$endif FPUNONE}
 
 
-procedure DebugWrite(S: PChar);
+procedure DebugWrite(S: PAnsiChar);
 var
 var
   regs: Registers;
   regs: Registers;
 begin
 begin
@@ -293,7 +293,7 @@ end;
 *****************************************************************************}
 *****************************************************************************}
 
 
 var
 var
-  internal_envp : PPChar = nil;
+  internal_envp : PPAnsiChar = nil;
 
 
 procedure setup_environment;
 procedure setup_environment;
 {$ifdef todo}
 {$ifdef todo}
@@ -338,14 +338,14 @@ begin
 {$endif}
 {$endif}
 end;
 end;
 
 
-function envp:PPChar;public name '__fpc_envp';
+function envp:PPAnsiChar;public name '__fpc_envp';
 begin
 begin
   if not assigned(internal_envp) then
   if not assigned(internal_envp) then
     setup_environment;
     setup_environment;
   envp:=internal_envp;
   envp:=internal_envp;
 end;
 end;
 
 
-function GetEnvVar(aName: PChar): String;
+function GetEnvVar(aName: PAnsiChar): String;
 var
 var
   regs: Registers;
   regs: Registers;
   i: SizeInt;
   i: SizeInt;
@@ -359,7 +359,7 @@ begin
   MsxDos(regs);
   MsxDos(regs);
   if regs.A = 0 then begin
   if regs.A = 0 then begin
     i := 1;
     i := 1;
-    aName := PChar(@Result[1]);
+    aName := PAnsiChar(@Result[1]);
     while i < 256 do begin
     while i < 256 do begin
       if aName^ = #0 then begin
       if aName^ = #0 then begin
         SetLength(Result, i);
         SetLength(Result, i);
@@ -375,12 +375,12 @@ end;
 procedure setup_arguments;
 procedure setup_arguments;
 var
 var
   i: SmallInt;
   i: SmallInt;
-  pc: PChar;
-  quote: Char;
+  pc: PAnsiChar;
+  quote: AnsiChar;
   count: SmallInt;
   count: SmallInt;
   arglen, argv0len: SmallInt;
   arglen, argv0len: SmallInt;
-  argblock: PChar;
-  arg: PChar;
+  argblock: PAnsiChar;
+  arg: PAnsiChar;
   doscmd   : string[129];  { Dos commandline copied from PSP, max is 128 chars +1 for terminating zero }
   doscmd   : string[129];  { Dos commandline copied from PSP, max is 128 chars +1 for terminating zero }
   tmp: String;
   tmp: String;
   regs: Registers;
   regs: Registers;
@@ -420,7 +420,7 @@ begin
               begin
               begin
                 if quote<>'''' then
                 if quote<>'''' then
                   begin
                   begin
-                    if pchar(pc+1)^<>'"' then
+                    if PAnsiChar(pc+1)^<>'"' then
                       begin
                       begin
                         if quote='"' then
                         if quote='"' then
                           quote:=' '
                           quote:=' '
@@ -437,7 +437,7 @@ begin
               begin
               begin
                 if quote<>'"' then
                 if quote<>'"' then
                   begin
                   begin
-                    if pchar(pc+1)^<>'''' then
+                    if PAnsiChar(pc+1)^<>'''' then
                       begin
                       begin
                         if quote=''''  then
                         if quote=''''  then
                          quote:=' '
                          quote:=' '
@@ -461,7 +461,7 @@ begin
   Writeln(stderr,'Arg count: ', count, ', size: ', arglen);
   Writeln(stderr,'Arg count: ', count, ', size: ', arglen);
   { set argc and allocate argv }
   { set argc and allocate argv }
   argc:=count;
   argc:=count;
-  argv:=AllocMem((count+1)*SizeOf(PChar));
+  argv:=AllocMem((count+1)*SizeOf(PAnsiChar));
   { allocate a single memory block for all arguments }
   { allocate a single memory block for all arguments }
   argblock:=GetMem(arglen);
   argblock:=GetMem(arglen);
   writeln('Allocated arg vector at ', hexstr(argv), ' and block at ', hexstr(argblock));
   writeln('Allocated arg vector at ', hexstr(argv), ' and block at ', hexstr(argblock));
@@ -505,7 +505,7 @@ begin
               begin
               begin
                 if quote<>'''' then
                 if quote<>'''' then
                   begin
                   begin
-                    if pchar(pc+1)^<>'"' then
+                    if PAnsiChar(pc+1)^<>'"' then
                       begin
                       begin
                         if quote='"' then
                         if quote='"' then
                           quote:=' '
                           quote:=' '
@@ -525,7 +525,7 @@ begin
               begin
               begin
                 if quote<>'"' then
                 if quote<>'"' then
                   begin
                   begin
-                    if pchar(pc+1)^<>'''' then
+                    if PAnsiChar(pc+1)^<>'''' then
                       begin
                       begin
                         if quote=''''  then
                         if quote=''''  then
                           quote:=' '
                           quote:=' '