Explorar el Código

* Char -> AnsiChar

Michael VAN CANNEYT hace 2 años
padre
commit
485944b492

+ 15 - 15
rtl/go32v2/dos.pp

@@ -219,7 +219,7 @@ var
   use_proxy       : boolean;
   proxy_argc      : longint;
   ExecBufSize, TB : longint;
-  ExecBufPtr      : PChar;
+  ExecBufPtr      : PAnsiChar;
   execblock       : texecblock;
   c               : ansistring;
   p               : string;
@@ -228,7 +228,7 @@ var
   {Changed by Laaca - added parameter N}
   var
 {
-    c : pchar;
+    c : PAnsiChar;
 }
     CLen : cardinal;
     start_pos,ls : longint;
@@ -273,7 +273,7 @@ var
     MAX_ARGS = 128;
   var
     i : longint;
-    quote : char;
+    quote : AnsiChar;
     end_of_arg, skip_char : boolean;
     la_proxy_seg    : word;
     la_proxy_ofs    : longint;
@@ -784,7 +784,7 @@ var
   lfnfile : text;
 {$endif DEBUG_LFN}
 
-procedure LFNFindFirst(path:pchar;attr:longint;var s:searchrec);
+procedure LFNFindFirst(path:PAnsiChar;attr:longint;var s:searchrec);
 var
   i : longint;
   w : LFNSearchRec;
@@ -885,7 +885,7 @@ begin
 end;
 
 
-procedure DosFindfirst(path : pchar;attr : word;var f : searchrec);
+procedure DosFindfirst(path : PAnsiChar;attr : word;var f : searchrec);
 var
    i : longint;
 begin
@@ -929,7 +929,7 @@ end;
 
 procedure findfirst(const path : pathstr;attr : word;var f : searchRec);
 var
-  path0 : array[0..255] of char;
+  path0 : array[0..255] of AnsiChar;
 begin
   doserror:=0;
   strpcopy(path0,path);
@@ -1032,7 +1032,7 @@ end;
 { change to short filename if successful DOS call PM }
 function GetShortName(var p : String) : boolean;
 var
-  c : array[0..255] of char;
+  c : array[0..255] of AnsiChar;
 begin
   move(p[1],c[0],length(p));
   c[length(p)]:=#0;
@@ -1049,7 +1049,7 @@ begin
    begin
      copyfromdos(c,256);
      move(c[0],p[1],strlen(c));
-     p[0]:=char(strlen(c));
+     p[0]:=AnsiChar(strlen(c));
      GetShortName:=true;
    end
   else
@@ -1060,7 +1060,7 @@ end;
 { change to long filename if successful DOS call PM }
 function GetLongName(var p : String) : boolean;
 var
-  c : array[0..255] of char;
+  c : array[0..255] of AnsiChar;
 begin
   move(p[1],c[0],length(p));
   c[length(p)]:=#0;
@@ -1077,7 +1077,7 @@ begin
    begin
      copyfromdos(c,256);
      move(c[0],p[1],strlen(c));
-     p[0]:=char(strlen(c));
+     p[0]:=AnsiChar(strlen(c));
      GetLongName:=true;
    end
   else
@@ -1120,7 +1120,7 @@ begin
   copytodos(filerec(f).name,strlen(filerec(f).name)+1);
 {$else}
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).name);
-  copytodos(pchar(r)^,length(r)+1);
+  copytodos(PAnsiChar(r)^,length(r)+1);
 {$endif}
   dosregs.edx:=tb_offset;
   dosregs.ds:=tb_segment;
@@ -1153,7 +1153,7 @@ begin
   copytodos(filerec(f).name,strlen(filerec(f).name)+1);
 {$else}
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).name);
-  copytodos(pchar(r)^,length(r)+1);
+  copytodos(PAnsiChar(r)^,length(r)+1);
 {$endif}
   dosregs.edx:=tb_offset;
   dosregs.ds:=tb_segment;
@@ -1176,7 +1176,7 @@ end;
 
 function envcount : longint;
 var
-  hp : ppchar;
+  hp : PPAnsiChar;
 begin
   hp:=envp;
   envcount:=0;
@@ -1193,13 +1193,13 @@ begin
   if (index<=0) or (index>envcount) then
     envstr:=''
   else
-    envstr:=strpas(ppchar(pointer(envp)+SizeOf(PChar)*(index-1))^);
+    envstr:=strpas(PPAnsiChar(pointer(envp)+SizeOf(PAnsiChar)*(index-1))^);
 end;
 
 
 Function  GetEnv(envvar: string): string;
 var
