Selaa lähdekoodia

* PChar -> PAnsichar

Michaël Van Canneyt 2 vuotta sitten
vanhempi
commit
98ea5cddda
61 muutettua tiedostoa jossa 348 lisäystä ja 283 poistoa
  1. 6 6
      packages/ide/fakegdb/gdbcon.pas
  2. 11 11
      packages/ide/fakegdb/gdbint.pas
  3. 1 1
      packages/ide/fp.pas
  4. 2 2
      packages/ide/fpcalc.pas
  5. 1 0
      packages/ide/fpcodcmp.pas
  6. 1 0
      packages/ide/fpcodtmp.pas
  7. 2 0
      packages/ide/fpconst.pas
  8. 2 2
      packages/ide/fpcygwin.pas
  9. 14 12
      packages/ide/fpdebug.pas
  10. 6 4
      packages/ide/fpdesk.pas
  11. 3 1
      packages/ide/fpdpansi.pas
  12. 2 0
      packages/ide/fpevalw.pas
  13. 2 1
      packages/ide/fphelp.pas
  14. 2 2
      packages/ide/fpide.pas
  15. 2 2
      packages/ide/fpini.pas
  16. 1 0
      packages/ide/fpintf.pas
  17. 2 0
      packages/ide/fpkeys.pas
  18. 11 3
      packages/ide/fpmake.pp
  19. 1 0
      packages/ide/fpmtools.inc
  20. 1 0
      packages/ide/fpredir.pas
  21. 10 9
      packages/ide/fpregs.pas
  22. 9 8
      packages/ide/fpswitch.pas
  23. 5 5
      packages/ide/fpsymbol.pas
  24. 3 1
      packages/ide/fptemplt.pas
  25. 7 7
      packages/ide/fptools.pas
  26. 3 3
      packages/ide/fpusrscr.pas
  27. 6 4
      packages/ide/fputils.pas
  28. 18 18
      packages/ide/fpviews.pas
  29. 3 3
      packages/ide/gdbmicon.pas
  30. 24 24
      packages/ide/gdbmiint.pas
  31. 3 3
      packages/ide/gdbmiproc.pas
  32. 4 2
      packages/ide/gdbmiwrap.pas
  33. 2 0
      packages/ide/globdir.inc
  34. 2 0
      packages/ide/pmode.pas
  35. 3 2
      packages/ide/test.pas
  36. 1 0
      packages/ide/test1.pas
  37. 1 0
      packages/ide/test2.pas
  38. 3 2
      packages/ide/vesa.pas
  39. 22 20
      packages/ide/wansi.pas
  40. 1 1
      packages/ide/wcedit.pas
  41. 1 1
      packages/ide/wchmhwrap.pas
  42. 2 0
      packages/ide/wconsole.pas
  43. 2 1
      packages/ide/wconsts.pas
  44. 36 36
      packages/ide/weditor.pas
  45. 6 5
      packages/ide/whelp.pas
  46. 2 1
      packages/ide/whlpview.pas
  47. 6 5
      packages/ide/whtml.pas
  48. 10 9
      packages/ide/whtmlhlp.pas
  49. 3 2
      packages/ide/whtmlscn.pas
  50. 12 12
      packages/ide/winclip.pas
  51. 4 2
      packages/ide/windebug.pas
  52. 6 5
      packages/ide/wini.pas
  53. 7 6
      packages/ide/wnghelp.pas
  54. 8 7
      packages/ide/woahelp.pas
  55. 8 6
      packages/ide/wos2help.pas
  56. 1 0
      packages/ide/wresourc.pas
  57. 2 0
      packages/ide/wtphwrit.pas
  58. 16 15
      packages/ide/wutils.pas
  59. 6 6
      packages/ide/wviews.pas
  60. 2 1
      packages/ide/wvphelp.pas
  61. 5 4
      packages/ide/wwinhelp.pas

+ 6 - 6
packages/ide/fakegdb/gdbcon.pas

@@ -11,8 +11,8 @@ uses
 type
   PGDBController=^TGDBController;
   TGDBController=object(TGDBInterface)
-    progname   : pchar;
-    progargs   : pchar;
+    progname   : PAnsiChar;
+    progargs   : PAnsiChar;
     in_command,
     init_count : longint;
     constructor Init;
@@ -31,8 +31,8 @@ type
     { needed for dos because newlines are only #10 (PM) }
     procedure WriteErrorBuf;
     procedure WriteOutputBuf;
-    function  GetOutput : Pchar;
-    function  GetError : Pchar;
+    function  GetOutput : PAnsiChar;
+    function  GetError : PAnsiChar;
     function  LoadFile(const fn:string):boolean;
     procedure SetDir(const s : string);
     procedure SetArgs(const s : string);
@@ -151,13 +151,13 @@ begin
 end;
 
 
-function  TGDBController.GetOutput : Pchar;
+function  TGDBController.GetOutput : PAnsiChar;
 begin
   GetOutput:=nil;
 end;
 
 
-function  TGDBController.GetError : Pchar;
+function  TGDBController.GetError : PAnsiChar;
 begin
   GetError:=nil;
 end;

+ 11 - 11
packages/ide/fakegdb/gdbint.pas

@@ -15,15 +15,15 @@ type
   psyminfo=^tsyminfo;
   tsyminfo=record
     address  : longint;
-    fname    : pchar;
+    fname    : PAnsiChar;
     line     : longint;
-    funcname : pchar;
+    funcname : PAnsiChar;
   end;
 
   tframeentry = object
-    file_name : pchar;
-    function_name : pchar;
-    args : pchar;
+    file_name : PAnsiChar;
+    function_name : PAnsiChar;
+    args : PAnsiChar;
     line_number : longint;
     address : longint;
     constructor init;
@@ -35,14 +35,14 @@ type
   ppframeentry=^pframeentry;
 
   tgdbbuffer=object
-    buf   : pchar;
+    buf   : PAnsiChar;
     size,
     idx   : longint;
     constructor Init;
     destructor  Done;
     procedure Reset;
     procedure Resize(nsize : longint);
-    procedure Append(p:pchar);
+    procedure Append(p:PAnsiChar);
   end;
 
   PGDBInterface=^TGDBInterface;
@@ -76,13 +76,13 @@ type
     line_start,
     line_end : longint;
     signal_name,
-    signal_string : pchar;
+    signal_string : PAnsiChar;
     current_pc      : CORE_ADDR;
     { breakpoint }
     last_breakpoint_number,
     last_breakpoint_address,
     last_breakpoint_line : longint;
-    last_breakpoint_file : pchar;
+    last_breakpoint_file : PAnsiChar;
     invalid_breakpoint_line : boolean;
     { Highlevel }
     user_screen_shown,
@@ -274,7 +274,7 @@ begin
 end;
 
 
-procedure tgdbbuffer.append(p:pchar);
+procedure tgdbbuffer.append(p:PAnsiChar);
 var
   len : longint;
 begin
@@ -291,7 +291,7 @@ end;
 
 procedure tgdbbuffer.resize(nsize : longint);
 var
-  np    : pchar;
+  np    : PAnsiChar;
 begin
   nsize:=((nsize+blocksize-1) div blocksize)*blocksize;
   getmem(np,nsize);

+ 1 - 1
packages/ide/fp.pas

@@ -151,7 +151,7 @@ procedure ProcessParams(BeforeINI: boolean);
   function IsSwitch(const Param: string): boolean;
   begin
     IsSwitch:=(Param<>'') and (Param[1]<>DirSep) { <- allow UNIX root-relative paths            }
-          and (Param[1] in ['-','/']);           { <- but still accept dos switch char, eg. '/' }
+          and (Param[1] in ['-','/']);           { <- but still accept dos switch AnsiChar, eg. '/' }
   end;
 
 var I: Sw_integer;

+ 2 - 2
packages/ide/fpcalc.pas

@@ -40,9 +40,9 @@ type
   TCalcDisplay = object(TView)
     Status: TCalcState;
     Number: string[MaxDigits];
-    Sign: Char;
+    Sign: AnsiChar;
     LastOperator,
-    _Operator: Char;
+    _Operator: AnsiChar;
     LastR,
     Operand: extended;
     Memory: extended;

+ 1 - 0
packages/ide/fpcodcmp.pas

@@ -19,6 +19,7 @@ unit FPCodCmp; { CodeComplete }
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 

+ 1 - 0
packages/ide/fpcodtmp.pas

@@ -18,6 +18,7 @@ unit FPCodTmp; { Code Templates }
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 

+ 2 - 0
packages/ide/fpconst.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit FPConst;
 
+{$H-}
+
 interface
 
 uses Views,App,

+ 2 - 2
packages/ide/fpcygwin.pas

@@ -1,5 +1,5 @@
 unit fpcygwin;
-
+{$H-}
 interface
 
 function GetCygwinVersionString : string;
@@ -16,7 +16,7 @@ uses
 
 var
   ModuleH,DummyH : Handle;
-  CygwinFullName : pchar;
+  CygwinFullName : PAnsiChar;
   fileinfosize : cardinal;
   size : longint;
   InfoData : pointer;

+ 14 - 12
packages/ide/fpdebug.pas

@@ -13,7 +13,9 @@
 
  **********************************************************************}
 unit FPDebug;
+
 {$ifdef NODEBUG}
+{$H-}
 interface
 implementation
 end.
@@ -74,7 +76,7 @@ type
     procedure DoEndSession(code:longint);virtual;
     procedure DoUserSignal;virtual;
     procedure FlushAll; virtual;
-    function Query(question : pchar; args : pchar) : longint; virtual;
+    function Query(question : PAnsiChar; args : PAnsiChar) : longint; virtual;
 
     procedure AnnotateError;
     procedure InsertBreakpoints;
@@ -93,7 +95,7 @@ type
     procedure CommandEnd(const s:string);virtual;
     function  IsRunning : boolean;
     function  AllowQuit : boolean;virtual;
-    function  GetValue(Const expr : string) : pchar;
+    function  GetValue(Const expr : string) : PAnsiChar;
     function  GetFramePointer : CORE_ADDR;
     function  GetLongintAt(addr : CORE_ADDR) : longint;
     function  GetPointerAt(addr : CORE_ADDR) : CORE_ADDR;
@@ -117,7 +119,7 @@ type
      Line : Longint; { only used for bt_file_line type }
      Conditions : PString; { conditions relative to that breakpoint }
      IgnoreCount : Longint; { how many counts should be ignored }
-     Commands : pchar; { commands that should be executed on breakpoint }
+     Commands : PAnsiChar; { commands that should be executed on breakpoint }
      GDBIndex : longint;
      GDBState : BreakpointState;
      constructor Init_function(Const AFunc : String);
@@ -213,7 +215,7 @@ type
     PWatch = ^TWatch;
     TWatch =  Object(TObject)
       expr : pstring;
-      last_value,current_value : pchar;
+      last_value,current_value : PAnsiChar;
       constructor Init(s : string);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
@@ -1040,9 +1042,9 @@ begin
     GDBWindow^.WriteString(S);
 end;
 
