瀏覽代碼

* PChar -> PAnsiChar

Michaël Van Canneyt 2 年之前
父節點
當前提交
92df6c234b

+ 4 - 4
packages/graph/src/amiga/graph.pp

@@ -261,7 +261,7 @@ Procedure ClearViewPort;
 function GraphResult: Integer;
 
 { For compatibility }
-Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : String);
+Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : ShortString);
 Procedure CloseGraph;
 
 const
@@ -369,7 +369,7 @@ const
 
 const
   DoUseMarker: Boolean = true;
-  TheMarker: Char      = '~';
+  TheMarker: AnsiChar      = '~';
   TextColor: LongInt   = 15;
   MarkColor: LongInt   = 15;
   BackColor: LongInt   = 0;
@@ -412,7 +412,7 @@ var
   sFont, sColor:Word;
   sCharSpace: Integer;
 { Not used
-  sMarker: Char;
+  sMarker: AnsiChar;
   sAttr: Word; }
 
 { Bitmap utilities }
@@ -725,7 +725,7 @@ begin
    GetMaxY := GraphWin^.Height;
 end;
 
-Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : String);
+Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : ShortString);
 var
   thetags : array[0..3] of tTagItem;
 

+ 3 - 3
packages/graph/src/go32v2/graph.pp

@@ -139,9 +139,9 @@ const
     ALL_PLANES      =   $0F      ; { All Bit Planes Selected         }
     CHAR_BITS       =   $0F      ; { Bits 0-3 of Character Data      }
 
-    GET_CHAR_PTR    =   $01130   ; { VGA BIOS Func: Get Char Set     }
-    ROM_8x8_Lo      =   $03      ; { ROM 8x8 Char Set Lo Pointer     }
-    ROM_8x8_Hi      =   $04      ; { ROM 8x8 Char Set Hi Pointer     }
+    GET_CHAR_PTR    =   $01130   ; { VGA BIOS Func: Get AnsiChar Set     }
+    ROM_8x8_Lo      =   $03      ; { ROM 8x8 AnsiChar Set Lo Pointer     }
+    ROM_8x8_Hi      =   $04      ; { ROM 8x8 AnsiChar Set Hi Pointer     }
 
     { Constants Specific for these routines                          }
 

+ 2 - 2
packages/graph/src/go32v2/vesah.inc

@@ -22,9 +22,9 @@ TYPE
                                       {VESA modes are >=100h}
 
   TVESAinfo = packed record  { VESA Information request }
-    signature : array [1..4] of char;     { This should be VESA   }
+    signature : array [1..4] of AnsiChar;     { This should be VESA   }
     version   : word;                     { VESA revision         }
-    str       : pChar;                    { pointer to OEM string }
+    str       : PAnsiChar;                    { pointer to OEM string }
     caps      : longint;                  { video capabilities    }
     modeList  : pModeList;                { pointer to SVGA modes }
 (*    pad       : array [18..260] of byte;  { extra padding more then   }

+ 10 - 10
packages/graph/src/inc/graph.inc

@@ -23,19 +23,19 @@ const
 {$ifdef logging}
 var debuglog: text;
 
-function strf(l: longint): string;
+function strf(l: longint): ShortString;
 begin
   str(l, strf)
 end;
 
-Procedure Log(Const s: String);
+Procedure Log(Const s: ShortString);
 Begin
   Append(debuglog);
   Write(debuglog, s);
   Close(debuglog);
 End;
 
-Procedure LogLn(Const s: string);
+Procedure LogLn(Const s: ShortString);
 Begin
   Append(debuglog);
   Writeln(debuglog,s);
@@ -73,7 +73,7 @@ const
       TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE);
 
 const
-  BGIPath : string = '.';
+  BGIPath : ShortString = '.';
 
 
   { Default font 8x8 system from IBM PC }
@@ -146,7 +146,7 @@ var
   PaletteSize : longint; { Maximum palette entry we can set, usually equal}
                          { maxcolor.                                      }
   HardwarePages : byte;  { maximum number of hardware visual pages        }
-  DriverName: String;
+  DriverName: ShortString;
   DirectColor : Boolean ; { Is it a direct color mode? }
   ModeList : PModeInfo;
   newModeList: TNewModeInfo;