-  hp    : ppchar;
+  hp    : PPAnsiChar;
   hs    : string;
   eqpos : longint;
 begin

+ 3 - 3
rtl/go32v2/dpmiexcp.pp

@@ -832,7 +832,7 @@ end;
 
 const
   EXCEPTIONCOUNT = 20;
-  exception_names : array[0..EXCEPTIONCOUNT-1] of pchar = (
+  exception_names : array[0..EXCEPTIONCOUNT-1] of PAnsiChar = (
    'Division by Zero',
    'Debug',
    'NMI',
@@ -897,7 +897,7 @@ const message_level : byte = 0;
 function do_faulting_finish_message(fake : boolean) : integer;cdecl;
 public;
 var
-  en : pchar;
+  en : PAnsiChar;
   signum,i : longint;
   old_vid : byte;
 label
@@ -1576,7 +1576,7 @@ begin
     truesig:=sig;
   ErrorOfSig:=0;
   case truesig of
-   {exception_names : array[0..EXCEPTIONCOUNT-1] of pchar = (}
+   {exception_names : array[0..EXCEPTIONCOUNT-1] of PAnsiChar = (}
    0 : ErrorOfSig:=200;    {'Division by Zero'}
    5 : ErrorOfSig:=201;    {'Bounds Check'}
    12 : ErrorOfSig:=202;   {'Stack Fault'}

+ 1 - 1
rtl/go32v2/dxeload.pp

@@ -37,7 +37,7 @@ type
   tpa = ^pointer_array;
 var
   dh     : dxe_header;
-  data   : pchar;
+  data   : PAnsiChar;
   f      : file;
   relocs : tpa;
   i      : longint;

+ 1 - 1
rtl/go32v2/emu387.pp

@@ -116,7 +116,7 @@ end;
 function getenv(const envvar:string):string;
 { Copied here, preserves uses Dos (PFV) }
 var
-  hp      : ppchar;
+  hp      : PPAnsiChar;
   hs,
   _envvar : string;
   eqpos   : longint;

+ 5 - 5
rtl/go32v2/go32.pp

@@ -122,7 +122,7 @@ interface
     procedure seg_move(sseg : word;source : longint;dseg : word;dest : longint;count : longint);
 
     { fills a memory area specified by a 48 bit pointer with c }
-    procedure seg_fillchar(seg : word;ofs : longint;count : longint;c : char);
+    procedure seg_fillchar(seg : word;ofs : longint;count : longint;c : AnsiChar);
     procedure seg_fillword(seg : word;ofs : longint;count : longint;w : word);
 
     {************************************}
@@ -193,7 +193,7 @@ interface
     procedure dpmi_dosmemput(seg : word;ofs : word;var data;count : longint);
     procedure dpmi_dosmemget(seg : word;ofs : word;var data;count : longint);
     procedure dpmi_dosmemmove(sseg,sofs,dseg,dofs : word;count : longint);
-    procedure dpmi_dosmemfillchar(seg,ofs : word;count : longint;c : char);
+    procedure dpmi_dosmemfillchar(seg,ofs : word;count : longint;c : AnsiChar);
     procedure dpmi_dosmemfillword(seg,ofs : word;count : longint;w : word);
 
 
@@ -205,7 +205,7 @@ interface
        dosmemput      : procedure(seg : word;ofs : word;var data;count : longint)=@dpmi_dosmemput;
        dosmemget      : procedure(seg : word;ofs : word;var data;count : longint)=@dpmi_dosmemget;
        dosmemmove     : procedure(sseg,sofs,dseg,dofs : word;count : longint)=@dpmi_dosmemmove;
-       dosmemfillchar : procedure(seg,ofs : word;count : longint;c : char)=@dpmi_dosmemfillchar;
+       dosmemfillchar : procedure(seg,ofs : word;count : longint;c : AnsiChar)=@dpmi_dosmemfillchar;
        dosmemfillword : procedure(seg,ofs : word;count : longint;w : word)=@dpmi_dosmemfillword;
 
   implementation
@@ -232,7 +232,7 @@ interface
          seg_move(dosmemselector,sseg*16+sofs,dosmemselector,dseg*16+dofs,count);
       end;
 
-    procedure dpmi_dosmemfillchar(seg,ofs : word;count : longint;c : char);
+    procedure dpmi_dosmemfillchar(seg,ofs : word;count : longint;c : AnsiChar);
 
       begin
          seg_fillchar(dosmemselector,seg*16+ofs,count,c);
@@ -324,7 +324,7 @@ interface
          end;
       end;
 
-    procedure seg_fillchar(seg : word;ofs : longint;count : longint;c : char);
+    procedure seg_fillchar(seg : word;ofs : longint;count : longint;c : AnsiChar);
 
       begin
          asm

+ 3 - 3
rtl/go32v2/sysdir.inc

@@ -88,7 +88,7 @@ end;
 
 procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
 var
-  temp : array[0..255] of char;
+  temp : array[0..255] of AnsiChar;
   i    : longint;
   regs : trealregs;
 begin
@@ -103,7 +103,7 @@ begin
   if (regs.realflags and carryflag) <> 0 then
    Begin
      GetInOutRes (lo(regs.realeax));
-     Dir := char (DriveNr + 64) + ':\';
+     Dir := AnsiChar (DriveNr + 64) + ':\';
      SetCodePage (Dir,DefaultFileSystemCodePage,false);
      exit;
    end
@@ -127,7 +127,7 @@ begin
   if not FileNameCasePreserving then
    dir:=upcase(dir);
   if drivenr<>0 then   { Drive was supplied. We know it }
-   dir[1]:=char(65+drivenr-1)
+   dir[1]:=AnsiChar(65+drivenr-1)
   else
    begin
    { We need to get the current drive from DOS function 19H  }

+ 7 - 7
rtl/go32v2/sysfile.inc

@@ -19,7 +19,7 @@
    var
       openfiles : array [0..max_files-1] of boolean;
 {$ifdef SYSTEMDEBUG}
-      opennames : array [0..max_files-1] of pchar;
+      opennames : array [0..max_files-1] of PAnsiChar;
    const
       free_closed_names : boolean = true;
 {$endif SYSTEMDEBUG}
@@ -54,10 +54,10 @@ begin
 end;
 
 
-procedure do_erase(p : pchar; pchangeable: boolean);
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);
 var
   regs : trealregs;
-  oldp : pchar;
+  oldp : PAnsiChar;
 begin
   oldp:=p;
   DoDirSeparators(p,pchangeable);
@@ -78,10 +78,10 @@ begin
 end;
 
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);
 var
   regs : trealregs;
-  oldp1, oldp2 : pchar;
+  oldp1, oldp2 : PAnsiChar;
 begin
   oldp1:=p1;
   oldp2:=p2;
@@ -291,7 +291,7 @@ begin
 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
   they could use the same routine for opening/creating.
@@ -302,7 +302,7 @@ procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);
 var
   regs   : trealregs;
   action : longint;
-  oldp : pchar;
+  oldp : PAnsiChar;
 begin
 { close first if opened }
   if ((flags and $10000)=0) then

+ 1 - 1
rtl/go32v2/sysos.inc

@@ -171,7 +171,7 @@ begin
 end;
 
 
-function strcopy(dest,source : pchar) : pchar;assembler;
+function strcopy(dest,source : PAnsiChar) : PAnsiChar;assembler;
 var
   saveeax,saveesi,saveedi : longint;
 asm

+ 23 - 23
rtl/go32v2/system.pp

@@ -43,8 +43,8 @@ const
  DriveSeparator = ':';
  ExtensionSeparator = '.';
  PathSeparator = ';';
- AllowDirectorySeparators : set of char = ['\','/'];
- AllowDriveSeparators : set of char = [':'];
+ AllowDirectorySeparators : set of AnsiChar = ['\','/'];
+ AllowDriveSeparators : set of AnsiChar = [':'];
 { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
  maxExitCode = 255;
  MaxPathLen = 256;
@@ -76,9 +76,9 @@ var
   meml : array[0..($7fffffff div sizeof(longint))-1] of longint absolute $0:$0;
 { C-compatible arguments and environment }
   argc:longint;public name 'operatingsystem_parameter_argc';
-  argv:PPchar;public name 'operatingsystem_parameter_argv';
-  envp:PPchar;public name 'operatingsystem_parameter_envp';
-  dos_argv0 : pchar; public name 'dos_argv0';
+  argv:PPAnsiChar;public name 'operatingsystem_parameter_argv';
+  envp:PPAnsiChar;public name 'operatingsystem_parameter_envp';
+  dos_argv0 : PAnsiChar; public name 'dos_argv0';
 
   AllFilesMask: string [3];
 
@@ -94,7 +94,7 @@ type
 { Dos Extender info }
   p_stub_info = ^t_stub_info;
   t_stub_info = packed record
-       magic         : array[0..15] of char;
+       magic         : array[0..15] of AnsiChar;
        size          : longint;
        minstack      : longint;
        memory_handle : longint;
@@ -105,9 +105,9 @@ type
        psp_selector  : word;
        cs_selector   : word;
        env_size      : word;
-       basename      : array[0..7] of char;
-       argv0         : array [0..15] of char;
-       dpmi_server   : array [0..15] of char;
+       basename      : array[0..7] of AnsiChar;
+       argv0         : array [0..15] of AnsiChar;
+       dpmi_server   : array [0..15] of AnsiChar;
   end;
 
   p_go32_info_block = ^t_go32_info_block;
@@ -163,10 +163,10 @@ implementation
 
 
 var
-  c_environ : ppchar;external name '__environ';
-  _args : ppchar;external name '_args';
+  c_environ : PPAnsiChar;external name '__environ';
+  _args : PPAnsiChar;external name '_args';
   __stubinfo : p_stub_info;external name '__stubinfo';
-  ___dos_argv0 : pchar;external name '___dos_argv0';
+  ___dos_argv0 : PAnsiChar;external name '___dos_argv0';
 
 
 procedure setup_arguments;
@@ -179,16 +179,16 @@ var
   rm_argv  : ^arrayword;
   argv0len : longint;
   useproxy : boolean;
-  hp       : ppchar;
+  hp       : PPAnsiChar;
   doscmd   : string[129];  { Dos commandline copied from PSP, max is 128 chars +1 for terminating zero }
   arglen,cmdlen,
   count   : longint;
   argstart,
-  pc,arg  : pchar;
-  quote   : char;
+  pc,arg  : PAnsiChar;
+  quote   : AnsiChar;
   argvlen : longint;
 
-  function atohex(s : pchar) : longint;
+  function atohex(s : PAnsiChar) : longint;
   var
     rv : longint;
     v  : byte;
@@ -275,7 +275,7 @@ begin
             begin
               if quote<>'''' then
                begin
-                 if pchar(pc+1)^<>'"' then
+                 if PAnsiChar(pc+1)^<>'"' then
                   begin
                     if quote='"' then
                      quote:=' '
@@ -292,7 +292,7 @@ begin
             begin
               if quote<>'"' then
                begin
-                 if pchar(pc+1)^<>'''' then
+                 if PAnsiChar(pc+1)^<>'''' then
                   begin
                     if quote=''''  then
                      quote:=' '
@@ -332,7 +332,7 @@ begin
             begin
               if quote<>'''' then
                begin
-                 if pchar(pc+1)^<>'"' then
+                 if PAnsiChar(pc+1)^<>'"' then
                   begin
                     if quote='"' then
                      quote:=' '
@@ -352,7 +352,7 @@ begin
             begin
               if quote<>'"' then
                begin
-                 if pchar(pc+1)^<>'''' then
+                 if PAnsiChar(pc+1)^<>'''' then
                   begin
                     if quote=''''  then
                      quote:=' '
@@ -465,7 +465,7 @@ end;
 procedure setup_environment;
 var env_selector : word;
     env_count : longint;
-    dos_env,cp : pchar;
+    dos_env,cp : PAnsiChar;
 begin
    stub_info:=__stubinfo;
    dos_env := sysgetmem(stub_info^.env_size);
@@ -479,7 +479,7 @@ begin
     while (cp^ <> #0) do inc(longint(cp)); { skip to NUL }
     inc(longint(cp)); { skip to next character }
     end;
-  envp := sysgetmem((env_count+1) * sizeof(pchar));
+  envp := sysgetmem((env_count+1) * sizeof(PAnsiChar));
   if (envp = nil) then HandleError (203);
   c_environ:=envp;
   cp:=dos_env;
@@ -600,7 +600,7 @@ end;
 function CheckLFN:boolean;
 var
   regs     : TRealRegs;
-  RootName : pchar;
+  RootName : PAnsiChar;
 begin
 { Check LFN API on drive c:\ }
   RootName:='C:\';

+ 3 - 3
rtl/go32v2/sysutils.pp

@@ -71,11 +71,11 @@ const
 Type
   PSearchrec = ^Searchrec;
 
-{  converts S to a pchar and copies it to the transfer-buffer.   }
+{  converts S to a PAnsiChar and copies it to the transfer-buffer.   }
 
 procedure StringToTB(const S: rawbytestring);
 var
-  P: pchar;
+  P: PAnsiChar;
   Len: longint;
 begin
   Len := Length(S) + 1;
@@ -671,7 +671,7 @@ end ;
 ****************************************************************************}
 
 const
-  BeepChars: array [1..2] of char = #7'$';
+  BeepChars: array [1..2] of AnsiChar = #7'$';
 
 procedure sysBeep;
 var