-function TDebugController.Query(question : pchar; args : pchar) : longint;
+function TDebugController.Query(question : PAnsiChar; args : PAnsiChar) : longint;
 var
-  c : char;
+  c : AnsiChar;
   WasModal : boolean;
   ModalView : PView;
   res : longint;
@@ -1213,9 +1215,9 @@ begin
     end;
 end;
 
-function TDebugController.GetValue(Const expr : string) : pchar;
+function TDebugController.GetValue(Const expr : string) : PAnsiChar;
 begin
-  GetValue:=StrNew(PChar(PrintCommand(expr)));
+  GetValue:=StrNew(PAnsiChar(PrintCommand(expr)));
 end;
 
 function TDebugController.GetFramePointer : CORE_ADDR;
@@ -1542,7 +1544,7 @@ begin
 {$ifdef Windows}
    if NoSwitch then
      begin
-       { Ctrl-C as normal char }
+       { Ctrl-C as normal AnsiChar }
        GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @IdeMode);
        IdeMode:=(IdeMode or ENABLE_MOUSE_INPUT or ENABLE_WINDOW_INPUT) and not ENABLE_PROCESSED_INPUT;
        SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode);
@@ -1766,7 +1768,7 @@ end;
 
 procedure TBreakpoint.Insert;
   var
-    p,p2 : pchar;
+    p,p2 : PAnsiChar;
     st : string;
     bkpt_no: LongInt = 0;
 begin
@@ -2934,9 +2936,9 @@ procedure TWatch.Get_new_value;
            loop_higher:=false;
       end;
     if found then
-      current_value:=StrNew(PChar('= ' + s))
+      current_value:=StrNew(PAnsiChar('= ' + s))
     else
-      current_value:=StrNew(PChar(orig_s_result));
+      current_value:=StrNew(PAnsiChar(orig_s_result));
     Debugger^.got_error:=false;
     { We should try here to find the expr in parent
       procedure if there are

+ 6 - 4
packages/ide/fpdesk.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit FPDesk;
 
+{$H-}
+
 interface
 
 const
@@ -382,7 +384,7 @@ procedure ProcessWindowInfo;
 var W: PWindow;
     SW: PSourceWindow absolute W;
     St: string;
-    Ch: char;
+    Ch: AnsiChar;
     TP,TP2: TPoint;
     L: longint;
     R: TRect;
@@ -510,7 +512,7 @@ begin
          W:=ASCIIChart;
          if DV>=$A then
            begin
-             GetData(ch,sizeof(char));
+             GetData(ch,sizeof(AnsiChar));
              AsciiChart^.Report^.AsciiChar:=ord(ch);
              AsciiChart^.Table^.SetCursor(
                ord(ch) mod AsciiChart^.Table^.Size.X,
@@ -638,7 +640,7 @@ var W: PWindow;
     XDataOfs: word;
     XData: array[0..1024] of byte;
     St: string;
-    Ch: char;
+    Ch: AnsiChar;
     TP: TPoint;
     L: longint;
 procedure AddData(const B; Size: word);
@@ -693,7 +695,7 @@ begin
     hcAsciiTableWindow :
       begin
         ch:=chr(PFPAsciiChart(P)^.Report^.AsciiChar);
-        AddData(ch,sizeof(char));
+        AddData(ch,sizeof(AnsiChar));
       end;
   end;
 

+ 3 - 1
packages/ide/fpdpansi.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit fpdpansi;
 
+{$H-}
+
 interface
 
 uses
@@ -88,7 +90,7 @@ var
       CurColor:=NewColor;
     end;
 var
-  Ch : char;
+  Ch : AnsiChar;
   textAttr : byte;
   i, j : sw_integer;
 begin

+ 2 - 0
packages/ide/fpevalw.pas

@@ -13,6 +13,8 @@
  **********************************************************************}
 unit fpevalw;
 
+{$H-}
+
 {****************************************************************************}
                                   interface
 {****************************************************************************}

+ 2 - 1
packages/ide/fphelp.pas

@@ -17,6 +17,7 @@ unit FPHelp;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -634,7 +635,7 @@ begin
   FPHTMLGetSectionColor:=OK;
 end;
 
-function FPNGGetAttrColor(Attr: char; var Color: byte): boolean;
+function FPNGGetAttrColor(Attr: AnsiChar; var Color: byte): boolean;
 var OK: boolean;
 begin
   OK:=false;

+ 2 - 2
packages/ide/fpide.pas

@@ -438,7 +438,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 status_compile         = '~Alt+F9~ Compile';
                 status_make            = '~F9~ Make';
                 status_localmenu       = '~Alt+F10~ Local menu';
-                status_transferchar    = '~Ctrl+Enter~ Transfer char';
+                status_transferchar    = '~Ctrl+Enter~ Transfer AnsiChar';
                 status_msggotosource   = '~'+EnterSign+'~ Goto source';
                 status_msgtracksource  = '~Space~ Track source';
                 status_close           = '~Esc~ Close';
@@ -1561,7 +1561,7 @@ begin
 {$else}
 {$ifndef Unix}
     posexe:=Pos('.EXE',UpCaseStr(ProgramPath));
-    { if programpath was three char long => bug }
+    { if programpath was three AnsiChar long => bug }
     if (posexe>0) and (posexe=Length(ProgramPath)-3) then
       begin
 {$endif Unix}

+ 2 - 2
packages/ide/fpini.pas

@@ -293,10 +293,10 @@ begin
       if code<>0 then
         break;
       inc(len);
-      strtopalette[len]:=char(X);
+      strtopalette[len]:=AnsiChar(X);
       inc(i,p);
     end;
-  strtopalette[0]:=char(len);
+  strtopalette[0]:=AnsiChar(len);
 end;
 
 {$ifndef NODEBUG}

+ 1 - 0
packages/ide/fpintf.pas

@@ -17,6 +17,7 @@
 unit FPIntf;
 
 {$mode objfpc}
+{$H-}
 
 interface
 

+ 2 - 0
packages/ide/fpkeys.pas

@@ -15,6 +15,8 @@
 
 unit fpkeys;
 
+{$H-}
+
 interface
 
   uses

+ 11 - 3
packages/ide/fpmake.pp

@@ -143,8 +143,11 @@ begin
     end;
 end;
 
+
 procedure add_ide_comandlineoptions();
 begin
+  if SameText(Defaults.SubTarget,'unicodertl') then
+    exit;
   AddCustomFpmakeCommandlineOption('CompilerTarget','Target CPU for the IDE''s compiler');
   AddCustomFpmakeCommandlineOption('NoGDB','If value=1 or ''Y'', no GDB support');
   AddCustomFpmakeCommandlineOption('NoGDBMI','If value=1 or ''Y'', explicitly disable GDB/MI option');
@@ -166,6 +169,8 @@ Var
   llvm: boolean;
 
 begin
+  if SameText(Defaults.SubTarget,'unicodertl') then
+    exit;
   With Installer do
     begin
     s := GetCustomFpmakeCommandlineOptionValue('NoIDE');
@@ -372,9 +377,12 @@ end;
 
 {$ifndef ALLPACKAGES}
 begin
-  add_ide_comandlineoptions();
-  add_ide('');
-  Installer.Run;
+  If Assigned(Installer) then
+    begin
+    add_ide_comandlineoptions();
+    add_ide('');
+    Installer.Run;
+    end;
 end.
 {$endif ALLPACKAGES}
 

+ 1 - 0
packages/ide/fpmtools.inc

@@ -1,3 +1,4 @@
+{MainUnit fpide.pas}
 {
     This file is part of the Free Pascal Integrated Development Environment
     Copyright (c) 1998 by Berczi Gabor

+ 1 - 0
packages/ide/fpredir.pas

@@ -45,6 +45,7 @@ Interface
 {$ifdef netware_clib}
 {$define implemented}
 {$endif}
+{$H-}
 
 Var
   IOStatus                   : Integer;

+ 10 - 9
packages/ide/fpregs.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 unit FPRegs;
+{$H-}
 {$ifdef NODEBUG}
 interface
 implementation
@@ -290,9 +291,9 @@ const
   function GetIntRegs(var rs : TIntRegs) : boolean;
 
     var
-       p,po : pchar;
-       p1 : pchar;
-       buffer : array[0..255] of char;
+       p,po : PAnsiChar;
+       p1 : PAnsiChar;
+       buffer : array[0..255] of AnsiChar;
        i : byte;
 
     begin
@@ -857,11 +858,11 @@ const
              ) : boolean;
 
     var
-       p,po : pchar;
-       p1 : pchar;
+       p,po : PAnsiChar;
+       p1 : PAnsiChar;
     {$ifndef NODEBUG}
        reg,value : string;
-       buffer : array[0..255] of char;
+       buffer : array[0..255] of AnsiChar;
        v : string;
        res : cardinal;
        i : longint;
@@ -1287,11 +1288,11 @@ const
              ) : boolean;
 
     var
-       p,po : pchar;
-       p1 : pchar;
+       p,po : PAnsiChar;
+       p1 : PAnsiChar;
     {$ifndef NODEBUG}
        reg,value : string;
-       buffer : array[0..255] of char;
+       buffer : array[0..255] of AnsiChar;
        v : string;
        res : cardinal;
        i : longint;

+ 9 - 8
packages/ide/fpswitch.pas

@@ -17,6 +17,7 @@ unit FPSwitch;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -115,8 +116,8 @@ type
 
     PSwitches = ^TSwitches;
     TSwitches = object
-      constructor Init(ch:char);
-      constructor InitSelect(ch:char);
+      constructor Init(ch:AnsiChar);
+      constructor InitSelect(ch:AnsiChar);
       destructor  Done;
       { general items }
       function  ItemCount:integer;
@@ -146,7 +147,7 @@ type
       function  ReadItemsCfg(const s:string):boolean;
     private
       IsSel  : boolean;
-      Prefix : char;
+      Prefix : AnsiChar;
       SelNr  : array[TSwitchMode] of integer;
       Items  : PCollection;
     end;
@@ -573,7 +574,7 @@ end;
                TSwitch
 *****************************************************************************}
 
-constructor TSwitches.Init(ch:char);
+constructor TSwitches.Init(ch:AnsiChar);
 begin
   new(Items,Init(10,5));
   Prefix:=ch;
@@ -582,7 +583,7 @@ begin
 end;
 
 
-constructor TSwitches.InitSelect(ch:char);
+constructor TSwitches.InitSelect(ch:AnsiChar);
 begin
   new(Items,Init(10,5));
   Prefix:=ch;
@@ -821,7 +822,7 @@ end;
 
 procedure TSwitches.WriteItemsCfg;
 var
-  Pref : char;
+  Pref : AnsiChar;
 
   procedure writeitem(P:PSwitchItem);
   var
@@ -987,7 +988,7 @@ end;
 
 procedure ReadSwitches(const fn:string);
 var
-  c : char;
+  c : AnsiChar;
   s : string;
   res : boolean;
   OldSwitchesMode,i : TSwitchMode;
@@ -1070,7 +1071,7 @@ function  GetSourceDirectories : string;
 var
   P : PStringItem;
   S : String;