@@ -1339,7 +1339,7 @@ end;
    end;
 
 
-  procedure OutTextXYDefault(x,y : smallint;const TextString : string);forward;
+  procedure OutTextXYDefault(x,y : smallint;const TextString : ShortString);forward;
   procedure CircleDefault(X, Y: smallint; Radius:Word);forward;
   procedure SetBkColorDefault(ColorNum: ColorType);forward;
   function GetBkColorDefault: ColorType;forward;
@@ -1418,7 +1418,7 @@ end;
 
 {$i modes.inc}
 
-  function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): smallint;
+  function InstallUserDriver(Name: ShortString; AutoDetectPtr: Pointer): smallint;
    begin
      _graphResult := grError;
      InstallUserDriver:=grError;
@@ -1852,7 +1852,7 @@ end;
     end;
 
 
-function GraphErrorMsg(ErrorCode: smallint): string;
+function GraphErrorMsg(ErrorCode: smallint): ShortString;
 Begin
  GraphErrorMsg:='';
  case ErrorCode of
@@ -1906,7 +1906,7 @@ end;
      GetY := CurrentY;
    end;
 
-   Function GetDriverName: string;
+   Function GetDriverName: ShortString;
     begin
       GetDriverName:=DriverName;
     end;
@@ -2128,7 +2128,7 @@ end;
   end;
 
   procedure InitGraph(var GraphDriver:smallint;var GraphMode:smallint;
-    const PathToDriver:String);
+    const PathToDriver:ShortString);
   const
     dirchar = System.DirectorySeparator;
   begin

+ 11 - 11
packages/graph/src/inc/graph.tex

@@ -310,7 +310,7 @@ are also possible for those who wish to optimize the speed of the unit.
 -------------------------------------------------------------
 \begin{function}{GetModeName}
 \Declaration
-Function GetModeName (ModeNumber : smallint) : String;
+Function GetModeName (ModeNumber : smallint) : ShortString;
 
 \Description
 
@@ -800,7 +800,7 @@ None.
 
 \begin{function}{GetDriverName}
 \Declaration
-Function GetDriverName  : String;
+Function GetDriverName  : ShortString;
 
 \Description
 \var{GetDriverName} returns a string containing the name of the
@@ -1084,7 +1084,7 @@ None.
 
 \begin{function}{GraphErrorMsg}
 \Declaration
-Function GraphErrorMsg (ErrorCode : smallint) : String;
+Function GraphErrorMsg (ErrorCode : smallint) : ShortString;
 
 \Description
 \var{GraphErrorMsg}
@@ -1142,7 +1142,7 @@ None.
 \begin{procedure}{InitGraph}
 \Declaration
 Procedure InitGraph (var GraphDriver,GraphModus : smallint;\\
-const PathToDriver : string);
+const PathToDriver : ShortString);
 
 \Description
 
@@ -1184,7 +1184,7 @@ Example:
 \begin{verbatim}
 var
    gd,gm : smallint;
-   PathToDriver : string;
+   PathToDriver : ShortString;
 begin
    gd:=detect; { highest possible resolution }
    gm:=0; { not needed, auto detection }
@@ -1199,7 +1199,7 @@ end.
 
 \begin{function}{InstallUserDriver}
 \Declaration
-Function InstallUserDriver (DriverPath : String; AutoDetectPtr: Pointer) : smallint;
+Function InstallUserDriver (DriverPath : ShortString; AutoDetectPtr: Pointer) : smallint;
 
 \Description
 This routine is not supported in FPC, it is here only for compatiblity and
@@ -1212,7 +1212,7 @@ None.
 \end{function}
 \begin{function}{InstallUserFont}
 \Declaration
-Function InstallUserFont (FontPath : String) : smallint;
+Function InstallUserFont (FontPath : ShortString) : smallint;
 
 \Description
 \var{InstallUserFont} adds the font in \var{FontPath} to the list of fonts
@@ -1297,7 +1297,7 @@ None.
 \end{procedure}
 \begin{procedure}{OutText}
 \Declaration
-Procedure OutText (Const TextString : String);
+Procedure OutText (Const TextString : ShortString);
 
 \Description
 \var{OutText} puts \var{TextString} on the screen, at the current pointer
