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. }
 { 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
   var
    err: OSErr;
    err: OSErr;
@@ -220,13 +220,13 @@ begin
   if desc.descriptorType = FourCharCodeToLongword(typeChar) then
   if desc.descriptorType = FourCharCodeToLongword(typeChar) then
     begin
     begin
       HLock(desc.dataHandle);
       HLock(desc.dataHandle);
-      Fpc_WriteBuffer(f, PChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
+      Fpc_WriteBuffer(f, PAnsiChar(desc.dataHandle^)^, GetHandleSize(desc.dataHandle));
       Flush(f);
       Flush(f);
       HUnLock(desc.dataHandle);
       HUnLock(desc.dataHandle);
     end;
     end;
 end;
 end;
 
 
-function ExecuteToolserverScript(scriptText: PChar; var statusCode: Longint): OSErr;
+function ExecuteToolserverScript(scriptText: PAnsiChar; var statusCode: Longint): OSErr;
 
 
   var
   var
     err: OSErr;
     err: OSErr;
@@ -301,13 +301,13 @@ Begin
   {Make ToolServers working directory in sync with our working directory}
   {Make ToolServers working directory in sync with our working directory}
   PathArgToFullPath(':', wdpath);
   PathArgToFullPath(':', wdpath);
   wdpath:= 'Directory ''' + 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
     {TODO Only change path when actually needed. But this requires some
      change counter to be incremented each time wd is changed. }
      change counter to be incremented each time wd is changed. }
 
 
   s:= path + ' ' + comline;
   s:= path + ' ' + comline;
 
 
-  err:= ExecuteToolserverScript(PChar(s), LastDosExitCode);
+  err:= ExecuteToolserverScript(PAnsiChar(s), LastDosExitCode);
   if err = afpItemNotFound then
   if err = afpItemNotFound then
     DosError := 900
     DosError := 900
   else
   else
@@ -906,7 +906,7 @@ End;
 Function EnvCount: Longint;
 Function EnvCount: Longint;
 var
 var
   envcnt : longint;
   envcnt : longint;
-  p      : ppchar;
+  p      : PPAnsiChar;
 Begin
 Begin
   envcnt:=0;
   envcnt:=0;
   p:=envp;      {defined in system}
   p:=envp;      {defined in system}
@@ -923,7 +923,7 @@ Function EnvStr (Index: longint): String;
 
 
 Var
 Var
   i : longint;
   i : longint;
-  p : ppchar;
+  p : PPAnsiChar;
 Begin
 Begin
   if Index <= 0 then
   if Index <= 0 then
     envstr:=''
     envstr:=''
@@ -944,12 +944,12 @@ Begin
 end;
 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';
   external 'StdCLib' name 'getenv';
 
 
 Function GetEnv(EnvVar: String): String;
 Function GetEnv(EnvVar: String): String;
 var
 var
-  p: PChar;
+  p: PAnsiChar;
   name: String;
   name: String;
 Begin
 Begin
   name:= EnvVar+#0;
   name:= EnvVar+#0;

+ 4 - 4
rtl/macos/macostp.inc

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

+ 5 - 5
rtl/macos/sysfile.inc

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

+ 6 - 6
rtl/macos/system.pp

@@ -35,8 +35,8 @@ const
  DriveSeparator = ':';
  DriveSeparator = ':';
  ExtensionSeparator = '.';
  ExtensionSeparator = '.';
  PathSeparator = ',';  {Is used in MPW and OzTeX}
  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;
  FileNameCaseSensitive = false;
  FileNameCasePreserving = true;
  FileNameCasePreserving = true;
  CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
  CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
@@ -59,8 +59,8 @@ const
 
 
 var
 var
   argc : longint;
   argc : longint;
-  argv : ppchar;
-  envp : ppchar;
+  argv : PPAnsiChar;
+  envp : PPAnsiChar;
 
 
 {*********************************}
 {*********************************}
 {**  MacOS specific functions    **}
 {**  MacOS specific functions    **}
@@ -255,9 +255,9 @@ procedure pascalmain; external name 'PASCALMAIN';
 {Main entry point in C style, needed to capture program parameters.
 {Main entry point in C style, needed to capture program parameters.
  For this to work, the system unit must be before the main program
  For this to work, the system unit must be before the main program
  in the linking order.}
  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}
 {$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}
 {$endif FPC_DARWIN_PASCALMAIN}
 
 
 begin
 begin

+ 10 - 10
rtl/macos/sysutils.pp

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