diff --git a/rtl/msxdos/sysdir.inc b/rtl/msxdos/sysdir.inc index b9ea20d801..9973020d40 100644 --- a/rtl/msxdos/sysdir.inc +++ b/rtl/msxdos/sysdir.inc @@ -97,7 +97,7 @@ end; procedure do_GetDir (DriveNr: byte; var Dir: RawByteString); {$ifdef todo} var - temp : array[0..260] of char; + temp : array[0..260] of AnsiChar; i : integer; regs : Registers; {$endif} @@ -115,7 +115,7 @@ begin if (regs.Flags and fCarry) <> 0 then Begin GetInOutRes (regs.AX); - Dir := char (DriveNr + 64) + ':\'; + Dir := AnsiChar (DriveNr + 64) + ':\'; SetCodePage (Dir,DefaultFileSystemCodePage,false); exit; end @@ -139,7 +139,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 } diff --git a/rtl/msxdos/sysfile.inc b/rtl/msxdos/sysfile.inc index 95c2a6184f..e6a7b98801 100644 --- a/rtl/msxdos/sysfile.inc +++ b/rtl/msxdos/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; verbose_files : boolean = true; @@ -68,10 +68,10 @@ begin end; -procedure do_erase(p : pchar; pchangeable: boolean); +procedure do_erase(p : PAnsiChar; pchangeable: boolean); var regs: Registers; - oldp: pchar; + oldp: PAnsiChar; begin oldp := p; DoDirSeparators(p, pchangeable); @@ -86,10 +86,10 @@ begin end; -procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean); +procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean); var regs: Registers; - oldp1, oldp2: pchar; + oldp1, oldp2: PAnsiChar; begin oldp1 := p1; oldp2 := p2; @@ -228,7 +228,7 @@ begin GetInOutRes(regs.A);} 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. @@ -239,7 +239,7 @@ procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean); var regs : Registers; action : word; - oldp : pchar; + oldp : PAnsiChar; begin {$ifdef SYSTEMDEBUG} if verbose_files then diff --git a/rtl/msxdos/sysheap.inc b/rtl/msxdos/sysheap.inc index ef071af300..20c3f1257a 100644 --- a/rtl/msxdos/sysheap.inc +++ b/rtl/msxdos/sysheap.inc @@ -24,11 +24,11 @@ { Internal structure used by MSDOS } type MCB = packed record - sig : char; + sig : AnsiChar; psp : 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; PMCB = ^MCB; {$endif def DEBUG_TINY_HEAP} diff --git a/rtl/msxdos/system.pp b/rtl/msxdos/system.pp index 845c175b7d..350f0632df 100644 --- a/rtl/msxdos/system.pp +++ b/rtl/msxdos/system.pp @@ -22,12 +22,12 @@ interface systemh.inc is included otherwise the $mode switch is not effective } -{ Use Ansi Char for files } +{ Use AnsiChar for files } {$define FPC_ANSI_TEXTFILEREC} {$define FPC_STDOUT_TRUE_ALIAS} {$ifdef NO_WIDESTRINGS} - { Do NOT use wide Char for files } + { Do NOT use widechar for files } {$undef FPC_HAS_FEATURE_WIDESTRINGS} {$endif NO_WIDESTRINGS} @@ -52,8 +52,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; @@ -80,7 +80,7 @@ var meml : array[0..($7fff div sizeof(longint))-1] of longint absolute $0; { C-compatible arguments and environment } 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) } PrefixSeg:Word;public name '__fpc_PrefixSeg'; @@ -98,7 +98,7 @@ const implementation -procedure DebugWrite(s: PChar); forward; +procedure DebugWrite(s: PAnsiChar); forward; procedure DebugWrite(const S: string); forward; procedure DebugWriteLn(const S: string); forward; @@ -120,7 +120,7 @@ const type PFarByte = ^Byte;//far; - PFarChar = ^Char;//far; + PFarChar = ^AnsiChar;//far; PFarWord = ^Word;//far; PPFarChar = ^PFarChar; {$endif} @@ -135,7 +135,7 @@ var __stktop : pointer;public name '__stktop'; dos_version:Word;public name 'dos_version'; 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} @@ -258,7 +258,7 @@ function CheckNullArea: Boolean; external name 'FPC_CHECK_NULLAREA'; {$endif FPC_HAS_FEATURE_SOFTFPU} {$endif FPUNONE} -procedure DebugWrite(S: PChar); +procedure DebugWrite(S: PAnsiChar); var regs: Registers; begin @@ -293,7 +293,7 @@ end; *****************************************************************************} var - internal_envp : PPChar = nil; + internal_envp : PPAnsiChar = nil; procedure setup_environment; {$ifdef todo} @@ -338,14 +338,14 @@ begin {$endif} end; -function envp:PPChar;public name '__fpc_envp'; +function envp:PPAnsiChar;public name '__fpc_envp'; begin if not assigned(internal_envp) then setup_environment; envp:=internal_envp; end; -function GetEnvVar(aName: PChar): String; +function GetEnvVar(aName: PAnsiChar): String; var regs: Registers; i: SizeInt; @@ -359,7 +359,7 @@ begin MsxDos(regs); if regs.A = 0 then begin i := 1; - aName := PChar(@Result[1]); + aName := PAnsiChar(@Result[1]); while i < 256 do begin if aName^ = #0 then begin SetLength(Result, i); @@ -375,12 +375,12 @@ end; procedure setup_arguments; var i: SmallInt; - pc: PChar; - quote: Char; + pc: PAnsiChar; + quote: AnsiChar; count: 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 } tmp: String; regs: Registers; @@ -420,7 +420,7 @@ begin begin if quote<>'''' then begin - if pchar(pc+1)^<>'"' then + if PAnsiChar(pc+1)^<>'"' then begin if quote='"' then quote:=' ' @@ -437,7 +437,7 @@ begin begin if quote<>'"' then begin - if pchar(pc+1)^<>'''' then + if PAnsiChar(pc+1)^<>'''' then begin if quote='''' then quote:=' ' @@ -461,7 +461,7 @@ begin Writeln(stderr,'Arg count: ', count, ', size: ', arglen); { set argc and allocate argv } argc:=count; - argv:=AllocMem((count+1)*SizeOf(PChar)); + argv:=AllocMem((count+1)*SizeOf(PAnsiChar)); { allocate a single memory block for all arguments } argblock:=GetMem(arglen); writeln('Allocated arg vector at ', hexstr(argv), ' and block at ', hexstr(argblock)); @@ -505,7 +505,7 @@ begin begin if quote<>'''' then begin - if pchar(pc+1)^<>'"' then + if PAnsiChar(pc+1)^<>'"' then begin if quote='"' then quote:=' ' @@ -525,7 +525,7 @@ begin begin if quote<>'"' then begin - if pchar(pc+1)^<>'''' then + if PAnsiChar(pc+1)^<>'''' then begin if quote='''' then quote:=' '