@@ -1317,7 +1317,7 @@ None.
 \end{procedure}
 \begin{procedure}{OutTextXY}
 \Declaration
-Procedure OutTextXY (X,Y : smallint; Const TextString : String);
+Procedure OutTextXY (X,Y : smallint; Const TextString : ShortString);
 
 \Description
 \var{OutText} puts \var{TextString} on the screen, at position \var{(X,Y)},
@@ -1889,7 +1889,7 @@ None.
 \end{procedure}
 \begin{function}{TextHeight}
 \Declaration
-Function TextHeight (S : String) : Word;
+Function TextHeight (S : ShortString) : Word;
 
 \Description
 \var{TextHeight} returns the height (in pixels) of the string \var{S} in
@@ -1902,7 +1902,7 @@ None.
 \end{function}
 \begin{function}{TextWidth}
 \Declaration
-Function TextWidth (S : String) : Word;
+Function TextWidth (S : ShortString) : Word;
 
 \Description
 \var{TextHeight} returns the width (in pixels) of the string \var{S} in

+ 11 - 11
packages/graph/src/inc/graphh.inc

@@ -591,7 +591,7 @@ TYPE
 
        SetAllPaletteProc = procedure(const Palette:PaletteType);
 
-       OutTextXYProc = procedure(x,y : SmallInt;const TextString : string);
+       OutTextXYProc = procedure(x,y : SmallInt;const TextString : ShortString);
 
        CircleProc = procedure(X, Y: smallint; Radius:Word);
 
@@ -688,7 +688,7 @@ VAR
 
 
 type
-  TCharsetTransTable = array[Char] of Char;
+  TCharsetTransTable = array[AnsiChar] of AnsiChar;
   PCharsetTransTable = ^TCharsetTransTable;
 
 const
@@ -741,12 +741,12 @@ function queryadapterinfo : pmodeinfo;
 
 Procedure Closegraph;
 procedure SetLineStyle(LineStyle: word; Pattern: word; Thickness: word);
-function  GraphErrorMsg(ErrorCode: smallint): string;
+function  GraphErrorMsg(ErrorCode: smallint): ShortString;
 Function  GetMaxX: smallint;
 Function  GetMaxY: smallint;
 Procedure SetViewPort(X1, Y1, X2, Y2: smallint; Clip: Boolean);
 Function  GraphResult: smallint;
-function  GetModeName(ModeNumber: smallint): string;
+function  GetModeName(ModeNumber: smallint): ShortString;
 procedure SetGraphMode(Mode: smallint);
 function GetGraphMode: smallint;
 function GetMaxMode: smallint;
@@ -762,13 +762,13 @@ procedure SetWriteModeEx(WriteMode : smallint);
 procedure GetFillSettings(var Fillinfo:Fillsettingstype);
 procedure GetFillPattern(var FillPattern:FillPatternType);
 procedure GetLineSettings(var ActiveLineInfo : LineSettingsType);
-procedure InitGraph(var GraphDriver:smallint;var GraphMode:smallint;const PathToDriver:String);
+procedure InitGraph(var GraphDriver:smallint;var GraphMode:smallint;const PathToDriver:ShortString);
 procedure DetectGraph(var GraphDriver:smallint;var GraphMode:smallint);
-function InstallUserDriver(Name: string; AutoDetectPtr: Pointer): smallint;
+function InstallUserDriver(Name: ShortString; AutoDetectPtr: Pointer): smallint;
 function RegisterBGIDriver(driver: pointer): smallint;
 procedure SetFillStyle(Pattern : word; Color: ColorType);
 procedure SetFillPattern(Pattern: FillPatternType; Color: ColorType);
-Function GetDriverName: string;
+Function GetDriverName: ShortString;
  procedure MoveRel(Dx, Dy: smallint);
  procedure MoveTo(X,Y: smallint);
 
@@ -810,15 +810,15 @@ Function GetDriverName: string;
    YRadius: word);
 
  { --------------------- Text related routines --------------------- }
- function  InstallUserFont(const FontFileName : string) : smallint;
+ function  InstallUserFont(const FontFileName : ShortString) : smallint;
  function  RegisterBGIfont(font : pointer) : smallint;
  procedure GetTextSettings(var TextInfo : TextSettingsType);
