Browse Source

* Char -> AnsiChar

Michael VAN CANNEYT 2 years ago
parent
commit
810f54ac07
5 changed files with 34 additions and 34 deletions
  1. 9 9
      rtl/macos/dos.pp
  2. 4 4
      rtl/macos/macostp.inc
  3. 5 5
      rtl/macos/sysfile.inc
  4. 6 6
      rtl/macos/system.pp
  5. 10 10
      rtl/macos/sysutils.pp

+ 9 - 9
rtl/macos/dos.pp

@@ -184,7 +184,7 @@ End;
 ******************************************************************************}
 
 { Create a DoScript AppleEvent that targets the given application with text as the direct object. }
-function CreateDoScriptEvent (applCreator: OSType; scriptText: PChar; var theEvent: AppleEvent): OSErr;
+function CreateDoScriptEvent (applCreator: OSType; scriptText: PAnsiChar; var theEvent: AppleEvent): OSErr;
 
   var
    err: OSErr;
@@ -220,13 +220,13 @@ begin
   if desc.descriptorType = FourCharCodeToLongword(typeChar) then
     begin
       HLock(desc.dataHandle);
-      Fpc_WriteBuffer(f, PChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
+      Fpc_WriteBuffer(f, PAnsiChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
       Flush(f);
       HUnLock(desc.dataHandle);
     end;
 end;
 
-function ExecuteToolserverScript(scriptText: PChar; var statusCode: Longint): OSErr;
+function ExecuteToolserverScript(scriptText: PAnsiChar; var statusCode: Longint): OSErr;
 
   var
     err: OSErr;
@@ -301,13 +301,13 @@ Begin
   {Make ToolServers working directory in sync with our working directory}
   PathArgToFullPath(':', wdpath);
   wdpath:= 'Directory ''' + wdpath + '''';
-  err:= ExecuteToolserverScript(PChar(wdpath), LastDosExitCode);
+  err:= ExecuteToolserverScript(PAnsiChar(wdpath), LastDosExitCode);
     {TODO Only change path when actually needed. But this requires some
      change counter to be incremented each time wd is changed. }
 
   s:= path + ' ' + comline;
 
-  err:= ExecuteToolserverScript(PChar(s), LastDosExitCode);
+  err:= ExecuteToolserverScript(PAnsiChar(s), LastDosExitCode);
   if err = afpItemNotFound then
     DosError := 900
   else
@@ -906,7 +906,7 @@ End;
 Function EnvCount: Longint;
 var
   envcnt : longint;
-  p      : ppchar;
+  p      : PPAnsiChar;
 Begin
   envcnt:=0;
   p:=envp;      {defined in system}
@@ -923,7 +923,7 @@ Function EnvStr (Index: longint): String;
 
 Var
   i : longint;
-  p : ppchar;
+  p : PPAnsiChar;
 Begin
   if Index <= 0 then
     envstr:=''
@@ -944,12 +944,12 @@ Begin
 end;
 
 
-function c_getenv(varname: PChar): PChar; {TODO perhaps move to a separate inc file.}
+function c_getenv(varname: PAnsiChar): PAnsiChar; {TODO perhaps move to a separate inc file.}
   external 'StdCLib' name 'getenv';
 
 Function GetEnv(EnvVar: String): String;
 var
-  p: PChar;
+  p: PAnsiChar;
   name: String;
 Begin
   name:= EnvVar+#0;

+ 4 - 4
rtl/macos/macostp.inc

@@ -1068,7 +1068,7 @@ TYPE
 
   QDGlobalsPtr = ^QDGlobals;
   QDGlobals = RECORD
-    privates:        PACKED ARRAY [0..75] OF CHAR;
+    privates:        PACKED ARRAY [0..75] OF AnsiChar;
     randSeed:        LONGINT;                {  in Carbon use GetQDGlobalsRandomSeed }
     screenBits:        BitMap;                  {  in Carbon use GetQDGlobalsScreenBits }
     arrow:          Cursor;                  {  in Carbon use GetQDGlobalsArrow }
@@ -1306,7 +1306,7 @@ const
 
   TIOFLUSH = $00007408;       // discard unread input.  arg is ignored
 
-function c_open(path: PChar; oflag: C_int): C_int; cdecl;
+function c_open(path: PAnsiChar; oflag: C_int): C_int; cdecl;
   external 'StdCLib' name 'open';
 
 function c_close(filedes: C_int): C_int; cdecl;
@@ -1324,10 +1324,10 @@ function lseek(filedes: C_int; offset: off_t; whence: C_int): off_t; cdecl;
 function ioctl(filedes: C_int; cmd: C_unsigned_int; arg: pointer): C_int; cdecl;
   external 'StdCLib' name 'ioctl';
 
-function remove(filename: PChar): C_int; cdecl;
+function remove(filename: PAnsiChar): C_int; cdecl;
   external 'StdCLib';
 
-function c_rename(old, c_new: PChar): C_int; cdecl;
+function c_rename(old, c_new: PAnsiChar): C_int; cdecl;
   external 'StdCLib' name 'rename';
 
 procedure c_exit(status: C_int); cdecl;

+ 5 - 5
rtl/macos/sysfile.inc

@@ -40,7 +40,7 @@ begin
   {$endif}
 end;
 
-procedure do_erase(p : pchar; pchangeable: boolean);
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);
 
 var
   spec: FSSpec;
@@ -63,7 +63,7 @@ begin
     InOutRes:=res;
 end;
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);
 var
   s1,s2: RawByteString;
 begin
@@ -76,7 +76,7 @@ begin
   InOutRes:= PathArgToFullPath(p2, s2);
   if InOutRes <> 0 then
     exit;
-  c_rename(PChar(s1),PChar(s2));
+  c_rename(PAnsiChar(s1),PAnsiChar(s2));
   Errno2InoutRes;
   {$else}
   InOutRes:=1;
@@ -198,7 +198,7 @@ begin
   {$endif}
 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.
@@ -296,7 +296,7 @@ begin
           exit;
         end;
 
-      p:= PChar(fullPath);
+      p:= PAnsiChar(fullPath);
     end;
 
 

+ 6 - 6
rtl/macos/system.pp

@@ -35,8 +35,8 @@ const
  DriveSeparator = ':';
  ExtensionSeparator = '.';
  PathSeparator = ',';  {Is used in MPW and OzTeX}
- AllowDirectorySeparators : set of char = [':'];
- AllowDriveSeparators : set of char = [':'];
+ AllowDirectorySeparators : set of AnsiChar = [':'];
+ AllowDriveSeparators : set of AnsiChar = [':'];
  FileNameCaseSensitive = false;
  FileNameCasePreserving = true;
  CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
@@ -59,8 +59,8 @@ const
 
 var
   argc : longint;
-  argv : ppchar;
-  envp : ppchar;
+  argv : PPAnsiChar;
+  envp : PPAnsiChar;
 
 {*********************************}
 {**  MacOS specific functions    **}
@@ -255,9 +255,9 @@ procedure pascalmain; external name 'PASCALMAIN';
 {Main entry point in C style, needed to capture program parameters.
  For this to work, the system unit must be before the main program
  in the linking order.}
-procedure main(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public];
+procedure main(argcparam: Longint; argvparam: PPAnsiChar; envpparam: PPAnsiChar); cdecl; [public];
 {$else FPC_DARWIN_PASCALMAIN}
-procedure FPC_SYSTEMMAIN(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public];
+procedure FPC_SYSTEMMAIN(argcparam: Longint; argvparam: PPAnsiChar; envpparam: PPAnsiChar); cdecl; [public];
 {$endif FPC_DARWIN_PASCALMAIN}
 
 begin

+ 10 - 10
rtl/macos/sysutils.pp

@@ -243,7 +243,7 @@ begin
 end;
 
 (*
-Function LinuxToWinAttr (FN : Pchar; Const Info : Stat) : Longint;
+Function LinuxToWinAttr (FN : PAnsiChar; Const Info : Stat) : Longint;
 
 begin
   Result:=faArchive;
@@ -482,7 +482,7 @@ begin
   If Not FStat (FileName,Info) then
     Result:=-1
   Else
-    Result:=LinuxToWinAttr(Pchar(FileName),Info);
+    Result:=LinuxToWinAttr(PAnsiChar(FileName),Info);
   *)
 end;
 
@@ -529,7 +529,7 @@ end;
   They both return -1 when a failure occurs.
 }
 Const
-  FixDriveStr : array[0..3] of pchar=(
+  FixDriveStr : array[0..3] of PAnsiChar=(
     '.',
     '/fd0/.',
     '/fd1/.',
@@ -537,7 +537,7 @@ Const
     );
 var
   Drives   : byte;
-  DriveStr : array[4..26] of pchar;
+  DriveStr : array[4..26] of PAnsiChar;
 
 Procedure AddDisk(const path:string);
 begin
@@ -643,7 +643,7 @@ Function GetEnvironmentVariable(Const EnvVar : String) : String;
 
 begin
   (* TODO fix
-  Result:=Unix.Getenv(PChar(EnvVar));
+  Result:=Unix.Getenv(PAnsiChar(EnvVar));
   *)
 end;
 
@@ -662,7 +662,7 @@ begin
 end;
 
 { Create a DoScript AppleEvent that targets the given application with text as the direct object. }
-function CreateDoScriptEvent (applCreator: OSType; scriptText: PChar; var theEvent: AppleEvent): OSErr;
+function CreateDoScriptEvent (applCreator: OSType; scriptText: PAnsiChar; var theEvent: AppleEvent): OSErr;
 
   var
    err: OSErr;
@@ -698,13 +698,13 @@ begin
   if desc.descriptorType = FourCharCodeToLongword(typeChar) then
     begin
       HLock(desc.dataHandle);
-      Fpc_WriteBuffer(f, PChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
+      Fpc_WriteBuffer(f, PAnsiChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
       Flush(f);
       HUnLock(desc.dataHandle);
     end;
 end;
 
-function ExecuteToolserverScript(scriptText: PChar; var statusCode: Longint): OSErr;
+function ExecuteToolserverScript(scriptText: PAnsiChar; var statusCode: Longint): OSErr;
 
   var
     err: OSErr;
@@ -780,13 +780,13 @@ Begin
   {Make ToolServers working directory in sync with our working directory}
   PathArgToFullPath(':', wdpath);
   wdpath:= 'Directory ' + wdpath;
-  Result := ExecuteToolserverScript(PChar(wdpath), laststatuscode);
+  Result := ExecuteToolserverScript(PAnsiChar(wdpath), laststatuscode);
     {TODO Only change path when actually needed. But this requires some
      change counter to be incremented each time wd is changed. }
 
   s:= path + ' ' + comline;
 
-  Result := ExecuteToolserverScript(PChar(s), laststatuscode);
+  Result := ExecuteToolserverScript(PAnsiChar(s), laststatuscode);
   if Result = afpItemNotFound then
     Result := 900
   else