-  c : char;
+  c : AnsiChar;
   function checkitem(P:PSwitchItem):boolean;
   begin
     CheckItem:=(P^.Typ=ot_string) and (P^.Param=c);

+ 5 - 5
packages/ide/fpsymbol.pas

@@ -160,7 +160,7 @@ type
 
     PBrowserTabItem = ^TBrowserTabItem;
     TBrowserTabItem = record
-      Sign  : char;
+      Sign  : AnsiChar;
       Link  : PView;
       Next  : PBrowserTabItem;
     end;
@@ -276,7 +276,7 @@ const
                 dialog_browse = 'Browse: %s';
 
 const           { Symbol browser tabs }
-                { must be char constants (so cannot be resourcestring)}
+                { must be AnsiChar constants (so cannot be resourcestring)}
                 label_browsertab_scope = 'S';
                 label_browsertab_reference = 'R';
                 label_browsertab_inheritance = 'I';
@@ -323,7 +323,7 @@ begin
     end;
 end;
 
-function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
+function NewBrowserTabItem(ASign: AnsiChar; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
 var P: PBrowserTabItem;
 begin
   New(P); FillChar(P^,SizeOf(P^),0);
@@ -537,7 +537,7 @@ end;
 
 procedure TGDBValue.GetValue;
 var
-  p : pchar;
+  p : PAnsiChar;
 begin
 {$ifdef BROWSERCOL}
 {$ifndef NODEBUG}
@@ -1466,7 +1466,7 @@ procedure TBrowserTab.Draw;
 var B: TDrawBuffer;
     SelColor, NormColor, C: word;
     I,CurX,Count: Sw_integer;
-function Names(Idx: integer): char;
+function Names(Idx: integer): AnsiChar;
 begin
   Names:=GetItem(Idx)^.Sign;
 end;

+ 3 - 1
packages/ide/fptemplt.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit FPTemplt;
 
+{$H-}
+
 interface
 
 uses FPViews;
@@ -135,7 +137,7 @@ end;
 function ReadStringPos(const InS: string; StartP: sw_integer; var Expr: string; var EndPos: sw_integer): sw_integer;
 const Enclosers : string[2] = '''"';
 var OK: boolean;
-    Encloser: char;
+    Encloser: AnsiChar;
     P: sw_integer;
 begin
   OK:=false; Expr:=''; P:=StartP; EndPos:=-1;

+ 7 - 7
packages/ide/fptools.pas

@@ -883,7 +883,7 @@ begin
 end;
 var OptName: string;
     OK: boolean;
-    C: char;
+    C: AnsiChar;
     OptStart: integer;
     InOpt: boolean;
     I,Idx: integer;
@@ -1043,7 +1043,7 @@ var Err: integer;
     W: PSourceWindow;
 procedure ParseParams(Pass: sw_integer);
 var I: sw_integer;
-function IsAlpha(Ch: char): boolean;
+function IsAlpha(Ch: AnsiChar): boolean;
 begin
   IsAlpha:=(Upcase(Ch) in['A'..'Z','_','$']);
 end;
@@ -1052,14 +1052,14 @@ begin
   Params:=copy(Params,1,StartP-1)+S+copy(Params,EndP+1,255);
   ReplacePart:=length(S)-(EndP-StartP+1);
 end;
-function Consume(Ch: char): boolean;
+function Consume(Ch: AnsiChar): boolean;
 var OK: boolean;
 begin
   OK:=Params[I]=Ch;
   if OK then Inc(I);
   Consume:=OK;
 end;
-function ReadTill(var S: string; C: char): boolean;
+function ReadTill(var S: string; C: AnsiChar): boolean;
 var Found: boolean;
 begin
   Found:=false; S:='';
@@ -1074,7 +1074,7 @@ begin
     end;
   ReadTill:=Found;
 end;
-var C,PrevC: char;
+var C,PrevC: AnsiChar;
     WordS: string;
     LastWordStart: sw_integer;
     L: longint;
@@ -1354,8 +1354,8 @@ end;
 function ProcessMessageFile(const MsgFileName: string): boolean;
 var OK,Done: boolean;
     S: PBufStream;
-    C: char;
-    Sign: array[1..10] of char;
+    C: AnsiChar;
+    Sign: array[1..10] of AnsiChar;
     InFileName,InReference: boolean;
     AddChar: boolean;
     FileName,Line: string;

+ 3 - 3
packages/ide/fpusrscr.pas

@@ -1125,11 +1125,11 @@ begin
   for i:=1 to LineSize do
     begin
       Text[i]:=LineBuf^[i-1].AsciiChar;
-      Attr[i]:=char(byte(LineBuf^[i-1].Attributes));
+      Attr[i]:=AnsiChar(byte(LineBuf^[i-1].Attributes));
     end;
   FreeMem(LineBuf,SizeOf(CharInfoArray));
-  Text[0]:=char(byte(LineSize));
-  Attr[0]:=char(byte(LineSize));
+  Text[0]:=AnsiChar(byte(LineSize));
+  Attr[0]:=AnsiChar(byte(LineSize));
 end;
 
 

+ 6 - 4
packages/ide/fputils.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit FPUtils;
 
+{$H-}
+
 interface
 
 uses
@@ -70,7 +72,7 @@ function GetStr(const P: PString): string;
 procedure ReplaceStr(var S: string; const What,NewS: string);
 procedure ReplaceStrI(var S: string; What: string; const NewS: string);
 
-const ListSeparator      : char = ';';
+const ListSeparator      : AnsiChar = ';';
 
 implementation
 
@@ -153,13 +155,13 @@ begin
               NoPath:=false; {Skip lowercasing path: 'X11'<>'x11' }
             end;
  'A'..'Z' : if NoPath then
-             FixFileName[i]:=char(byte(s[i])+ord('a')-ord('A'))
+             FixFileName[i]:=AnsiChar(byte(s[i])+ord('a')-ord('A'))
             else
              FixFileName[i]:=s[i];
  {$else}
  {$ifndef hasamiga}
       '/' : FixFileName[i]:='\';
- 'A'..'Z' : FixFileName[i]:=char(byte(s[i])+32);
+ 'A'..'Z' : FixFileName[i]:=AnsiChar(byte(s[i])+32);
  {$else}
       '\' : FixFileName[i]:='/';
  {$endif}
@@ -272,7 +274,7 @@ function MatchesMask(What, Mask: string): boolean;
   begin
      for i:=1 to length(s) do
       if s[i] in ['a'..'z'] then
-       upper[i]:=char(byte(s[i])-32)
+       upper[i]:=AnsiChar(byte(s[i])-32)
       else
        upper[i]:=s[i];
      upper[0]:=s[0];

+ 18 - 18
packages/ide/fpviews.pas

@@ -218,11 +218,11 @@ type
       Indicator : PIndicator;
       constructor Init(var Bounds: TRect);
       procedure   HandleEvent(var Event: TEvent); virtual;
-      procedure   WriteText(Buf : pchar;IsError : boolean);
+      procedure   WriteText(Buf : PAnsiChar;IsError : boolean);
       procedure   WriteString(Const S : string);
       procedure   WriteErrorString(Const S : string);
-      procedure   WriteOutputText(Buf : pchar);
-      procedure   WriteErrorText(Buf : pchar);
+      procedure   WriteOutputText(Buf : PAnsiChar);
+      procedure   WriteErrorText(Buf : PAnsiChar);
       function    GetPalette: PPalette;virtual;
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
@@ -266,7 +266,7 @@ type
       constructor Init(var Bounds: TRect);
       procedure   LoadFunction(Const FuncName : string);
       procedure   LoadAddress(Addr : CORE_ADDR);
-      function    ProcessPChar(p : pchar) : boolean;
+      function    ProcessPChar(p : PAnsiChar) : boolean;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   WriteSourceString(Const S : string;line : longint);
       procedure   WriteDisassemblyString(Const S : string;address : CORE_ADDR);
@@ -341,7 +341,7 @@ type
       Name     : PString;
       Items    : PTabItem;
       DefItem  : PView;
-      ShortCut : char;
+      ShortCut : AnsiChar;
     end;
 
     PTab = ^TTab;
@@ -853,13 +853,13 @@ function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
 var S: string;
     PS,PE: byte;
 function Trim(S: string): string;
-const TrimChars : set of char = [#0,#9,' ',#255];
+const TrimChars : set of AnsiChar = [#0,#9,' ',#255];
 begin
   while (length(S)>0) and (S[1] in TrimChars) do Delete(S,1,1);
   while (length(S)>0) and (S[length(S)] in TrimChars) do Delete(S,length(S),1);
   Trim:=S;
 end;
-const AlphaNum : set of char = ['A'..'Z','0'..'9','_'];
+const AlphaNum : set of AnsiChar = ['A'..'Z','0'..'9','_'];
 begin
   with Editor^ do
   begin
@@ -1119,7 +1119,7 @@ end;
 function IsFPAsmReservedWord(S: string): boolean;
 var _Is: boolean;
     Idx,Item,Len: sw_integer;
-    LastC : Char;
+    LastC : AnsiChar;
     LastTwo : String[2];
 begin
   Idx:=length(S); _Is:=false;
@@ -2555,13 +2555,13 @@ begin
   GetPalette:=@P;
 end;
 
-procedure TGDBWindow.WriteOutputText(Buf : pchar);
+procedure TGDBWindow.WriteOutputText(Buf : PAnsiChar);
 begin
   {selected normal color ?}
   WriteText(Buf,false);
 end;
 
-procedure TGDBWindow.WriteErrorText(Buf : pchar);
+procedure TGDBWindow.WriteErrorText(Buf : PAnsiChar);
 begin
   {selected normal color ?}
   WriteText(Buf,true);
@@ -2577,8 +2577,8 @@ begin
   Editor^.AddErrorLine(S);
 end;
 
-procedure TGDBWindow.WriteText(Buf : pchar;IsError : boolean);
-  var p,pe : pchar;
+procedure TGDBWindow.WriteText(Buf : PAnsiChar;IsError : boolean);
+  var p,pe : PAnsiChar;
       s : string;
 begin
   p:=buf;
@@ -2767,7 +2767,7 @@ end;
 
 procedure   TDisassemblyWindow.LoadFunction(Const FuncName : string);
 var
-   p : pchar;
+   p : PAnsiChar;
 begin
 {$ifndef NODEBUG}
   If not assigned(Debugger) then Exit;
@@ -2783,7 +2783,7 @@ end;
 
 procedure   TDisassemblyWindow.LoadAddress(Addr : CORE_ADDR);
 var
-   p : pchar;
+   p : PAnsiChar;
 begin
 {$ifndef NODEBUG}
   If not assigned(Debugger) then Exit;
@@ -2800,10 +2800,10 @@ begin
 end;
 
 
-function TDisassemblyWindow.ProcessPChar(p : pchar) : boolean;
+function TDisassemblyWindow.ProcessPChar(p : PAnsiChar) : boolean;
 var
-  p1: pchar;
-  pline : pchar;
+  p1: PAnsiChar;
+  pline : PAnsiChar;
   pos1, pos2, CurLine, PrevLine : longint;
   CurAddr : CORE_ADDR;
   err : word;
@@ -3630,7 +3630,7 @@ var B     : TDrawBuffer;
     Name       : PString;
     ActiveKPos : integer;
     ActiveVPos : integer;
-    FC   : char;
+    FC   : AnsiChar;
     ClipR      : TRect;
 procedure SWriteBuf(X,Y,W,H: integer; var Buf);
 var i: integer;

+ 3 - 3
packages/ide/gdbmicon.pas

@@ -464,9 +464,9 @@ begin
     if Assigned(FrameList.ValueAt[I].AsTuple['line']) then
       frames[I]^.line_number := FrameList.ValueAt[I].AsTuple['line'].AsLongInt;
     if Assigned(FrameList.ValueAt[I].AsTuple['func']) then
-      frames[I]^.function_name := StrNew(PChar(FrameList.ValueAt[I].AsTuple['func'].AsString));
+      frames[I]^.function_name := StrNew(PAnsiChar(FrameList.ValueAt[I].AsTuple['func'].AsString));
     if Assigned(FrameList.ValueAt[I].AsTuple['fullname']) then
-      frames[I]^.file_name := StrNew(PChar(FrameList.ValueAt[I].AsTuple['fullname'].AsString));
+      frames[I]^.file_name := StrNew(PAnsiChar(FrameList.ValueAt[I].AsTuple['fullname'].AsString));
   end;
   Command('-stack-list-arguments 1');
   if not GDB.ResultRecord.Success then
@@ -488,7 +488,7 @@ begin
           s:=s+':='+ArgList.ValueAt[J].AsTuple['value'].ASString;
       end;
     s:=s+')';
-    frames[I]^.args:=StrNew(pchar(s));
+    frames[I]^.args:=StrNew(PAnsiChar(s));
   end;
 end;
 

+ 24 - 24
packages/ide/gdbmiint.pas

@@ -36,9 +36,9 @@ type
     procedure Reset;
     procedure Clear;
   public
-    file_name: PChar;
-    function_name: PChar;
-    args: PChar;
+    file_name: PAnsiChar;
+    function_name: PAnsiChar;
+    args: PAnsiChar;
     line_number: LongInt;
     address: CORE_ADDR;
     level : longint;
@@ -48,11 +48,11 @@ type
 
   TGDBBuffer = object
   private
-    buf: PChar;
+    buf: PAnsiChar;
     size, idx: LongInt;
     procedure Resize(nsize: LongInt);
-    procedure Append(p: PChar);
-    procedure LAppend(p: PChar; len: LongInt);
+    procedure Append(p: PAnsiChar);
+    procedure LAppend(p: PAnsiChar; len: LongInt);
   public
     constructor Init;
     destructor Done;
@@ -87,8 +87,8 @@ type
     frames: PPFrameEntry;
     frame_count: LongInt;
     command_level: LongInt;
-    signal_name: PChar;
-    signal_string: PChar;
+    signal_name: PAnsiChar;
+    signal_string: PAnsiChar;
     current_pc: CORE_ADDR;
     switch_to_user: Boolean;
 
@@ -96,10 +96,10 @@ type
     constructor Init;
     destructor Done;
     { from gdbcon }
-    function GetOutput: PChar;
-    function GetError: PChar;
+    function GetOutput: PAnsiChar;
+    function GetError: PAnsiChar;
 {$ifdef DEBUG}
-    function GetRaw: PChar;
+    function GetRaw: PAnsiChar;
 {$endif DEBUG}
     { Lowlevel }
     procedure Set_debuggee_started;
@@ -112,7 +112,7 @@ type
     procedure DebuggerScreen;
     procedure UserScreen;
     procedure FlushAll; virtual;
-    function Query(question: PChar; args: PChar): LongInt; virtual;
+    function Query(question: PAnsiChar; args: PAnsiChar): LongInt; virtual;
     { Hooks }
     function DoSelectSourceline(const fn: string; line, BreakIndex: longint): Boolean;virtual;
     procedure DoStartSession; virtual;
@@ -200,7 +200,7 @@ end;
 
 procedure TGDBBuffer.Resize(nsize: LongInt);
 var
-  np: PChar;
+  np: PAnsiChar;
 begin
   nsize := ((nsize + BlockSize - 1) div BlockSize) * BlockSize;
   GetMem(np, nsize);
@@ -213,7 +213,7 @@ begin
   size := nsize;
 end;
 
-procedure TGDBBuffer.Append(p: PChar);
+procedure TGDBBuffer.Append(p: PAnsiChar);
 var
   len: LongInt;
 begin
@@ -223,7 +223,7 @@ begin
   LAppend(p, len);
 end;
 
-procedure TGDBBuffer.LAppend(p: PChar; len: LongInt);
+procedure TGDBBuffer.LAppend(p: PAnsiChar; len: LongInt);
 begin
   if not Assigned(p) then
     exit;
@@ -266,25 +266,25 @@ begin
 {$endif GDB_RAW_OUTPUT}
 end;
 
-function TGDBInterface.GetOutput: PChar;
+function TGDBInterface.GetOutput: PAnsiChar;
 begin
   GetOutput := GDBOutputBuf.buf;
 end;
 
 {$ifdef GDB_RAW_OUTPUT}
-function TGDBInterface.GetRaw: PChar;
+function TGDBInterface.GetRaw: PAnsiChar;
 begin
   GetRaw := GDBRawBuf.buf;
 end;
 {$endif GDB_RAW_OUTPUT}
 
-function TGDBInterface.GetError: PChar;
+function TGDBInterface.GetError: PAnsiChar;
 var
-  p: PChar;
+  p: PAnsiChar;
 begin
   p := GDBErrorBuf.buf;
   if (p^=#0) and got_error then
-    GetError := PChar(PtrInt(GDBOutputBuf.buf) + GDBOutputBuf.idx)
+    GetError := PAnsiChar(PtrInt(GDBOutputBuf.buf) + GDBOutputBuf.idx)
   else
     GetError := p;
 end;
@@ -308,16 +308,16 @@ begin
 {$ifdef GDB_RAW_OUTPUT}
   if output_raw then
     for I := 0 to GDB.RawResponse.Count - 1 do
-      GDBRawBuf.Append(PChar(GDB.RawResponse[I]));
+      GDBRawBuf.Append(PAnsiChar(GDB.RawResponse[I]));
 {$endif GDB_RAW_OUTPUT}
 
   for I := 0 to GDB.ConsoleStream.Count - 1 do
-    GDBOutputBuf.Append(PChar(GDB.ConsoleStream[I]));
+    GDBOutputBuf.Append(PAnsiChar(GDB.ConsoleStream[I]));
   if GDB.ResultRecord.AsyncClass='error' then
   begin
     got_error := True;
     if Assigned(GDB.ResultRecord.Parameters['msg']) then
-      GDBErrorBuf.Append(PChar(GDB.ResultRecord.Parameters['msg'].AsString));
+      GDBErrorBuf.Append(PAnsiChar(GDB.ResultRecord.Parameters['msg'].AsString));
   end;
   ProcessResponse;
   Dec(command_level);
@@ -556,7 +556,7 @@ procedure TGDBInterface.FlushAll;
 begin
 end;
 
-function TGDBInterface.Query(question: PChar; args: PChar): LongInt;
+function TGDBInterface.Query(question: PAnsiChar; args: PAnsiChar): LongInt;
 begin
   Query := 0;
 end;

+ 3 - 3
packages/ide/gdbmiproc.pas

@@ -15,9 +15,9 @@
 
 unit GDBMIProc;
 
-{$MODE objfpc}{$H+}
-
+{$MODE objfpc}
 {$I globdir.inc}
+{$H+}
 
 interface
 
@@ -60,7 +60,7 @@ end;
 
 function TGDBProcess.GDBReadLn: string;
 var
-  C: Char;
+  C: AnsiChar;
 begin
   Result := '';
   while FProcess.Running do

+ 4 - 2
packages/ide/gdbmiwrap.pas

@@ -15,10 +15,12 @@
 
 unit gdbmiwrap;
 
-{$MODE objfpc}{$H+}
+{$MODE objfpc}
 {$ASSERTIONS on}
 
 {$I globdir.inc}
+// Needs to be on
+{$H+}
 
 interface
 
@@ -368,7 +370,7 @@ var
   CStr: string;
   ////  Tuple: TGDBMI_TupleValue;
   List: TGDBMI_TupleOrListValue;
-  end_c : char;
+  end_c : AnsiChar;
   Name: string;
   Value: TGDBMI_Value;
 begin

+ 2 - 0
packages/ide/globdir.inc

@@ -231,3 +231,5 @@
 {$ifdef TYPED_LOCAL_CALLBACKS}
 {$modeswitch nestedprocvars}
 {$endif}
+
+{$h-}

+ 2 - 0
packages/ide/pmode.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit PMode;
 
+{$H-}
+
 interface
 
 uses Dos;

+ 3 - 2
packages/ide/test.pas

@@ -1,5 +1,6 @@
 {$mode objfpc}
 {$R-}
+{$H-}
 
 program TestProgram;
 uses
@@ -78,7 +79,7 @@ var Hello : word;
     ProcVar: procedure;
     ProcVarD: function(X: real): boolean;
     ProcVarI: ProcTyp;
-    SetVarD: set of char;
+    SetVarD: set of AnsiChar;
     SetVarI: SetTyp;
     Float1: real;
     Float2: double;
@@ -90,7 +91,7 @@ var Hello : word;
     ClassVar2: TClass2;
     Obj1: TObj;
     Obj2: TObj2;
-    CharArray : Array[1..2000] of char;
+    CharArray : Array[1..2000] of AnsiChar;
     ExtendedArray : Array[1..2000] of extended;
     ExtendedPackedArray : packed Array[1..2000] of extended;
     SingleArrayArray : Array[1..10,1..10] of single;

+ 1 - 0
packages/ide/test1.pas

@@ -1,6 +1,7 @@
 unit test1;
 
 {$mode objfpc}
+{$H-}
 
 { dummy unit for test of dbx stabs info PM }
 

+ 1 - 0
packages/ide/test2.pas

@@ -1,4 +1,5 @@
 {$L+}
+{$H-}
 unit Test2;
 
 interface

+ 3 - 2
packages/ide/vesa.pas

@@ -17,6 +17,7 @@ unit VESA;
 {$ifdef DEBUG}
 {$define TESTGRAPHIC}
 {$endif DEBUG}
+{$H-}
 
 interface
 
@@ -248,7 +249,7 @@ end;
 function VESAGetOemString: string;
 var OK: boolean;
     VI: TVESAInfoBlock;
-    S: array[0..256] of char;
+    S: array[0..256] of AnsiChar;
 begin
   if disableVESA then
     begin
@@ -574,7 +575,7 @@ var
   w, prevcolor,
   prevbkcolor, StoreCursorType : word;
   Color,BkCol,Col : byte;
-  Ch : char;
+  Ch : AnsiChar;
 {$endif TESTGRAPHIC}
 begin
 {$ifdef TESTGRAPHIC}

+ 22 - 20
packages/ide/wansi.pas

@@ -15,6 +15,8 @@
 {.$DEFINE DEBUG}
 unit WANSI;
 
+{$H-}
+
 interface
 
 uses Objects,Drivers,
@@ -91,8 +93,8 @@ type
        procedure   GotoXY(X,Y: integer); virtual;
        procedure   Write(Const S: string); virtual;
        procedure   WriteLn(Const S: string); virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   WriteCharRaw(C: char); virtual;
+       procedure   WriteChar(C: AnsiChar); virtual;
+       procedure   WriteCharRaw(C: AnsiChar); virtual;
        procedure   DelLine(LineCount: integer); virtual;
        procedure   InsLine(LineCount: integer); virtual;
        procedure   HighVideo; virtual;
@@ -112,7 +114,7 @@ type
        procedure   PutKey(S: string); virtual;
        destructor  Done; virtual;
        private
-       procedure   ProcessChar(C: char); virtual;
+       procedure   ProcessChar(C: AnsiChar); virtual;
      end;
 
      PANSIConsole = ^TANSIConsole;
@@ -122,7 +124,7 @@ type
        ANSICurPosStack    : array[1..ANSICurPosStackSize] of TPoint;
        ANSICurPosStackPtr : byte;
        constructor Init(AReplyHook, AKeyHook, AWriteHook: PHookProc);
-       procedure   ProcessChar(C: char); virtual;
+       procedure   ProcessChar(C: AnsiChar); virtual;
        function    GetANSIParam: integer; virtual;
        { --- ANSI functions --- }
        procedure   PushCurPos; virtual;
@@ -142,7 +144,7 @@ type
        procedure   CursorOff; virtual;
        procedure   ClrScr; virtual;
        procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
+       procedure   WriteChar(C: AnsiChar); virtual;
        procedure   DelLine(LineCount: integer); virtual;
        procedure   InsLine(LineCount: integer); virtual;
        procedure   UpdateCursor; virtual;
@@ -168,8 +170,8 @@ type
        procedure   CursorOff; virtual;
        procedure   ClrScr; virtual;
        procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
-       procedure   WriteCharRaw(C: char); virtual;
+       procedure   WriteChar(C: AnsiChar); virtual;
+       procedure   WriteCharRaw(C: AnsiChar); virtual;
        procedure   DelLine(LineCount: integer); virtual;
        procedure   InsLine(LineCount: integer); virtual;
        procedure   UpdateCursor; virtual;
@@ -203,7 +205,7 @@ type
        procedure   CursorOff; virtual;
        procedure   ClrScr; virtual;
        procedure   ClrEol; virtual;
-       procedure   WriteChar(C: char); virtual;
+       procedure   WriteChar(C: AnsiChar); virtual;
        procedure   DelLine(LineCount: integer); virtual;
        procedure   InsLine(LineCount: integer); virtual;
        procedure   UpdateCursor; virtual;
@@ -285,17 +287,17 @@ begin
   UpdateCursor;
 end;
 
-procedure TConsoleObject.ProcessChar(C: char);
+procedure TConsoleObject.ProcessChar(C: AnsiChar);
 begin
   WriteChar(C);
 end;
 
-procedure TConsoleObject.WriteChar(C: char);
+procedure TConsoleObject.WriteChar(C: AnsiChar);
 begin
   Abstract;
 end;
 
-procedure TConsoleObject.WriteCharRaw(C: char);
+procedure TConsoleObject.WriteCharRaw(C: AnsiChar);
 begin
   Abstract;
 end;
@@ -452,7 +454,7 @@ begin
   GotoXY(Crt.WhereX,Crt.WhereY);
 end;
 
-procedure TCrtConsole.WriteChar(C: char);
+procedure TCrtConsole.WriteChar(C: AnsiChar);
 {var OK: boolean;}
 begin
 {  OK:=((C>=#32) and (WhereX<Size.X)) or (C<#32);
@@ -501,7 +503,7 @@ begin
   ANSIParam:=''; ANSILevel:=0; ANSICurPosStackPtr:=0;
 end;
 
-procedure TANSIConsole.ProcessChar(C: char);
+procedure TANSIConsole.ProcessChar(C: AnsiChar);
 var SkipThis : boolean;
     ANSIDone : boolean;
     X,Y,Z    : integer;
@@ -509,7 +511,7 @@ begin
   SkipThis:=false;
   if C=Esc then
     begin
-       { Treat EscEsc as a request to print a single Escape #27 char PM }
+       { Treat EscEsc as a request to print a single Escape #27 AnsiChar PM }
       if AnsiLevel=0 then
         begin
           ANSILevel:=1;
@@ -531,7 +533,7 @@ begin
                     SkipThis:=true;
                   end;
        else
-       { Treat Esc+ AnyChar as a request to print that single char raw PM }
+       { Treat Esc+ AnyChar as a request to print that single AnsiChar raw PM }
          begin
            WriteCharRaw(c);
            SkipThis:=true;
@@ -712,7 +714,7 @@ begin
   end;
 end;
 
-procedure TANSIViewConsole.WriteChar(C: char);
+procedure TANSIViewConsole.WriteChar(C: AnsiChar);
 var Pos: longint;
 begin
   case C of
@@ -738,7 +740,7 @@ begin
   end;
 end;
 
-procedure TANSIViewConsole.WriteCharRaw(C: char);
+procedure TANSIViewConsole.WriteCharRaw(C: AnsiChar);
 var Pos: longint;
 begin
   Pos:=(CurPos.Y-1)*MaxViewWidth+(WhereX-1);
@@ -793,7 +795,7 @@ end;
 function TANSIView.LoadFile(const FileName: string): boolean;
 var S: PBufStream;
     OK: boolean;
-    B: array[0..1023] of char;
+    B: array[0..1023] of AnsiChar;
     I,FragSize: integer;
 begin
 {$I-}
@@ -930,7 +932,7 @@ begin
   end;
 end;
 
-procedure TANSIBackgroundConsole.WriteChar(C: char);
+procedure TANSIBackgroundConsole.WriteChar(C: AnsiChar);
 var Pos: longint;
 begin
   case C of
@@ -1000,7 +1002,7 @@ end;
 function TANSIBackground.LoadFile(const FileName: string): boolean;
 var S: PBufStream;
     OK: boolean;
-    B: array[0..1023] of char;
+    B: array[0..1023] of AnsiChar;
     I,FragSize: integer;
 begin
 {$I-}

+ 1 - 1
packages/ide/wcedit.pas

@@ -777,7 +777,7 @@ end;
 procedure TIndicator.Draw;
 var
   Color: Byte;
-  Frame: Char;
+  Frame: AnsiChar;
   L: array[0..1] of PtrInt;
   S: String[15];
   B: TDrawBuffer;

+ 1 - 1
packages/ide/wchmhwrap.pas

@@ -187,7 +187,7 @@ end;
 
 procedure splitline(idestream:PMemoryTextFile;s:ansistring);
 
-function scanvalue:integer; // searches for a possible breaking point left of char 255.
+function scanvalue:integer; // searches for a possible breaking point left of AnsiChar 255.
 var n,i  : integer;
     lastpoint:integer;
     inquote : boolean;

+ 2 - 0
packages/ide/wconsole.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit WConsole;
 
+{$H-}
+
 interface
 {$ifdef UNIX}
    uses

+ 2 - 1
packages/ide/wconsts.pas

@@ -10,8 +10,9 @@
 
  **********************************************************************}
 {$i globdir.inc}
-
 {$mode objfpc}
+{$H-}
+
 unit wconsts;
 
   interface

+ 36 - 36
packages/ide/weditor.pas

@@ -68,7 +68,7 @@ const
       MaxLineLength     = 255;
       MaxLineCount      = 2000000;
 
-      CodeTemplateCursorChar = '|'; { char to signal cursor pos in templates }
+      CodeTemplateCursorChar = '|'; { AnsiChar to signal cursor pos in templates }
 
       efBackupFiles         = $00000001;
       efInsertMode          = $00000002;
@@ -691,7 +691,7 @@ type
       procedure ReadBlock; virtual;
       procedure PrintBlock; virtual;
       procedure ExpandCodeTemplate; virtual;
-      procedure AddChar(C: char); virtual;
+      procedure AddChar(C: AnsiChar); virtual;
 {$ifdef WinClipSupported}
       function  ClipCopyWin: Boolean; virtual;
       function  ClipPasteWin: Boolean; virtual;
@@ -757,13 +757,13 @@ const
 {$ifndef NO_UNTYPEDSET}
   {$define USE_UNTYPEDSET}
 {$endif ndef NO_UNTYPEDSET}
-     WhiteSpaceChars    {$ifdef USE_UNTYPEDSET}: set of char {$endif} = [#0,#32,#255];
-     TabChars           {$ifdef USE_UNTYPEDSET}: set of char {$endif} = [#9];
-     HashChars          {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['#'];
-     AlphaChars         {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['A'..'Z','a'..'z','_'];
-     NumberChars        {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['0'..'9'];
-     HexNumberChars     {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['0'..'9','A'..'F','a'..'f'];
-     RealNumberChars    {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['E','e','.'{,'+','-'}];
+     WhiteSpaceChars    {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = [#0,#32,#255];
+     TabChars           {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = [#9];
+     HashChars          {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['#'];
+     AlphaChars         {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['A'..'Z','a'..'z','_'];
+     NumberChars        {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['0'..'9'];
+     HexNumberChars     {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['0'..'9','A'..'F','a'..'f'];
+     RealNumberChars    {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['E','e','.'{,'+','-'}];
 
 procedure RegisterWEditor;
 
@@ -906,7 +906,7 @@ begin
   scankeymap:=0;
 end;
 
-function IsWordSeparator(C: char): boolean;
+function IsWordSeparator(C: AnsiChar): boolean;
 begin
   IsWordSeparator:=C in
       [' ',#0,#255,':','=','''','"',
@@ -917,7 +917,7 @@ begin
       '!'];
 end;
 