- function  TextHeight(const TextString : string) : word;
- function  TextWidth(const TextString : string) : word;
+ function  TextHeight(const TextString : ShortString) : word;
+ function  TextWidth(const TextString : ShortString) : word;
  procedure SetTextJustify(horiz,vert : word);
  procedure SetTextStyle(font,direction : word;charsize : word);
  procedure SetUserCharSize(Multx,Divx,Multy,Divy : word);
 
- procedure OutText(const TextString : string);
+ procedure OutText(const TextString : ShortString);
 
 

+ 31 - 31
packages/graph/src/inc/gtext.inc

@@ -26,7 +26,7 @@
 {      PFHeader = ^TFHeader;}
       TFHeader = packed record
          header_size: word;    {* Version 2.0 Header Format        *}
-         font_name: array[1..4] of char;
+         font_name: array[1..4] of AnsiChar;
          font_size: word;      {* Size in byte of file        *}
          font_major: byte;     {* Driver Version Information    *}
          font_minor: byte;
@@ -38,16 +38,16 @@
       { Font record information }
 {      PHeader = ^THeader;}
       THeader = packed record
-        Signature:  char;     { signature byte                        }
+        Signature:  AnsiChar;     { signature byte                        }
         Nr_chars:   smallint;  { number of characters in file          }
         Reserved:   byte;
         First_char: byte;     { first character in file               }
         cdefs :     smallint;  { offset to character definitions       }
-        scan_flag:  byte;     { TRUE if char is scanable              }
+        scan_flag:  byte;     { TRUE if AnsiChar is scanable              }
         org_to_cap: shortint;     { Height from origin to top of capitol  }
         org_to_base:shortint;     { Height from origin to baseline        }
         org_to_dec: shortint;     { Height from origin to bot of decender }
-        _reserved: array[1..4] of char;
+        _reserved: array[1..4] of AnsiChar;
         Unused: byte;
       end;
 
@@ -62,7 +62,7 @@
         offsets : TOffsetTable;
         widths : TWidthTable;
         instrlength: longint;    { length of instr, because instr can }
-        instr : pchar;           { contain null characters            }
+        instr : PAnsiChar;           { contain null characters            }
       end;
 
 
@@ -94,7 +94,7 @@ procedure swap_fheader(var h: tfheader);
 (*
       TFHeader = packed record
          header_size: word;    {* Version 2.0 Header Format        *}
-         font_name: array[1..4] of char;
+         font_name: array[1..4] of AnsiChar;
          font_size: word;      {* Size in byte of file        *}
          font_major: byte;     {* Driver Version Information    *}
          font_minor: byte;
@@ -113,16 +113,16 @@ end;
 procedure swap_header(var h: theader);
 (*
       THeader = packed record
-        Signature:  char;     { signature byte                        }
+        Signature:  AnsiChar;     { signature byte                        }
         Nr_chars:   smallint;  { number of characters in file          }
         Reserved:   byte;
         First_char: byte;     { first character in file               }
         cdefs :     smallint;  { offset to character definitions       }
-        scan_flag:  byte;     { TRUE if char is scanable              }
+        scan_flag:  byte;     { TRUE if AnsiChar is scanable              }
         org_to_cap: shortint;     { Height from origin to top of capitol  }
         org_to_base:shortint;     { Height from origin to baseline        }
         org_to_dec: shortint;     { Height from origin to bot of decender }
-        _reserved: array[1..4] of char;
+        _reserved: array[1..4] of AnsiChar;
         Unused: byte;
       end;
 *)
@@ -148,10 +148,10 @@ end;
 {$endif FPC_BIG_ENDIAN}
 
 
-function ConvertString(const OrigString: String): String;
+function ConvertString(const OrigString: ShortString): ShortString;
 var
   i: Integer;
-  ConvResult: String;
+  ConvResult: ShortString;
 begin
   if GraphStringTransTable = nil then
     ConvertString := OrigString
@@ -165,7 +165,7 @@ begin
 end;
 
 
-    function testfont(p : pchar) : boolean;
+    function testfont(p : PAnsiChar) : boolean;
 
       begin
          testfont:=(p[0]='P') and
@@ -175,7 +175,7 @@ end;
       end;
 
 
-    function InstallUserFont(const FontFileName : string) : smallint;
+    function InstallUserFont(const FontFileName : ShortString) : smallint;
 
       begin
          _graphresult:=grOk;
@@ -194,7 +194,7 @@ end;
       end;
 
 
-    function Decode(byte1,byte2: char; var x,y: smallint): smallint;
+    function Decode(byte1,byte2: AnsiChar; var x,y: smallint): smallint;
     { This routines decoes a signle word in a font opcode section  }
     { to a stroke record.                                          }
       var
@@ -224,7 +224,7 @@ end;
      end;
 
 
-    function unpack(buf: pchar; index: smallint; var Stroke: TStrokes): smallint;
+    function unpack(buf: PAnsiChar; index: smallint; var Stroke: TStrokes): smallint;
 
      var
 {$ifdef CPU16}
@@ -250,7 +250,7 @@ end;
            Inc(num_ops);  {* Count the operation                *}
            opcode := decode( buf[counter], buf[counter+1] ,jx, jy );
            Inc(counter,2);
-           if( opcode = ord(_END_OF_CHAR) ) then break; {* Exit loop at end of char     *}
+           if( opcode = ord(_END_OF_CHAR) ) then break; {* Exit loop at end of AnsiChar     *}
          end;
 
        counter:=index;
@@ -276,7 +276,7 @@ end;
 
 
 
-    procedure GetTextPosition(var xpos,ypos: longint; const TextString: string);
+    procedure GetTextPosition(var xpos,ypos: longint; const TextString: ShortString);
      begin
          if CurrentTextInfo.Font = DefaultFont then
           begin
@@ -344,12 +344,12 @@ end;
     function RegisterBGIfont(font : pointer) : smallint;
 
       var
-         hp : pchar;
+         hp : PAnsiChar;
          b : word;
          i: longint;
          Header: THeader;
          counter: longint;
-         FontData: pchar;
+         FontData: PAnsiChar;
          FHeader: TFHeader;
       begin
          RegisterBGIfont:=grInvalidFontNum;
@@ -357,7 +357,7 @@ end;
          { Check if the font header is valid first of all }
          if testfont(font) then
            begin
-              hp:=pchar(font);
+              hp:=PAnsiChar(font);
               { Move to EOF in prefix header }
               while (hp[i] <> chr($1a)) do Inc(i);
               System.move(hp[i+1],FHeader,sizeof(FHeader));
@@ -385,7 +385,7 @@ end;
                         { allocate also space for null }
                         GetMem(FontData,Counter+1);
                         System.move(hp[i],FontData^,Counter);
-                        { Null terminate the string }
+                        { Null terminate the ShortString }
                         FontData[counter+1] := #0;
                         if fonts[b].header.Signature<> SIGNATURE then
                           begin
@@ -413,7 +413,7 @@ end;
 
 
 
-    function TextHeight(const TextString : string) : word;
+    function TextHeight(const TextString : ShortString) : word;
 
       begin
          if Currenttextinfo.font=DefaultFont
@@ -423,10 +423,10 @@ end;
                 fonts[Currenttextinfo.font].header.org_to_dec) * CurrentYRatio);
       end;
 
-    function TextWidth(const TextString : string) : word;
+    function TextWidth(const TextString : ShortString) : word;
       var i,x : smallint;
           c   : byte;
-          s   : String;
+          s   : ShortString;
       begin
          x := 0;
          { if this is the default font ... }
@@ -448,14 +448,14 @@ end;
             end;
       end;
 
-    procedure OutTextXYDefault(x,y : smallint;const TextString : string);
+    procedure OutTextXYDefault(x,y : smallint;const TextString : ShortString);
 
       type
        Tpoint = record
          X,Y: smallint;
        end;
       var
-         ConvString    : String;
+         ConvString    : ShortString;
          i,j,k,c       : longint;
          xpos,ypos     : longint;
          counter       : longint;
@@ -467,7 +467,7 @@ end;
          oldvalues     : linesettingstype;
          fontbitmap    : TBitmapChar;
          fontbitmapbyte: byte;
-         chr           : char;
+         chr           : AnsiChar;
          curx2i,cury2i,
          xpos2i,ypos2i : longint;
 