-{function IsSpace(C: char): boolean;
+{function IsSpace(C: AnsiChar): boolean;
 begin
   IsSpace:=C in[' ',#0,#255];
 end;}
@@ -989,7 +989,7 @@ var
 begin
   for i:=1 to length(s) do
    if s[i] in ['a'..'z'] then
-    upper[i]:=char(byte(s[i])-32)
+    upper[i]:=AnsiChar(byte(s[i])-32)
    else
     upper[i]:=s[i];
   upper[0]:=s[0];
@@ -1112,13 +1112,13 @@ end;
 
 function BMFIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
 Var
-  buffer : Array[0..MaxBufLength-1] of Char Absolute block;
+  buffer : Array[0..MaxBufLength-1] of AnsiChar Absolute block;
   len,
   numb,
   x      : Sw_Word;
   found  : Boolean;
-  p      : pchar;
-  c      : char;
+  p      : PAnsiChar;
+  c      : AnsiChar;
 begin
   len:=length(str);
   if (len=0) or (len>size) then
@@ -1221,13 +1221,13 @@ end;
 
 function BMBIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw_Integer;
 Var
-  buffer : Array[0..MaxBufLength-1] of Char Absolute block;
+  buffer : Array[0..MaxBufLength-1] of AnsiChar Absolute block;
   len,
   x      : Sw_Word;
   numb   : Sw_Integer;
   found  : Boolean;
-  p      : pchar;
-  c      : char;
+  p      : PAnsiChar;
+  c      : AnsiChar;
 begin
   len:=length(str);
   if (len=0) or (len>size) then
@@ -2225,17 +2225,17 @@ var
     {MatchedSymbol:=StoredMatchedSymbol;}
   end;
 
-  function GetCharClass(C: char): TCharClass;
+  function GetCharClass(C: AnsiChar): TCharClass;
   var CC: TCharClass;
   begin
   (*
-     WhiteSpaceChars    {$ifdef USE_UNTYPEDSET}: set of char {$endif} = [#0,#32,#255];
-     TabChars           {$ifdef USE_UNTYPEDSET}: set of char {$endif} = [#9];
-     HashChars          {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['#'];
-     AlphaChars         {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['A'..'Z','a'..'z','_'];
-     NumberChars        {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['0'..'9'];
-     HexNumberChars     {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['0'..'9','A'..'F','a'..'f'];
-     RealNumberChars    {$ifdef USE_UNTYPEDSET}: set of char {$endif} = ['E','e','.'{,'+','-'}];
+     WhiteSpaceChars    {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = [#0,#32,#255];
+     TabChars           {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = [#9];
+     HashChars          {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['#'];
+     AlphaChars         {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['A'..'Z','a'..'z','_'];
+     NumberChars        {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['0'..'9'];
+     HexNumberChars     {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['0'..'9','A'..'F','a'..'f'];
+     RealNumberChars    {$ifdef USE_UNTYPEDSET}: set of AnsiChar {$endif} = ['E','e','.'{,'+','-'}];
   *)
     if C in {$ifdef USE_UNTYPEDSET}[#0,#32,#255]{$else}WhiteSpaceChars{$endif} then
       CC:=ccWhiteSpace
@@ -2320,7 +2320,7 @@ var
       InAsm:=true;
   end;
 
-  procedure ProcessChar(C: char);
+  procedure ProcessChar(C: AnsiChar);
   var CC: TCharClass;
       EX: Sw_integer;
       EndComment: pstring;
@@ -3478,7 +3478,7 @@ begin
           which are normally interpreted as control chars. So, when you enter
           Alt+24 (on the numeric pad) then this will normally move the cursor
           one line down, but if you do it in ASCII mode (also after Ctrl+B)
-          then this will insert the ASCII #24 char (upper arrow) in the
+          then this will insert the ASCII #24 AnsiChar (upper arrow) in the
           source code. - Gabor }
         if InASCIIMode {and (Event.CharCode<>0)} then
           begin
@@ -3753,7 +3753,7 @@ var SelectColor,
     Line: PCustomLine;
     LineText,Format: string;
     isBreak : boolean;
-    C: char;
+    C: AnsiChar;
     FreeFormat: array[0..MaxLineLength] of boolean;
     Color: word;
     ColorTab: array[coFirstColor..coLastColor] of word;
@@ -4045,7 +4045,7 @@ end;
 
 procedure TCustomCodeEditor.GetFoldStrings(EditorLine: sw_integer; var Prefix, Suffix: openstring);
 var F: PFold;
-    C: char;
+    C: AnsiChar;
 begin
   Prefix:=CharStr(' ',GetFoldStringWidth); Suffix:='';
   F:=GetLineFold(EditorLine);
@@ -4471,7 +4471,7 @@ procedure TCustomCodeEditor.ChangeCaseArea(StartP,EndP: TPoint; CaseAction: TCas
 var Y,X: sw_integer;
     X1,X2: sw_integer;
     S: string;
-    C: char;
+    C: AnsiChar;
     StartPos : TPoint;
     HoldUndo : boolean;
 begin
@@ -4636,7 +4636,7 @@ const OpenSymbols  : string[6] = '[{(<''"';
       CloseSymbols : string[6] = ']})>''"';
 var SymIdx: integer;
     LineText,LineAttr: string;
-    CurChar: char;
+    CurChar: AnsiChar;
     X,Y: sw_integer;
     LineCount: sw_integer;
     JumpPos: TPoint;
@@ -5643,7 +5643,7 @@ begin
   UnLock;
 end;
 
-procedure TCustomCodeEditor.AddChar(C: char);
+procedure TCustomCodeEditor.AddChar(C: AnsiChar);
 const OpenBrackets  : string[10] = '[({';
       CloseBrackets : string[10] = '])}';
 var S,SC,TabS: string;
@@ -5773,7 +5773,7 @@ end;
 var
     OK: boolean;
     l,i,len,len10 : longint;
-    p,p10,p2,p13 : pchar;
+    p,p10,p2,p13 : PAnsiChar;
     s : string;
 begin
   Lock;
@@ -5845,7 +5845,7 @@ end;
 
 function TCustomCodeEditor.ClipCopyWin: Boolean;
 var OK,ShowInfo: boolean;
-    p,p2 : pchar;
+    p,p2 : PAnsiChar;
     s : string;
     i,str_begin,str_end,NumLines,PcLength : longint;
 begin
@@ -6112,7 +6112,7 @@ var S: string;
     RegExpEngine : TRegExprEngine;
     RegExpFlags : tregexprflags;
     regexpindex,regexplen : longint;
-    findstrpchar : pchar;
+    findstrpchar : PAnsiChar;
 {$endif TEST_REGEXP}
     LeftOK,RightOK: boolean;
     FoundCount: sw_integer;

+ 6 - 5
packages/ide/whelp.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 {$R-}
+{$H-}
 unit WHelp;
 
 {$ifdef cpullvm}
@@ -35,7 +36,7 @@ const
       hscLink        = #2;
       hscLineStart   = #3;
       hscCode        = #5;
-      hscDirect      = #6; { add the next char directly }
+      hscDirect      = #6; { add the next AnsiChar directly }
       hscCenter      = #10;
       hscRight       = #11;
       hscNamedMark   = #12;
@@ -593,7 +594,7 @@ begin
       T1:=HelpFacility^.LoadTopic(K1^.FileID,K1^.HelpCtx);
       T2:=HelpFacility^.LoadTopic(K2^.FileID,K2^.HelpCtx);
       if assigned(T1^.Text) and assigned(T2^.Text) then
-        r:=strcomp(pchar(T1^.Text),pchar(T2^.Text))
+        r:=strcomp(PAnsiChar(T1^.Text),PAnsiChar(T2^.Text))
       else
         r:=0;
       if r>0 then
@@ -864,8 +865,8 @@ begin
   if Line<>'' then AddLine(Line); Line:='';
 end;
 var KWCount,NLFlag: sw_integer;
-    LastFirstChar: char;
-procedure NewSection(FirstChar: char);
+    LastFirstChar: AnsiChar;
+procedure NewSection(FirstChar: AnsiChar);
 begin
   if FirstChar<=#64 then FirstChar:=#32;
   FlushLine;
@@ -948,7 +949,7 @@ begin
       if IsMultiple then
         Begin
           Inc(MultiCount);
-          (* St:=Trim(strpas(pchar(HelpFacility^.LoadTopic(KW^.FileID,KW^.HelpCtx)^.Text))); *)
+          (* St:=Trim(strpas(PAnsiChar(HelpFacility^.LoadTopic(KW^.FileID,KW^.HelpCtx)^.Text))); *)
           St:=KW^.Tag^+' ['+IntToStr(MultiCount)+']';
           (* { Remove all special chars }
           for p:=1 to Length(st) do

+ 2 - 1
packages/ide/whlpview.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 unit WHlpView;
+{$H-}
 
 interface
 
@@ -430,7 +431,7 @@ end;
 procedure THelpTopic.ReBuild;
 var TextPos,LinePos,LinkNo,NamedMarkNo: sw_word;
     Line,CurWord: string;
-    C: char;
+    C: AnsiChar;
     InLink,InCodeArea,InColorArea,InImage: boolean;
     LinkStart,LinkEnd,CodeAreaStart,CodeAreaEnd: TPoint;
     ColorAreaStart,ColorAreaEnd: TPoint;

+ 6 - 5
packages/ide/whtml.pas

@@ -13,6 +13,7 @@
 unit WHTML;
 
 {$I globdir.inc}
+{$H-}
 
 interface
 
@@ -55,7 +56,7 @@ type
       Line,LinePos: sw_integer;
       procedure   DocSoftBreak; virtual;
       function    GetFileName : string;
-      function    DocAddTextChar(C: char): boolean; virtual;
+      function    DocAddTextChar(C: AnsiChar): boolean; virtual;
       procedure   DocAddText(S: string); virtual;
       procedure   DocProcessTag(Tag: string); virtual;
       procedure   DocProcessComment(Comment: string); virtual;
@@ -69,7 +70,7 @@ type
     PHTMLParser = ^THTMLParser;
     THTMLParser = object(TSGMLParser)
       procedure   DocSoftBreak; virtual;
-      function    DocAddTextChar(C: char): boolean; virtual;
+      function    DocAddTextChar(C: AnsiChar): boolean; virtual;
       procedure   DocProcessTag(Tag: string); virtual;
       function    DocGetTagParam(Name: string; var Value: string): boolean; virtual;
       procedure   DocProcessComment(Comment: string); virtual;
@@ -251,7 +252,7 @@ end;
 
 function TSGMLParser.ProcessLine(LineText: string): boolean;
 var OK: boolean;
-    C: char;
+    C: AnsiChar;
     NewInString: boolean;
     OldInComment: boolean;
     WasThereAnyText: boolean;
@@ -351,7 +352,7 @@ begin
   Abstract;
 end;
 
-function TSGMLParser.DocAddTextChar(C: char): boolean;
+function TSGMLParser.DocAddTextChar(C: AnsiChar): boolean;
 begin
   Abstract;
   DocAddTextChar:=false;
@@ -388,7 +389,7 @@ procedure THTMLParser.DocSoftBreak;
 begin
 end;
 
-function THTMLParser.DocAddTextChar(C: char): boolean;
+function THTMLParser.DocAddTextChar(C: AnsiChar): boolean;
 begin
   { Abstract }
   DocAddTextChar:=false;

+ 10 - 9
packages/ide/whtmlhlp.pas

@@ -15,6 +15,7 @@ unit WHTMLHlp;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -76,7 +77,7 @@ type
     THTMLTopicRenderer = object(THTMLParser)
       function  BuildTopic(P: PTopic; AURL: string; HTMLFile: PTextFile; ATopicLinks: PTopicLinkCollection): boolean;
     public
-      function  DocAddTextChar(C: char): boolean; virtual;
+      function  DocAddTextChar(C: AnsiChar): boolean; virtual;
       procedure DocSoftBreak; virtual;
       procedure DocTYPE; virtual;
       procedure DocHTML(Entered: boolean); virtual;
@@ -140,13 +141,13 @@ type
       LinkIndexes: array[0..MaxTopicLinks] of sw_integer;
       FileIDLinkIndexes: array[0..MaxTopicLinks] of sw_integer;
       LinkPtr: sw_integer;
-      LastTextChar: char;
+      LastTextChar: AnsiChar;
 {      Anchor: TAnchor;}
       { Table stuff }
       CurrentTable : PTable;
       procedure AddText(const S: string);
-      procedure AddChar(C: char);
-      procedure AddCharAt(C: char;AtPtr : sw_word);
+      procedure AddChar(C: AnsiChar);
+      procedure AddCharAt(C: AnsiChar;AtPtr : sw_word);
       function AddTextAt(const S: string;AtPtr : sw_word) : sw_word;
       function ComputeTextLength(TStart,TEnd : sw_word) : sw_word;
     end;
@@ -508,7 +509,7 @@ end;
 procedure THTMLAnsiView.CopyToHTML;
 var
   Attr,NewAttr : byte;
-  c : char;
+  c : AnsiChar;
   X,Y,Pos : longint;
 begin
    Attr:=(Buffer^[1] shr 8);
@@ -548,7 +549,7 @@ begin
   DefHTMLGetSectionColor:=false;
 end;
 
-function CharStr(C: char; Count: byte): string;
+function CharStr(C: AnsiChar; Count: byte): string;
 var S: string;
 begin
   setlength(s,count);
@@ -557,7 +558,7 @@ begin
 end;
 
 
-function THTMLTopicRenderer.DocAddTextChar(C: char): boolean;
+function THTMLTopicRenderer.DocAddTextChar(C: AnsiChar): boolean;
 var Added: boolean;
 begin
   Added:=false;
@@ -1188,7 +1189,7 @@ begin
   PAlign:=OAlign;
 end;
 
-procedure THTMLTopicRenderer.AddChar(C: char);
+procedure THTMLTopicRenderer.AddChar(C: AnsiChar);
 begin
   if (Topic=nil) or (TextPtr=MaxBytes) or SuppressOutput then Exit;
   Topic^.Text^[TextPtr]:=ord(C);
@@ -1197,7 +1198,7 @@ begin
     AnyCharsInLine:=true;
 end;
 
-procedure THTMLTopicRenderer.AddCharAt(C: char;AtPtr : sw_word);
+procedure THTMLTopicRenderer.AddCharAt(C: AnsiChar;AtPtr : sw_word);
 begin
   if (Topic=nil) or (TextPtr=MaxBytes) or SuppressOutput then Exit;
   if AtPtr>TextPtr then

+ 3 - 2
packages/ide/whtmlscn.pas

@@ -17,6 +17,7 @@ unit WHTMLScn;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -32,7 +33,7 @@ type
      PHTMLLinkScanDocument = ^THTMLLinkScanDocument;
 
      TCustomHTMLLinkScanner = object(THTMLParser)
-       function    DocAddTextChar(C: char): boolean; virtual;
+       function    DocAddTextChar(C: AnsiChar): boolean; virtual;
        procedure   DocAnchor(Entered: boolean); virtual;
      public
     {a}function    CheckURL(const URL: string): boolean; virtual;
@@ -202,7 +203,7 @@ const
 const
   CurrentHTMLIndexVersion : sw_integer = HTMLIndexVersion;
 
-function TCustomHTMLLinkScanner.DocAddTextChar(C: char): boolean;
+function TCustomHTMLLinkScanner.DocAddTextChar(C: AnsiChar): boolean;
 var Added: boolean;
 begin
   Added:=false;

+ 12 - 12
packages/ide/winclip.pas

@@ -24,8 +24,8 @@ function WinClipboardSupported : boolean;
 function OpenWinClipboard : boolean;
 function EmptyWinClipboard : boolean;
 function GetTextWinClipboardSize : longint;
-function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
-function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
+function GetTextWinClipBoardData(var p : PAnsiChar;var l : longint) : boolean;
+function SetTextWinClipBoardData(p : PAnsiChar;l : longint) : boolean;
 {$endif WinClipSupported}
 
 implementation
@@ -127,7 +127,7 @@ begin
   HC:=GetClipBoardData(CF_OEMTEXT);
   if HC<>0 then
     begin
-      InternGetDataSize:=strlen(pchar(GlobalLock(HC)))+1;
+      InternGetDataSize:=strlen(PAnsiChar(GlobalLock(HC)))+1;
       GlobalUnlock(HC);
     end
   else
@@ -173,7 +173,7 @@ begin
   CloseWinClipboard;
 end;
 
-function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
+function GetTextWinClipBoardData(var p : PAnsiChar;var l : longint) : boolean;
 var
 {$ifdef DOS}
   r : Registers;
@@ -181,11 +181,11 @@ var
 {$endif DOS}
 {$ifdef Windows}
   h : HGlobal;
-  pp : pchar;
+  pp : PAnsiChar;
 {$endif Windows}
 {$ifdef HASAMIGA}
   Text: AnsiString;
-  pp: PChar;
+  pp: PAnsiChar;
 {$endif HASAMIGA}
 begin
   p:=nil;
@@ -213,7 +213,7 @@ begin
   h:=GetClipboardData(CF_OEMTEXT);
   if h<>0 then
     begin
-      pp:=pchar(GlobalLock(h));
+      pp:=PAnsiChar(GlobalLock(h));
       l:=strlen(pp)+1;
       getmem(p,l);
       move(pp^,p^,l);
@@ -236,7 +236,7 @@ begin
 {$endif DOS}
 end;
 
-function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
+function SetTextWinClipBoardData(p : PAnsiChar;l : longint) : boolean;
 var
 {$ifdef DOS}
   r : Registers;
@@ -244,11 +244,11 @@ var
 {$endif DOS}
 {$ifdef Windows}
   h : HGlobal;
-  pp : pchar;
+  pp : PAnsiChar;
   res : boolean;
 {$endif Windows}
 {$ifdef HASAMIGA}
-  pp: PChar;
+  pp: PAnsiChar;
   Test: AnsiString;
 {$endif HASAMIGA}
 begin
@@ -280,12 +280,12 @@ begin
 {$endif DOS}
 {$ifdef Windows}
   h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
-  pp:=pchar(GlobalLock(h));
+  pp:=PAnsiChar(GlobalLock(h));
   move(p^,pp^,l+1);
   GlobalUnlock(h);
   res:=(SetClipboardData(CF_OEMTEXT,h)=h);
   h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
-  pp:=pchar(GlobalLock(h));
+  pp:=PAnsiChar(GlobalLock(h));
   OemToCharBuffA(p,pp,l+1);
   SetClipboardData(CF_TEXT,h);
   GlobalUnlock(h);

+ 4 - 2
packages/ide/windebug.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 Unit windebug;
 
+{$H-}
+
 interface
 
 {$ifndef NODEBUG}
@@ -55,7 +57,7 @@ function CygDrivePrefix : string;
 var
   i : longint;
   length : dword;
-  Value : pchar;
+  Value : PAnsiChar;
   _type : dword;
   Key,NKey : HKey;
 begin
@@ -107,7 +109,7 @@ const
 
 
 function GetWindowHandle(H : HWND; state : LPARAM) : WINBOOL;stdcall;
-   var pTitle, pEnd, pNewTitle : pchar;
+   var pTitle, pEnd, pNewTitle : PAnsiChar;
        len : longint;
    begin
      GetWindowHandle:=true;

+ 6 - 5
packages/ide/wini.pas

@@ -17,6 +17,7 @@ unit WINI;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -88,8 +89,8 @@ type
     end;
 
 const MainSectionName : string[40] = 'MainSection';
-      CommentChar     : char = ';';
-      ValidStrDelimiters: set of char = ['''','"'];
+      CommentChar     : AnsiChar = ';';
+      ValidStrDelimiters: set of AnsiChar = ['''','"'];
 
 function EscapeIniText(S : string) : String;
 
@@ -100,7 +101,7 @@ uses
 
 function EscapeIniText(S : string) : String;
 var
-  delimiter : char;
+  delimiter : AnsiChar;
   i: integer;
 begin
   delimiter:=#0;
@@ -231,9 +232,9 @@ procedure TINIEntry.Split;
 var S,ValueS: string;
     P,P2,StartP: longint;
     { using byte for P2 lead to infinite loops PM }
-    C: char;
+    C: AnsiChar;
     InString: boolean;
-    Delimiter: char;
+    Delimiter: AnsiChar;
 begin
   S:=GetText;
   Delimiter:=#0;

+ 7 - 6
packages/ide/wnghelp.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 {$R-}
+{$H-}
 unit WNGHelp;
 
 {$ifdef cpullvm}
@@ -35,12 +36,12 @@ const
 
 type
       TNGFileHeader = packed record
-        Signature     : array[1..2] of char;
+        Signature     : array[1..2] of AnsiChar;
         Unknown       : word;
         Version       : word;
         MenuCount     : word;
-        GuideName     : array[8..47] of char;
-        Credits       : array[48..377] of char;
+        GuideName     : array[8..47] of AnsiChar;
+        Credits       : array[48..377] of AnsiChar;
       end;
 
       TNGRecordHeader = packed record
@@ -118,9 +119,9 @@ type
         function ReadRecord(var R: TRecord; ReadData: boolean): boolean;
       end;
 
-    TNGGetAttrColorProc = function(Attr: char; var Color: byte): boolean;
+    TNGGetAttrColorProc = function(Attr: AnsiChar; var Color: byte): boolean;
 
-function DefNGGetAttrColor(Attr: char; var Color: byte): boolean;
+function DefNGGetAttrColor(Attr: AnsiChar; var Color: byte): boolean;
 
 const NGGetAttrColor : TNGGetAttrColorProc = {$ifdef fpc}@{$endif}DefNGGetAttrColor;
 
@@ -129,7 +130,7 @@ procedure RegisterHelpType;
 implementation
 
 
-function DefNGGetAttrColor(Attr: char; var Color: byte): boolean;
+function DefNGGetAttrColor(Attr: AnsiChar; var Color: byte): boolean;
 begin
   DefNGGetAttrColor:=false;
 end;

+ 8 - 7
packages/ide/woahelp.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 {$R-}
+{$H-}
 unit WOAHelp;
 
 interface
@@ -41,8 +42,8 @@ const
       ctNibble       = $02;
 
 type
-      FileStamp      = array [0..32] of char; {+ null terminator + $1A }
-      FileSignature  = array [0..12] of char; {+ null terminator }
+      FileStamp      = array [0..32] of AnsiChar; {+ null terminator + $1A }
+      FileSignature  = array [0..12] of AnsiChar; {+ null terminator }
 
       THLPVersion = packed record
         FormatVersion : byte;
@@ -385,7 +386,7 @@ begin
   Inc(SrcPtr);
   GetNextNibble:=N;
 end;
-procedure RealAddChar(C: char);
+procedure RealAddChar(C: AnsiChar);
 begin
   if Assigned(NewR.Data) then
     PByteArray(NewR.Data)^[DestPtr]:=ord(C);
@@ -393,7 +394,7 @@ begin
 end;
 var CurX,CurY: integer;
     InLink: boolean;
-procedure AddChar(C: char);
+procedure AddChar(C: AnsiChar);
 begin
   if IsLinkPosStart(CurX+2,CurY) then
     begin
@@ -421,10 +422,10 @@ begin
     end;
 end;
 var OK: boolean;
-    C: char;
+    C: AnsiChar;
     P: pointer;
-function GetNextChar: char;
-var C: char;
+function GetNextChar: AnsiChar;
+var C: AnsiChar;
     I,N,Cnt: byte;
 begin
   N:=GetNextNibble;

+ 8 - 6
packages/ide/wos2help.pas

@@ -13,10 +13,12 @@
 
  **********************************************************************}
 {$R-}
+{$H-}
 unit WOS2Help;
 
 interface
 
+
 uses Objects,
      WUtils,WHelp;
 
@@ -31,7 +33,7 @@ const
 
 type
       TINFFileHeader = packed record
-        Signature   : array[1..2] of char;{ ID magic word (5348h = "HS")                 }
+        Signature   : array[1..2] of AnsiChar;{ ID magic word (5348h = "HS")                 }
         Unknown1    : byte;      { unknown purpose, could be third letter of ID }
         Flags       : byte;      { probably a flag word...                      }
                                  {  bit 0: set if INF style file                }
@@ -68,7 +70,7 @@ type
         NLSTabSize  : longint;   { size of NLS table                            }
         ExtBlockOfs : longint;   { 32 bit file offset of extended data block    }
         Unknown5: array[1..12] of byte;{ unknown purpose                        }
-        Title       : array[1..48] of char;{ ASCII title of database            }
+        Title       : array[1..48] of AnsiChar;{ ASCII title of database            }
       end;
 
       PINFTOCArray = ^TINFTOCArray;
@@ -213,7 +215,7 @@ end;
 function TOS2HelpFile.ReadDictionary: boolean;
 var OK: boolean;
     I: longint;
-    C: array[0..255] of char;
+    C: array[0..255] of AnsiChar;
     B: byte;
 begin
   F^.Seek(Header.DictOfs);
@@ -251,7 +253,7 @@ var OK: boolean;
     I,Count: longint;
     TE: TINFTOCEntry;
     W: word;
-    C: array[0..255] of char;
+    C: array[0..255] of AnsiChar;
     StartOfs: longint;
     S: string;
     SubSlots: PWordArray;
@@ -326,7 +328,7 @@ begin
   if Line<>'' then Lines^.InsertStr(Line);
   Line:='';
 end;
-procedure AddChar(C: char);
+procedure AddChar(C: AnsiChar);
 begin
   if length(Line)>=255 then FlushLine;
   Line:=Line+C;
@@ -337,7 +339,7 @@ begin
   for I:=1 to length(S) do
     AddChar(S[I]);
 end;
-procedure AddTextChar(C: char);
+procedure AddTextChar(C: AnsiChar);
 begin
   if (C=hscLineBreak) then
   begin

+ 1 - 0
packages/ide/wresourc.pas

@@ -17,6 +17,7 @@ unit WResourc;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 

+ 2 - 0
packages/ide/wtphwrit.pas

@@ -14,6 +14,8 @@
  **********************************************************************}
 unit WTPHWriter;
 
+{$H-}
+
 interface
 
 uses

+ 16 - 15
packages/ide/wutils.pas

@@ -15,6 +15,7 @@ unit WUtils;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$H-}
 
 interface
 
@@ -47,7 +48,7 @@ const
 
   { Get DirSep and EOL from System unit, instead of redefining 
     here with tons of $ifdefs (KB) }
-  DirSep : char = System.DirectorySeparator;
+  DirSep : AnsiChar = System.DirectorySeparator;
   EOL : String[2] = System.LineEnding;
 
 
@@ -127,9 +128,9 @@ procedure ReadlnFromFile(var f : file; var S:string;
 function Min(A,B: longint): longint;
 function Max(A,B: longint): longint;
 
-function CharStr(C: char; Count: integer): string;
+function CharStr(C: AnsiChar; Count: integer): string;
 function UpcaseStr(const S: string): string;
-function LowCase(C: char): char;
+function LowCase(C: AnsiChar): AnsiChar;
 function LowcaseStr(S: string): string;
 function RExpand(const S: string; MinLen: byte): string;
 function LExpand(const S: string; MinLen: byte): string;
@@ -144,7 +145,7 @@ function StrToCard(const S: string): cardinal;
 function FloatToStr(D: Double; Decimals: byte): string;
 function FloatToStrL(D: Double; Decimals: byte; MinLen: byte): string;
 function GetStr(P: PString): string;
-function GetPChar(P: PChar): string;
+function GetPChar(P: PAnsiChar): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
 function LExtendString(S: string; MinLen: byte): string;
 
@@ -233,7 +234,7 @@ end;
 
 procedure ReadlnFromStream(Stream: PStream; var S:string;var linecomplete,hasCR : boolean);
   var
-    c : char;
+    c : AnsiChar;
     i,pos : longint;
   begin
     linecomplete:=false;
@@ -280,7 +281,7 @@ procedure ReadlnFromFile(var f : file; var S:string;
            var linecomplete,hasCR : boolean;
            BreakOnSpacesOnly : boolean);
   var
-    c : char;
+    c : AnsiChar;
     i,pos,
     lastspacepos,LastSpaceFilePos : longint;
 {$ifdef DEBUG}
@@ -371,7 +372,7 @@ begin
   if A<B then Min:=A else Min:=B;
 end;
 
-function CharStr(C: char; Count: integer): string;
+function CharStr(C: AnsiChar; Count: integer): string;
 begin
   if Count<=0 then
     begin
@@ -509,7 +510,7 @@ begin
   if P=nil then GetStr:='' else GetStr:=P^;
 end;
 
-function GetPChar(P: PChar): string;
+function GetPChar(P: PAnsiChar): string;
 begin
   if P=nil then GetPChar:='' else GetPChar:=StrPas(P);
 end;
@@ -617,9 +618,9 @@ function GetLongName(const n:string):string;
 {$ifdef Windows}
 var
   hs : string;
-  hs2 : Array [0..255] of char;
+  hs2 : Array [0..255] of AnsiChar;
   i : longint;
-  j : pchar;
+  j : PAnsiChar;
 {$endif}
 {$ifdef go32v2}
 var
@@ -650,7 +651,7 @@ begin
 end;
 
 
-function LowCase(C: char): char;
+function LowCase(C: AnsiChar): AnsiChar;
 begin
   if ('A'<=C) and (C<='Z') then C:=chr(ord(C)+32);
   LowCase:=C;
@@ -850,7 +851,7 @@ end;
 
 procedure TFastBufStream.Readline(var s:string;var linecomplete,hasCR : boolean);
   var
-    c : char;
+    c : AnsiChar;
     i,pos,StartPos : longint;
     charsInS : boolean;
   begin
@@ -993,7 +994,7 @@ end;
 
 function FormatPath(Path: string): string;
 var P: sw_integer;
-    SC: char;
+    SC: AnsiChar;
 begin
   if ord(DirSep)=ord('/') then
     SC:='\'
@@ -1129,10 +1130,10 @@ end;
 function FormatDateTime(const D: DateTime; const Format: string): string;
 var I: sw_integer;
     CurCharStart: sw_integer;
-    CurChar: char;
+    CurChar: AnsiChar;
     CurCharCount: integer;
     DateS: string;
-    C: char;
+    C: AnsiChar;
 procedure FlushChars;
 var S: string;
     I: sw_integer;

+ 6 - 6
packages/ide/wviews.pas

@@ -244,7 +244,7 @@ var  FormatParams     : array[1..20] of ptrint;
 procedure ClearFormatParams;
 procedure AddFormatParam(P: pointer);
 procedure AddFormatParamInt(L: longint);
-procedure AddFormatParamChar(C: char);
+procedure AddFormatParamChar(C: AnsiChar);
 procedure AddFormatParamStr(const S: string);
 function FormatStrF(const Format: string; var Params): string;
 function FormatStrStr(const Format, Param: string): string;
@@ -345,7 +345,7 @@ type
 var
   AutoSelect: Boolean;
   Action: MenuAction;
-  Ch: Char;
+  Ch: AnsiChar;
   Res: Word;
   ItemShown, P: PMenuItem;
 {$ifdef WinClipSupported}
@@ -627,7 +627,7 @@ type
 var
   AutoSelect: Boolean;
   Action: MenuAction;
-  Ch: Char;
+  Ch: AnsiChar;
   Res: Word;
   ItemShown, P: PMenuItem;
   Target: PMenuView;
@@ -960,7 +960,7 @@ type
 var
   AutoSelect: Boolean;
   Action: MenuAction;
-  Ch: Char;
+  Ch: AnsiChar;
   Res: Word;
   ItemShown, P: PMenuItem;
   Target: PMenuView;
@@ -2209,7 +2209,7 @@ end;
 procedure TDropDownListBox.Draw;
 var B: TDrawBuffer;
     C,TextC: word;
-    LC: char;
+    LC: AnsiChar;
 begin
   if GetState(sfFocused)=false then
     begin
@@ -2352,7 +2352,7 @@ begin
   FormatParams[FormatParamCount]:=L;
 end;
 
-procedure AddFormatParamChar(C: char);
+procedure AddFormatParamChar(C: AnsiChar);
 begin
   AddFormatParamInt(ord(C));
 end;

+ 2 - 1
packages/ide/wvphelp.pas

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 {$R-}
+{$H-}
 unit WVPHelp;
 
 interface
@@ -126,7 +127,7 @@ end;
 
 function TVPHHelpFile.ReadBlock(Data: pointer; DataSize: longint): boolean;
 var OK: boolean;
-    C: char;
+    C: AnsiChar;
 begin
   F^.Read(C,sizeof(C));
   OK:=(F^.Status=stOK) and (C='þ');

+ 5 - 4
packages/ide/wwinhelp.pas

@@ -18,6 +18,7 @@ unit WWinHelp;
 {$ifdef cpullvm}
 {$modeswitch nestedprocvars}
 {$endif}
+{$h-}
 
 interface
 
@@ -79,7 +80,7 @@ type
         Magic            : word;
         Flags            : word; { 0x0002 always set, 0x0400 set if directory }
         PageSize         : word;
-        DataFormat       : array[1..16] of char;
+        DataFormat       : array[1..16] of AnsiChar;
         MustBeZero       : word; { $0000 }
         PageSplits       : word;
         RootPage         : word;
@@ -242,7 +243,7 @@ uses Strings;
 
 function ReadString(F: PStream): string;
 var S: string;
-    C: char;
+    C: AnsiChar;
 begin
   S:='';
   if Assigned(F) then
@@ -1272,7 +1273,7 @@ begin
   if length(S)>0 then
     LastEmittedChar:=ord(S[length(S)]);
 end;
-procedure EmitTextC(C: PChar);
+procedure EmitTextC(C: PAnsiChar);
 var RemSize,CurOfs,CurFrag: longint;
     S: string;
 begin
@@ -1399,7 +1400,7 @@ var Finished: boolean;
     Len: word;
     SLen,LinkOfs: longint;
     SPtr: pointer;
-    SBuf: PChar;
+    SBuf: PAnsiChar;
     PictureSize,PictureStartOfs: longint;
     FontNumber: integer;
 begin