@@ -698,7 +698,7 @@ end;
       end;
 
 
-    procedure OutText(const TextString : string);
+    procedure OutText(const TextString : ShortString);
       var x,y:smallint;
       begin
          { Save CP }
@@ -737,10 +737,10 @@ end;
 
       var
          f : file;
-         Prefix: array[0..Prefix_Size-1] of char; {* File Prefix Holder         *}
+         Prefix: array[0..Prefix_Size-1] of AnsiChar; {* File Prefix Holder         *}
          Length, Current: longint;
-         FontData: Pchar;
-         hp  : pchar;
+         FontData: PAnsiChar;
+         hp  : PAnsiChar;
          i   : longint;
       begin
          if font>installedfonts then

+ 1 - 1
packages/graph/src/inc/modes.inc

@@ -319,7 +319,7 @@ end;
 {                          External routines                            }
 {-----------------------------------------------------------------------}
 
-   function GetModeName(ModeNumber: smallint): string;
+   function GetModeName(ModeNumber: smallint): ShortString;
   {********************************************************}
   { Function GetModeName()                                 }
   {--------------------------------------------------------}

+ 6 - 6
packages/graph/src/macosx/graph.pp

@@ -985,7 +985,7 @@ end;
    end;
 
 
-  function toval(const s: string): size_t;
+  function toval(const s: ShortString): size_t;
     var
       err: longint;
     begin
@@ -1004,7 +1004,7 @@ end;
   { Returns nil if no graphics mode supported.        }
   { This list is READ ONLY!                           }
    var
-     colorstr: string;
+     colorstr: ShortString;
      i, hpos, cpos : longint;
      xres, yres, colors,
      dispxres, dispyres: longint;
@@ -1107,11 +1107,11 @@ type
   pmainparas = ^tmainparas;
   tmainparas = record
     argc: cint;
-    argv: ppchar;
-    envp: ppchar;
+    argv: PPAnsiChar;
+    envp: PPAnsiChar;
   end;
 
-procedure FPCMacOSXGraphMain(argcpara: cint; argvpara, envppara: ppchar); cdecl; external;
+procedure FPCMacOSXGraphMain(argcpara: cint; argvpara, envppara: PPAnsiChar); cdecl; external;
 
 function wrapper(p: pointer): pointer; cdecl;
   var
@@ -1126,7 +1126,7 @@ function wrapper(p: pointer): pointer; cdecl;
 
 { this routine runs before the rtl is initialised, so don't call any }
 { rtl routines in it                                                 }
-procedure main(argcpara: cint; argvpara, envppara: ppchar); cdecl; [public];
+procedure main(argcpara: cint; argvpara, envppara: PPAnsiChar); cdecl; [public];
   var
     eventRec: eventrecord;
     graphmainthread: TThreadID;

+ 3 - 3
packages/graph/src/msdos/graph.pp

@@ -132,9 +132,9 @@ const
     ALL_PLANES      =   $0F      ; { All Bit Planes Selected         }
     CHAR_BITS       =   $0F      ; { Bits 0-3 of Character Data      }
 
-    GET_CHAR_PTR    =   $01130   ; { VGA BIOS Func: Get Char Set     }
-    ROM_8x8_Lo      =   $03      ; { ROM 8x8 Char Set Lo Pointer     }
-    ROM_8x8_Hi      =   $04      ; { ROM 8x8 Char Set Hi Pointer     }
+    GET_CHAR_PTR    =   $01130   ; { VGA BIOS Func: Get AnsiChar Set     }
+    ROM_8x8_Lo      =   $03      ; { ROM 8x8 AnsiChar Set Lo Pointer     }
+    ROM_8x8_Hi      =   $04      ; { ROM 8x8 AnsiChar Set Hi Pointer     }
 
     { Constants Specific for these routines                          }
 

+ 2 - 2
packages/graph/src/msdos/vesah.inc

@@ -16,14 +16,14 @@
 
 
 TYPE
-  pFarChar = ^char;far;
+  pFarChar = ^AnsiChar;far;
 
   pModeList = ^tModeList;far;
   tModeList = Array [0..255] of word; {list of modes terminated by -1}
                                       {VESA modes are >=100h}
 
   TVESAinfo = packed record  { VESA Information request }
-    signature : array [1..4] of char;     { This should be VESA   }
+    signature : array [1..4] of AnsiChar;     { This should be VESA   }
     version   : word;                     { VESA revision         }
     str       : pFarChar;                 { pointer to OEM string }
     caps      : longint;                  { video capabilities    }

+ 6 - 6
packages/graph/src/ptcgraph/ptccrt.pp

@@ -43,7 +43,7 @@ var
   KeyMode: TKeyMode = kmTP7;
 
 function KeyPressed: Boolean;
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 procedure ClrScr;
 procedure ClrEol;
 procedure GotoXY(X, Y: tcrtcoord);
@@ -71,7 +71,7 @@ begin
 end;
 
 var
-  KeyBuffer: array[0..64] of Char;
+  KeyBuffer: array[0..64] of AnsiChar;
   KeyBufHead, KeyBufTail: Integer;
 
 function KeyBufEmpty: Boolean;
@@ -79,7 +79,7 @@ begin
   Result := KeyBufHead = KeyBufTail;
 end;
 
-procedure KeyBufAdd(Ch: Char);
+procedure KeyBufAdd(Ch: AnsiChar);
 begin
   { do nothing, if the buffer is full }
   if ((KeyBufTail + 1) = KeyBufHead) or
@@ -91,7 +91,7 @@ begin
     KeyBufTail := Low(KeyBuffer);
 end;
 
-procedure KeyBufAdd(S: String);
+procedure KeyBufAdd(S: ShortString);
 var
   I: Integer;
 begin
@@ -99,7 +99,7 @@ begin
     KeyBufAdd(S[I]);
 end;
 
-function KeyBufGet: Char;
+function KeyBufGet: AnsiChar;
 begin
   if KeyBufHead <> KeyBufTail then
   begin
@@ -550,7 +550,7 @@ begin
   end;
 end;
 
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 {$IFDEF UNIX}
 var
   req, rem: TTimeSpec;

+ 2 - 2
packages/graph/src/ptcgraph/ptcgraph.pp

@@ -279,7 +279,7 @@ const
      chiptype,           { Chiptype detected }
      memory,             { videomemory in KB }
      linewidth_unit: Longint;    { Use only a multiple of this as parameter for                                   set_displaystart }
-     linear_aperture: PChar;     { points to mmap secondary mem aperture of card }
+     linear_aperture: PAnsiChar;     { points to mmap secondary mem aperture of card }
      aperture_size: Longint;     { size of aperture in KB if size>=videomemory.}
 
      set_aperture_page: procedure (page: Longint);
@@ -604,7 +604,7 @@ begin
   CurrentCGABkColor := 0;
 end;
 
-procedure ptc_InternalOpen(const ATitle: string; AWidth, AHeight: Integer; AFormat: IPTCFormat; AVirtualPages: Integer);
+procedure ptc_InternalOpen(const ATitle: ShortString; AWidth, AHeight: Integer; AFormat: IPTCFormat; AVirtualPages: Integer);
 var
   ConsoleWidth, ConsoleHeight: Integer;
 begin

+ 3 - 3
packages/graph/src/unix/ggigraph.pp

@@ -119,7 +119,7 @@ const
 
 const
   GLASTMODE         = 49;
-  ModeNames: array[0..GLastMode] of PChar =
+  ModeNames: array[0..GLastMode] of PAnsiChar =
    ('[]',                       {Let GGI choose a default mode}
     'S320x200[GT_4BIT]',
     'S640x200[GT_4BIT]',
@@ -202,9 +202,9 @@ const
   libggi = 'ggi';
 function  ggiInit: Longint; cdecl; external libggi;
 procedure ggiExit; cdecl; external libggi;
-function  ggiOpen(display: PChar; args: Array of const): TGGIVisual; cdecl; external libggi;
+function  ggiOpen(display: PAnsiChar; args: Array of const): TGGIVisual; cdecl; external libggi;
 function  ggiClose(vis: TGGIVisual): Longint; cdecl; external libggi;
-function  ggiParseMode(s: PChar; var m: TGGIMode): Longint; cdecl; external libggi;
+function  ggiParseMode(s: PAnsiChar; var m: TGGIMode): Longint; cdecl; external libggi;
 function  ggiSetMode(visual: TGGIVisual; var tm: TGGIMode): Longint; cdecl; external libggi;
 function  ggiGetMode(visual: TGGIVisual; var tm: TGGIMode): Longint; cdecl; external libggi;
 function  ggiCheckMode(visual: TGGIVisual; var tm: TGGIMode): Longint; cdecl; external libggi;

+ 2 - 2
packages/graph/src/unix/graph.pp

@@ -135,7 +135,7 @@ Const
      chiptype,           { Chiptype detected }
      memory,             { videomemory in KB }
      linewidth_unit: Longint;    { Use only a multiple of this as parameter for                                   set_displaystart }
-     linear_aperture: PChar;     { points to mmap secondary mem aperture of card }
+     linear_aperture: PAnsiChar;     { points to mmap secondary mem aperture of card }
      aperture_size: Longint;     { size of aperture in KB if size>=videomemory.}
 
      set_aperture_page: procedure (page: Longint);
@@ -167,7 +167,7 @@ Const
 
 Const
   GLASTMODE         = 49;
-  ModeNames : Array[0..GLastMode] of string [18] =
+  ModeNames : Array[0..GLastMode] of String [18] =
    ('Text',
     'G320x200x16',
     'G640x200x16',

+ 3 - 3
packages/graph/src/win32/graph.pp

@@ -72,7 +72,7 @@ uses
     { handle double clicks on it's own }
     graphwindowstyle : DWord = cs_hRedraw or cs_vRedraw;
 
-    windowtitle : pchar = 'Graph window application';
+    windowtitle : PAnsiChar = 'Graph window application';
     menu : hmenu = 0;
     icon : hicon = 0;
     drawtoscreen : boolean = true;
@@ -315,7 +315,7 @@ var
    bitmapfontverticalcache : array[0..255] of HBITMAP;
    bitmapfonthorizoncache : array[0..255] of HBITMAP;
 
-procedure OutTextXYWin32GUI(x,y : smallint;const TextString : string);
+procedure OutTextXYWin32GUI(x,y : smallint;const TextString : ShortString);
 
   type
    Tpoint = record
@@ -333,7 +333,7 @@ procedure OutTextXYWin32GUI(x,y : smallint;const TextString : string);
      oldvalues     : linesettingstype;
      fontbitmap    : TBitmapChar;
      fontbitmapbyte: byte;
-     chr           : char;
+     chr           : AnsiChar;
      curx2i,cury2i,
      xpos2i,ypos2i : longint;
      charbitmap,oldcharbitmap : HBITMAP;

+ 5 - 5
packages/graph/src/win32/wincrt.pp

@@ -18,7 +18,7 @@ unit WinCRT;
 
   interface
 
-    function readkey : char;
+    function readkey : AnsiChar;
     function keypressed : boolean;
     procedure delay(ms : word);
 
@@ -49,7 +49,7 @@ unit WinCRT;
 
     var
        keyboardhandling : TCriticalSection;
-       keybuffer : array[1..keybuffersize] of char;
+       keybuffer : array[1..keybuffersize] of AnsiChar;
        nextfree,nexttoread : longint;
 
     procedure inccyclic(var i : longint);
@@ -60,7 +60,7 @@ unit WinCRT;
            i:=1;
       end;
 
-    procedure addchar(c : char);
+    procedure addchar(c : AnsiChar);
 
       begin
          EnterCriticalSection(keyboardhandling);
@@ -78,7 +78,7 @@ unit WinCRT;
          LeaveCriticalSection(keyboardhandling);
       end;
 
-    function readkey : char;
+    function readkey : AnsiChar;
 
       begin
          while true do
@@ -127,7 +127,7 @@ unit WinCRT;
       begin
       end;
 
-    procedure addextchar(c : char);
+    procedure addextchar(c : AnsiChar);
 
       begin
          addchar(#0);

+ 1 - 1
packages/graph/tests/polytest.pas

@@ -43,7 +43,7 @@ end;
 procedure Tralala;
 var
   I: Integer;
-  IStr: string;
+  IStr: shortstring;
 begin
   if ParamStr(1) <> '' then
     Assign(InF, ParamStr(1))