diff options
38 files changed, 341 insertions, 440 deletions
diff --git a/compiler/assemble.pas b/compiler/assemble.pas index bc0dcbcf61..352d023163 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -301,7 +301,7 @@ Implementation const lastas : byte=255; var - LastASBin : string; + LastASBin : TCmdStr; Function TExternalAssembler.FindAssembler:string; var asfound : boolean; diff --git a/compiler/cclasses.pas b/compiler/cclasses.pas index 9b19dc46ca..af21120d9c 100644 --- a/compiler/cclasses.pas +++ b/compiler/cclasses.pas @@ -36,6 +36,7 @@ interface {$ELSE} fksysutl, {$ENDIF} + globtype, CUtils,CStreams; {******************************************** @@ -368,47 +369,45 @@ type end; {******************************************** - TStringList + TCmdStrList ********************************************} { string containerItem } - TStringListItem = class(TLinkedListItem) - FPStr : pshortstring; + TCmdStrListItem = class(TLinkedListItem) + FPStr : TCmdStr; public - constructor Create(const s:string); + constructor Create(const s:TCmdStr); destructor Destroy;override; function GetCopy:TLinkedListItem;override; - function Str:string; {$ifdef CCLASSESINLINE}inline;{$endif} + function Str:TCmdStr; {$ifdef CCLASSESINLINE}inline;{$endif} end; { string container } - TStringList = class(TLinkedList) + TCmdStrList = class(TLinkedList) private FDoubles : boolean; { if this is set to true, doubles are allowed } public constructor Create; constructor Create_No_Double; { inserts an Item } - procedure Insert(const s:string); + procedure Insert(const s:TCmdStr); { concats an Item } - procedure Concat(const s:string); + procedure Concat(const s:TCmdStr); { deletes an Item } - procedure Remove(const s:string); + procedure Remove(const s:TCmdStr); { Gets First Item } - function GetFirst:string; + function GetFirst:TCmdStr; { Gets last Item } - function GetLast:string; + function GetLast:TCmdStr; { true if string is in the container, compare case sensitive } - function FindCase(const s:string):TStringListItem; + function FindCase(const s:TCmdStr):TCmdStrListItem; { true if string is in the container } - function Find(const s:string):TStringListItem; + function Find(const s:TCmdStr):TCmdStrListItem; { inserts an item } - procedure InsertItem(item:TStringListItem); {$ifdef CCLASSESINLINE}inline;{$endif} + procedure InsertItem(item:TCmdStrListItem); {$ifdef CCLASSESINLINE}inline;{$endif} { concats an item } - procedure ConcatItem(item:TStringListItem); {$ifdef CCLASSESINLINE}inline;{$endif} + procedure ConcatItem(item:TCmdStrListItem); {$ifdef CCLASSESINLINE}inline;{$endif} property Doubles:boolean read FDoubles write FDoubles; - procedure readstream(f:TCStream); - procedure writestream(f:TCStream); end; @@ -2094,74 +2093,74 @@ end; {**************************************************************************** - TStringListItem + TCmdStrListItem ****************************************************************************} - constructor TStringListItem.Create(const s:string); + constructor TCmdStrListItem.Create(const s:TCmdStr); begin inherited Create; - FPStr:=stringdup(s); + FPStr:=s; end; - destructor TStringListItem.Destroy; + destructor TCmdStrListItem.Destroy; begin - stringdispose(FPStr); + FPStr:=''; end; - function TStringListItem.Str:string; + function TCmdStrListItem.Str:TCmdStr; begin - Str:=FPStr^; + Str:=FPStr; end; - function TStringListItem.GetCopy:TLinkedListItem; + function TCmdStrListItem.GetCopy:TLinkedListItem; begin Result:=(inherited GetCopy); - TStringListItem(Result).FPStr:=stringdup(FPstr^); + TCmdStrListItem(Result).FPStr:=FPstr; end; {**************************************************************************** - TSTRINGList + TCmdStrList ****************************************************************************} - constructor tstringList.Create; + constructor TCmdStrList.Create; begin inherited Create; FDoubles:=true; end; - constructor tstringList.Create_no_double; + constructor TCmdStrList.Create_no_double; begin inherited Create; FDoubles:=false; end; - procedure tstringList.insert(const s : string); + procedure TCmdStrList.insert(const s : TCmdStr); begin if (s='') or ((not FDoubles) and (find(s)<>nil)) then exit; - inherited insert(tstringListItem.create(s)); + inherited insert(TCmdStrListItem.create(s)); end; - procedure tstringList.concat(const s : string); + procedure TCmdStrList.concat(const s : TCmdStr); begin if (s='') or ((not FDoubles) and (find(s)<>nil)) then exit; - inherited concat(tstringListItem.create(s)); + inherited concat(TCmdStrListItem.create(s)); end; - procedure tstringList.remove(const s : string); + procedure TCmdStrList.remove(const s : TCmdStr); var - p : tstringListItem; + p : TCmdStrListItem; begin if s='' then exit; @@ -2174,188 +2173,90 @@ end; end; - function tstringList.GetFirst : string; + function TCmdStrList.GetFirst : TCmdStr; var - p : tstringListItem; + p : TCmdStrListItem; begin - p:=tstringListItem(inherited GetFirst); + p:=TCmdStrListItem(inherited GetFirst); if p=nil then GetFirst:='' else begin - GetFirst:=p.FPStr^; + GetFirst:=p.FPStr; p.free; end; end; - function tstringList.Getlast : string; + function TCmdStrList.Getlast : TCmdStr; var - p : tstringListItem; + p : TCmdStrListItem; begin - p:=tstringListItem(inherited Getlast); + p:=TCmdStrListItem(inherited Getlast); if p=nil then Getlast:='' else begin - Getlast:=p.FPStr^; + Getlast:=p.FPStr; p.free; end; end; - function tstringList.FindCase(const s:string):TstringListItem; + function TCmdStrList.FindCase(const s:TCmdStr):TCmdStrListItem; var - NewNode : tstringListItem; + NewNode : TCmdStrListItem; begin result:=nil; if s='' then exit; - NewNode:=tstringListItem(FFirst); + NewNode:=TCmdStrListItem(FFirst); while assigned(NewNode) do begin - if NewNode.FPStr^=s then + if NewNode.FPStr=s then begin result:=NewNode; exit; end; - NewNode:=tstringListItem(NewNode.Next); + NewNode:=TCmdStrListItem(NewNode.Next); end; end; - function tstringList.Find(const s:string):TstringListItem; + function TCmdStrList.Find(const s:TCmdStr):TCmdStrListItem; var - NewNode : tstringListItem; + NewNode : TCmdStrListItem; ups : string; begin result:=nil; if s='' then exit; ups:=upper(s); - NewNode:=tstringListItem(FFirst); + NewNode:=TCmdStrListItem(FFirst); while assigned(NewNode) do begin - if upper(NewNode.FPStr^)=ups then + if upper(NewNode.FPStr)=ups then begin result:=NewNode; exit; end; - NewNode:=tstringListItem(NewNode.Next); + NewNode:=TCmdStrListItem(NewNode.Next); end; end; - procedure TStringList.InsertItem(item:TStringListItem); + procedure TCmdStrList.InsertItem(item:TCmdStrListItem); begin inherited Insert(item); end; - procedure TStringList.ConcatItem(item:TStringListItem); + procedure TCmdStrList.ConcatItem(item:TCmdStrListItem); begin inherited Concat(item); end; - procedure TStringList.readstream(f:TCStream); - const - BufSize = 16384; - var - Hsp, - p,maxp, - Buf : PChar; - Prev : Char; - HsPos, - ReadLen, - BufPos, - BufEnd : Longint; - hs : string; - - procedure ReadBuf; - begin - if BufPos<BufEnd then - begin - Move(Buf[BufPos],Buf[0],BufEnd-BufPos); - Dec(BufEnd,BufPos); - BufPos:=0; - end; - ReadLen:=f.Read(buf[BufEnd],BufSize-BufEnd); - inc(BufEnd,ReadLen); - end; - - begin - Getmem(Buf,Bufsize); - BufPos:=0; - BufEnd:=0; - HsPos:=1; - ReadBuf; - repeat - hsp:=@hs[hsPos]; - p:=@Buf[BufPos]; - maxp:=@Buf[BufEnd]; - while (p<maxp) and not(P^ in [#10,#13]) do - begin - hsp^:=p^; - inc(p); - if hsp-@hs[1]<255 then - inc(hsp); - end; - inc(BufPos,maxp-p); - inc(HsPos,maxp-p); - prev:=p^; - inc(BufPos); - { no system uses #10#13 as line seperator (#10 = *nix, #13 = Mac, } - { #13#10 = Dos), so if we've got #10, we can safely exit } - if (prev<>#10) then - begin - if (BufPos>=BufEnd) then - begin - ReadBuf; - if BufPos>=BufEnd then - break; - end; - { is there also a #10 after it? } - if prev=#13 then - begin - if (Buf[BufPos]=#10) then - inc(BufPos); - prev:=#10; - end; - end; - if prev=#10 then - begin - hs[0]:=char(hsp-@hs[1]); - Concat(hs); - HsPos:=1; - end; - until BufPos>=BufEnd; - hs[0]:=char(hsp-@hs[1]); - Concat(hs); - freemem(buf); - end; - - - procedure TStringList.writestream(f:TCStream); - var - Node : TStringListItem; - LineEnd : string[2]; - begin - Case DefaultTextLineBreakStyle Of - tlbsLF: LineEnd := #10; - tlbsCRLF: LineEnd := #13#10; - tlbsCR: LineEnd := #13; - End; - Node:=tstringListItem(FFirst); - while assigned(Node) do - begin - f.Write(Node.FPStr^[1],Length(Node.FPStr^)); - f.Write(LineEnd[1],length(LineEnd)); - Node:=tstringListItem(Node.Next); - end; - end; - - {**************************************************************************** tdynamicarray ****************************************************************************} diff --git a/compiler/cfileutils.pas b/compiler/cfileutils.pas index 2fbc6ad36a..1e4f1c5a90 100644 --- a/compiler/cfileutils.pas +++ b/compiler/cfileutils.pas @@ -81,11 +81,11 @@ interface function FindClose(var Res:TCachedSearchRec):boolean; end; - TSearchPathList = class(TStringList) - procedure AddPath(s:string;addfirst:boolean);overload; - procedure AddPath(SrcPath,s:string;addfirst:boolean);overload; + TSearchPathList = class(TCmdStrList) + procedure AddPath(s:TCmdStr;addfirst:boolean);overload; + procedure AddPath(SrcPath,s:TCmdStr;addfirst:boolean);overload; procedure AddList(list:TSearchPathList;addfirst:boolean); - function FindFile(const f : string;allowcache:boolean;var foundfile:string):boolean; + function FindFile(const f : TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; end; function bstoslash(const s : string) : string; @@ -97,16 +97,16 @@ interface function path_absolute(const s : string) : boolean; Function PathExists (const F : String;allowcache:boolean) : Boolean; Function FileExists (const F : String;allowcache:boolean) : Boolean; - function FileExistsNonCase(const path,fn:string;allowcache:boolean;var foundfile:string):boolean; + function FileExistsNonCase(const path,fn:TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; Function RemoveDir(d:string):boolean; Function FixPath(s:string;allowdot:boolean):string; function FixFileName(const s:string):string; function TargetFixPath(s:string;allowdot:boolean):string; function TargetFixFileName(const s:string):string; procedure SplitBinCmd(const s:string;var bstr: String;var cstr:TCmdStr); - function FindFile(const f : string;path : string;allowcache:boolean;var foundfile:string):boolean; - function FindFilePchar(const f : string;path : pchar;allowcache:boolean;var foundfile:string):boolean; - function FindExe(const bin:string;allowcache:boolean;var foundfile:string):boolean; + function FindFile(const f : TCmdStr;path : TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; + function FindFilePchar(const f : TCmdStr;path : pchar;allowcache:boolean;var foundfile:TCmdStr):boolean; + function FindExe(const bin:TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; function GetShortName(const n:string):string; procedure InitFileUtils; @@ -370,7 +370,7 @@ implementation end; - function FileExistsNonCase(const path,fn:string;allowcache:boolean;var foundfile:string):boolean; + function FileExistsNonCase(const path,fn:TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; var fn2 : string; begin @@ -743,29 +743,29 @@ implementation end; - procedure TSearchPathList.AddPath(s:string;addfirst:boolean); + procedure TSearchPathList.AddPath(s:TCmdStr;addfirst:boolean); begin AddPath('',s,AddFirst); end; - procedure TSearchPathList.AddPath(SrcPath,s:string;addfirst:boolean); + procedure TSearchPathList.AddPath(SrcPath,s:TCmdStr;addfirst:boolean); var staridx, j : longint; prefix, suffix, CurrentDir, - currPath : string; + currPath : TCmdStr; subdirfound : boolean; {$ifdef usedircache} dir : TCachedSearchRec; {$else usedircache} dir : TSearchRec; {$endif usedircache} - hp : TStringListItem; + hp : TCmdStrListItem; - procedure WarnNonExistingPath(const path : string); + procedure WarnNonExistingPath(const path : TCmdStr); begin if assigned(do_comment) then do_comment(V_Tried,'Path "'+path+'" not found'); @@ -899,7 +899,7 @@ implementation var s : string; hl : TSearchPathList; - hp,hp2 : TStringListItem; + hp,hp2 : TCmdStrListItem; begin if list.empty then exit; @@ -907,11 +907,11 @@ implementation if addfirst then begin hl:=TSearchPathList.Create; - hp:=TStringListItem(list.first); + hp:=TCmdStrListItem(list.first); while assigned(hp) do begin hl.insert(hp.Str); - hp:=TStringListItem(hp.next); + hp:=TCmdStrListItem(hp.next); end; while not hl.empty do begin @@ -923,40 +923,40 @@ implementation end else begin - hp:=TStringListItem(list.first); + hp:=TCmdStrListItem(list.first); while assigned(hp) do begin hp2:=Find(hp.Str); { Check if already in path, then we don't add it } if not assigned(hp2) then Concat(hp.Str); - hp:=TStringListItem(hp.next); + hp:=TCmdStrListItem(hp.next); end; end; end; - function TSearchPathList.FindFile(const f : string;allowcache:boolean;var foundfile:string):boolean; + function TSearchPathList.FindFile(const f :TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; Var - p : TStringListItem; + p : TCmdStrListItem; begin FindFile:=false; - p:=TStringListItem(first); + p:=TCmdStrListItem(first); while assigned(p) do begin result:=FileExistsNonCase(p.Str,f,allowcache,FoundFile); if result then exit; - p:=TStringListItem(p.next); + p:=TCmdStrListItem(p.next); end; { Return original filename if not found } FoundFile:=f; end; - function FindFile(const f : string;path : string;allowcache:boolean;var foundfile:string):boolean; + function FindFile(const f : TCmdStr;path : TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; Var - singlepathstring : string; + singlepathstring : TCmdStr; i : longint; begin {$ifdef Unix} @@ -979,9 +979,9 @@ implementation end; - function FindFilePchar(const f : string;path : pchar;allowcache:boolean;var foundfile:string):boolean; + function FindFilePchar(const f : TCmdStr;path : pchar;allowcache:boolean;var foundfile:TCmdStr):boolean; Var - singlepathstring : string; + singlepathstring : TCmdStr; startpc,pc : pchar; sepch : char; begin @@ -1002,8 +1002,8 @@ implementation startpc:=pc; while (pc^<>sepch) and (pc^<>';') and (pc^<>#0) do inc(pc); - move(startpc^,singlepathstring[1],pc-startpc); - singlepathstring[0]:=char(longint(pc-startpc)); + SetLength(singlepathstring, pc-startpc); + move(startpc^,singlepathstring[1],pc-startpc); singlepathstring:=FixPath(ExpandFileName(singlepathstring),false); result:=FileExistsNonCase(singlepathstring,f,allowcache,FoundFile); if result then @@ -1017,7 +1017,7 @@ implementation end; - function FindExe(const bin:string;allowcache:boolean;var foundfile:string):boolean; + function FindExe(const bin:TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean; var p : pchar; found : boolean; diff --git a/compiler/compiler.pas b/compiler/compiler.pas index b61d3a07a7..b825edd99e 100644 --- a/compiler/compiler.pas +++ b/compiler/compiler.pas @@ -199,13 +199,13 @@ function Compile(const cmd:string):longint; procedure writepathlist(w:longint;l:TSearchPathList); var - hp : tstringlistitem; + hp : TCmdStrListItem; begin - hp:=tstringlistitem(l.first); + hp:=TCmdStrListItem(l.first); while assigned(hp) do begin Message1(w,hp.str); - hp:=tstringlistitem(hp.next); + hp:=TCmdStrListItem(hp.next); end; end; diff --git a/compiler/comprsrc.pas b/compiler/comprsrc.pas index df94c01942..d25c72fe49 100644 --- a/compiler/comprsrc.pas +++ b/compiler/comprsrc.pas @@ -69,7 +69,7 @@ var n, s, resobj, - resbin : string; + resbin : TCmdStr; resfound, objused : boolean; begin diff --git a/compiler/cutils.pas b/compiler/cutils.pas index 6ecf154ff0..2741fa1173 100644 --- a/compiler/cutils.pas +++ b/compiler/cutils.pas @@ -98,7 +98,7 @@ interface If it is not quoted, or if the quoting is bad, s is not touched, and false is returned. } - function DePascalQuote(var s: string): Boolean; + function DePascalQuote(var s: ansistring): Boolean; function CompareStr(const S1, S2: string): Integer; function CompareText(S1, S2: string): integer; @@ -919,7 +919,7 @@ implementation end; - function DePascalQuote(var s: string): Boolean; + function DePascalQuote(var s: ansistring): Boolean; var destPos, sourcePos, len: Integer; t: string; diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas index 9ee7e40069..5658cab67f 100644 --- a/compiler/fmodule.pas +++ b/compiler/fmodule.pas @@ -136,7 +136,7 @@ interface loaded_from : tmodule; _exports : tlinkedlist; dllscannerinputlist : TFPHashList; - resourcefiles : tstringlist; + resourcefiles : TCmdStrList; linkunitofiles, linkunitstaticlibs, linkunitsharedlibs, @@ -192,7 +192,7 @@ interface compiled_module : tmodule; { Current module which is compiled } usedunits : tlinkedlist; { Used units for this program } loaded_units : tlinkedlist; { All loaded units } - SmartLinkOFiles : TStringList; { List of .o files which are generated, + SmartLinkOFiles : TCmdStrList; { List of .o files which are generated, used to delete them after linking } function get_module(moduleindex : longint) : tmodule; @@ -401,7 +401,7 @@ implementation locallibrarysearchpath:=TSearchPathList.Create; used_units:=TLinkedList.Create; dependent_units:=TLinkedList.Create; - resourcefiles:=TStringList.Create; + resourcefiles:=TCmdStrList.Create; linkunitofiles:=TLinkContainer.Create; linkunitstaticlibs:=TLinkContainer.Create; linkunitsharedlibs:=TLinkContainer.Create; @@ -625,7 +625,7 @@ implementation dependent_units.free; dependent_units:=TLinkedList.Create; resourcefiles.Free; - resourcefiles:=TStringList.Create; + resourcefiles:=TCmdStrList.Create; linkunitofiles.Free; linkunitofiles:=TLinkContainer.Create; linkunitstaticlibs.Free; diff --git a/compiler/fppu.pas b/compiler/fppu.pas index 34e3f54fa4..e29c1fd9fa 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -43,7 +43,7 @@ interface tppumodule = class(tmodule) ppufile : tcompilerppufile; { the PPU file } sourcefn : pshortstring; { Source specified with "uses .. in '..'" } - comments : tstringlist; + comments : TCmdStrList; {$ifdef Test_Double_checksum} crc_array : pointer; crc_size : longint; @@ -156,7 +156,7 @@ uses procedure tppumodule.queuecomment(s:string;v,w:longint); begin if comments = nil then - comments := tstringlist.create; + comments := TCmdStrList.create; comments.insert(s); end; @@ -260,18 +260,18 @@ uses function tppumodule.search_unit(onlysource,shortname:boolean):boolean; var singlepathstring, - filename : string; + filename : TCmdStr; - Function UnitExists(const ext:string;var foundfile:string):boolean; + Function UnitExists(const ext:string;var foundfile:TCmdStr):boolean; begin Message1(unit_t_unitsearch,Singlepathstring+filename+ext); UnitExists:=FindFile(FileName+ext,Singlepathstring,true,foundfile); end; - Function PPUSearchPath(const s:string):boolean; + Function PPUSearchPath(const s:TCmdStr):boolean; var found : boolean; - hs : string; + hs : TCmdStr; begin Found:=false; singlepathstring:=FixPath(s,false); @@ -285,10 +285,10 @@ uses PPUSearchPath:=Found; end; - Function SourceSearchPath(const s:string):boolean; + Function SourceSearchPath(const s:TCmdStr):boolean; var found : boolean; - hs : string; + hs : TCmdStr; begin Found:=false; singlepathstring:=FixPath(s,false); @@ -321,7 +321,7 @@ uses SourceSearchPath:=Found; end; - Function SearchPath(const s:string):boolean; + Function SearchPath(const s:TCmdStr):boolean; var found : boolean; begin @@ -336,24 +336,24 @@ uses Function SearchPathList(list:TSearchPathList):boolean; var - hp : TStringListItem; + hp : TCmdStrListItem; found : boolean; begin found:=false; - hp:=TStringListItem(list.First); + hp:=TCmdStrListItem(list.First); while assigned(hp) do begin found:=SearchPath(hp.Str); if found then break; - hp:=TStringListItem(hp.next); + hp:=TCmdStrListItem(hp.next); end; SearchPathList:=found; end; var fnd : boolean; - hs : string; + hs : TCmdStr; begin if shortname then filename:=FixFileName(Copy(realmodulename^,1,8)) @@ -679,8 +679,8 @@ uses procedure tppumodule.readsourcefiles; var temp,hs : string; - temp_dir : string; - main_dir : string; + temp_dir : TCmdStr; + main_dir : TCmdStr; found, is_main : boolean; orgfiletime, diff --git a/compiler/gendef.pas b/compiler/gendef.pas index 6eabbfd287..f8c285848e 100644 --- a/compiler/gendef.pas +++ b/compiler/gendef.pas @@ -40,7 +40,7 @@ type is_empty : boolean; WrittenOnDisk : boolean; exportlist, - importlist : tstringlist; + importlist : TCmdStrList; end; var @@ -62,8 +62,8 @@ begin fname:=fn; WrittenOnDisk:=false; is_empty:=true; - importlist:=TStringList.Create; - exportlist:=TStringList.Create; + importlist:=TCmdStrList.Create; + exportlist:=TCmdStrList.Create; end; diff --git a/compiler/globals.pas b/compiler/globals.pas index dd093906af..20ec772c99 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -157,7 +157,7 @@ interface procedure SetValue(key:AnsiString;Weight:Integer); procedure SortonWeight; function Find(key:AnsiString):AnsiString; - procedure Expand(src:TStringList;dest: TLinkStrMap); + procedure Expand(src:TCmdStrList;dest: TLinkStrMap); procedure UpdateWeights(Weightmap:TLinkStrMap); constructor Create; property count : longint read itemcnt; @@ -191,10 +191,10 @@ interface { directory where the utils can be found (options -FD) } utilsdirectory : TPathStr; { targetname specific prefix used by these utils (options -XP<path>) } - utilsprefix : TPathStr; + utilsprefix : TCmdStr; cshared : boolean; { pass --shared to ld to link C libs shared} Dontlinkstdlibpath: Boolean; { Don't add std paths to linkpath} - rlinkpath : TPathStr; { rpath-link linkdir override} + rlinkpath : TCmdStr; { rpath-link linkdir override} { some flags for global compiler switches } do_build, @@ -321,7 +321,7 @@ interface function filetimestring( t : longint) : string; function getrealtime : real; - procedure DefaultReplacements(var s:string); + procedure DefaultReplacements(var s:ansistring); function Shell(const command:ansistring): longint; function GetEnvPChar(const envname:string):pchar; @@ -491,11 +491,11 @@ implementation end; - procedure TLinkStrMap.Expand(Src:TStringList;Dest:TLinkStrMap); + procedure TLinkStrMap.Expand(Src:TCmdStrList;Dest:TLinkStrMap); // expands every thing in Src to Dest for linkorder purposes. var l,r : longint; - LibN : String; + LibN : TCmdStr; begin while not src.empty do begin @@ -598,7 +598,7 @@ implementation Default Macro Handling ****************************************************************************} - procedure DefaultReplacements(var s:string); + procedure DefaultReplacements(var s:ansistring); begin { Replace some macros } Replace(s,'$FPCVERSION',version_string); @@ -1032,7 +1032,8 @@ implementation procedure get_exepath; var - exeName:String; + localExepath : TCmdStr; + exeName:TCmdStr; {$ifdef need_path_search} hs1 : TPathStr; p : pchar; @@ -1054,12 +1055,12 @@ implementation {$else macos} p:=GetEnvPchar('PATH'); {$endif macos} - FindFilePChar(hs1,p,false,exepath); + FindFilePChar(hs1,p,false,localExepath); FreeEnvPChar(p); - exepath:=ExtractFilePath(exepath); + localExepath:=ExtractFilePath(localExepath); end; {$endif need_path_search} - exepath:=FixPath(exepath,false); + exepath:=FixPath(localExepath,false); end; diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 984bc21187..90368a0333 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -32,7 +32,7 @@ interface executed from the FPC application. In some circomstances, this can be more than 255 characters. That's why using Ansi Strings} TCmdStr = AnsiString; - TPathStr = ShortString; + TPathStr = String; { Natural integer register type and size for the target machine } {$ifdef cpu64bit} diff --git a/compiler/link.pas b/compiler/link.pas index 367049594b..64ae0cb046 100644 --- a/compiler/link.pas +++ b/compiler/link.pas @@ -27,6 +27,7 @@ unit link; interface uses + sysutils, cclasses, systems, fmodule, @@ -50,7 +51,7 @@ interface SysInitUnit : string[20]; ObjectFiles, SharedLibFiles, - StaticLibFiles : TStringList; + StaticLibFiles : TCmdStrList; Constructor Create;virtual; Destructor Destroy;override; procedure AddModuleFiles(hp:tmodule); @@ -64,7 +65,7 @@ interface Function MakeExecutable:boolean;virtual; Function MakeSharedLibrary:boolean;virtual; Function MakeStaticLibrary:boolean;virtual; - procedure ExpandAndApplyOrder(var Src:TStringList); + procedure ExpandAndApplyOrder(var Src:TCmdStrList); procedure LoadPredefinedLibraryOrder;virtual; function ReOrderEntries : boolean; end; @@ -75,7 +76,7 @@ interface Constructor Create;override; Destructor Destroy;override; Function FindUtil(const s:string):String; - Function DoExec(const command:string; para:TCmdStr;showinfo,useshell:boolean):boolean; + Function DoExec(const command:TCmdStr; para:TCmdStr;showinfo,useshell:boolean):boolean; procedure SetDefaultInfo;virtual; Function MakeStaticLibrary:boolean;override; end; @@ -100,7 +101,7 @@ interface property StaticLibraryList:TFPHashObjectList read FStaticLibraryList; property ImportLibraryList:TFPHashObjectList read FImportLibraryList; procedure DefaultLinkScript;virtual;abstract; - linkscript : TStringList; + linkscript : TCmdStrList; public IsSharedLibrary : boolean; Constructor Create;override; @@ -114,8 +115,8 @@ interface Linker : TLinker; function FindObjectFile(s : string;const unitpath:string;isunit:boolean) : string; - function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean; - function FindDLL(const s:string;var founddll:string):boolean; + function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : TCmdStr) : boolean; + function FindDLL(const s:string;var founddll:TCmdStr):boolean; procedure InitLinker; procedure DoneLinker; @@ -124,7 +125,6 @@ interface Implementation uses - SysUtils, cutils,cfileutils, script,globals,verbose,comphook,ppu, aasmbase,aasmtai,aasmdata,aasmcpu, @@ -141,7 +141,7 @@ Implementation function FindObjectFile(s:string;const unitpath:string;isunit:boolean) : string; var found : boolean; - foundfile : string; + foundfile : TCmdStr; begin findobjectfile:=''; if s='' then @@ -206,7 +206,7 @@ Implementation { searches a (windows) DLL file } - function FindDLL(const s:string;var founddll:string):boolean; + function FindDLL(const s:string;var founddll:TCmdStr):boolean; var sysdir : string; Found : boolean; @@ -234,7 +234,7 @@ Implementation { searches an library file } - function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean; + function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : TCmdStr) : boolean; var found : boolean; paths : string; @@ -287,9 +287,9 @@ Implementation Constructor TLinker.Create; begin Inherited Create; - ObjectFiles:=TStringList.Create_no_double; - SharedLibFiles:=TStringList.Create_no_double; - StaticLibFiles:=TStringList.Create_no_double; + ObjectFiles:=TCmdStrList.Create_no_double; + SharedLibFiles:=TCmdStrList.Create_no_double; + StaticLibFiles:=TCmdStrList.Create_no_double; end; @@ -428,7 +428,7 @@ Implementation Procedure TLinker.AddStaticLibrary(const S:String); var - ns : string; + ns : TCmdStr; found : boolean; begin if s='' then @@ -457,7 +457,7 @@ Implementation Procedure TLinker.AddStaticCLibrary(const S:String); var - ns : string; + ns : TCmdStr; found : boolean; begin if s='' then @@ -499,7 +499,7 @@ Implementation end; - Procedure TLinker.ExpandAndApplyOrder(var Src:TStringList); + Procedure TLinker.ExpandAndApplyOrder(var Src:TCmdStrList); var p : TLinkStrMap; i : longint; @@ -584,7 +584,7 @@ Implementation Function TExternalLinker.FindUtil(const s:string):string; var Found : boolean; - FoundBin : string; + FoundBin : TCmdStr; UtilExe : string; begin if cs_link_on_target in current_settings.globalswitches then @@ -611,7 +611,7 @@ Implementation end; - Function TExternalLinker.DoExec(const command:string; para:TCmdStr;showinfo,useshell:boolean):boolean; + Function TExternalLinker.DoExec(const command:TCmdStr; para:TCmdStr;showinfo,useshell:boolean):boolean; var exitcode: longint; begin @@ -656,12 +656,12 @@ Implementation Function TExternalLinker.MakeStaticLibrary:boolean; - function GetNextFiles(const maxCmdLength : AInt; var item : TStringListItem) : ansistring; + function GetNextFiles(const maxCmdLength : AInt; var item : TCmdStrListItem) : ansistring; begin result := ''; while (assigned(item) and ((length(result) + length(item.str) + 1) < maxCmdLength)) do begin result := result + ' ' + item.str; - item := TStringListItem(item.next); + item := TCmdStrListItem(item.next); end; end; @@ -669,7 +669,7 @@ Implementation binstr, scriptfile : string; success : boolean; cmdstr, nextcmd, smartpath : TCmdStr; - current : TStringListItem; + current : TCmdStrListItem; script: Text; scripted_ar : boolean; begin @@ -692,11 +692,11 @@ Implementation Rewrite(script); try writeln(script, 'CREATE ' + current_module.staticlibfilename^); - current := TStringListItem(SmartLinkOFiles.First); + current := TCmdStrListItem(SmartLinkOFiles.First); while current <> nil do begin writeln(script, 'ADDMOD ' + current.str); - current := TStringListItem(current.next); + current := TCmdStrListItem(current.next); end; writeln(script, 'SAVE'); writeln(script, 'END'); @@ -710,7 +710,7 @@ Implementation Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename^)); { create AR commands } success := true; - current := TStringListItem(SmartLinkOFiles.First); + current := TCmdStrListItem(SmartLinkOFiles.First); repeat nextcmd := cmdstr; Replace(nextcmd,'$FILES',GetNextFiles(2047, current)); @@ -754,7 +754,7 @@ Implementation Constructor TInternalLinker.Create; begin inherited Create; - linkscript:=TStringList.Create; + linkscript:=TCmdStrList.Create; FStaticLibraryList:=TFPHashObjectList.Create(true); FImportLibraryList:=TFPHashObjectList.Create(true); exemap:=nil; @@ -838,10 +838,10 @@ Implementation s, para, keyword : string; - hp : TStringListItem; + hp : TCmdStrListItem; begin exeoutput.Load_Start; - hp:=tstringlistitem(linkscript.first); + hp:=TCmdStrListItem(linkscript.first); while assigned(hp) do begin s:=hp.str; @@ -861,7 +861,7 @@ Implementation Load_ReadObject(para) else if keyword='READSTATICLIBRARY' then Load_ReadStaticLibrary(para); - hp:=tstringlistitem(hp.next); + hp:=TCmdStrListItem(hp.next); end; end; @@ -871,10 +871,10 @@ Implementation s, para, keyword : string; - hp : TStringListItem; + hp : TCmdStrListItem; begin exeoutput.Order_Start; - hp:=tstringlistitem(linkscript.first); + hp:=TCmdStrListItem(linkscript.first); while assigned(hp) do begin s:=hp.str; @@ -892,7 +892,7 @@ Implementation ExeOutput.Order_Zeros(para) else if keyword='SYMBOL' then ExeOutput.Order_Symbol(para); - hp:=tstringlistitem(hp.next); + hp:=TCmdStrListItem(hp.next); end; exeoutput.Order_End; end; @@ -903,10 +903,10 @@ Implementation s, para, keyword : string; - hp : TStringListItem; + hp : TCmdStrListItem; begin exeoutput.CalcPos_Start; - hp:=tstringlistitem(linkscript.first); + hp:=TCmdStrListItem(linkscript.first); while assigned(hp) do begin s:=hp.str; @@ -922,24 +922,24 @@ Implementation ExeOutput.CalcPos_Header else if keyword='SYMBOLS' then ExeOutput.CalcPos_Symbols; - hp:=tstringlistitem(hp.next); + hp:=TCmdStrListItem(hp.next); end; end; procedure TInternalLinker.PrintLinkerScript; var - hp : TStringListItem; + hp : TCmdStrListItem; begin if not assigned(exemap) then exit; exemap.Add('Used linker script'); exemap.Add(''); - hp:=tstringlistitem(linkscript.first); + hp:=TCmdStrListItem(linkscript.first); while assigned(hp) do begin exemap.Add(hp.str); - hp:=tstringlistitem(hp.next); + hp:=TCmdStrListItem(hp.next); end; end; diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 725e056695..bad7d6be85 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -1382,7 +1382,7 @@ implementation objectdf : tobjectdef; parents : tlinkedlist; objectinfo : tobjectinfoitem; - stritem : tstringlistitem; + stritem : TCmdStrListItem; pd : tprocdef; i : integer; first : boolean; diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 0a1442f6a6..ce6c3ace1d 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -1896,17 +1896,17 @@ implementation function has_alias_name(pd:tprocdef;const s:string):boolean; var - item : tstringlistitem; + item : TCmdStrListItem; begin result:=true; if pd.mangledname=s then exit; - item := tstringlistitem(pd.aliasnames.first); + item := TCmdStrListItem(pd.aliasnames.first); while assigned(item) do begin if item.str=s then exit; - item := tstringlistitem(item.next); + item := TCmdStrListItem(item.next); end; result:=false; end; @@ -1914,22 +1914,22 @@ implementation procedure alloc_proc_symbol(pd: tprocdef); var - item : tstringlistitem; + item : TCmdStrListItem; begin - item := tstringlistitem(pd.aliasnames.first); + item := TCmdStrListItem(pd.aliasnames.first); while assigned(item) do begin current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION); - item := tstringlistitem(item.next); + item := TCmdStrListItem(item.next); end; end; procedure gen_proc_symbol(list:TAsmList); var - item : tstringlistitem; + item : TCmdStrListItem; begin - item := tstringlistitem(current_procinfo.procdef.aliasnames.first); + item := TCmdStrListItem(current_procinfo.procdef.aliasnames.first); while assigned(item) do begin if (cs_profile in current_settings.moduleswitches) or @@ -1939,7 +1939,7 @@ implementation list.concat(Tai_symbol.createname(item.str,AT_FUNCTION,0)); if tf_use_function_relative_addresses in target_info.flags then list.concat(Tai_function_name.create(item.str)); - item := tstringlistitem(item.next); + item := TCmdStrListItem(item.next); end; current_procinfo.procdef.procstarttai:=tai(list.last); diff --git a/compiler/options.pas b/compiler/options.pas index 33d9e443b8..423c535f53 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -49,7 +49,7 @@ Type procedure WriteHelpPages; procedure WriteQuickInfo; procedure IllegalPara(const opt:string); - function Unsetbool(var Opts:string; Pos: Longint):boolean; + function Unsetbool(var Opts:TCmdStr; Pos: Longint):boolean; procedure interpret_option(const opt :string;ispara:boolean); procedure Interpret_envvar(const envname : string); procedure Interpret_file(const filename : string); @@ -348,7 +348,7 @@ begin end; -function Toption.Unsetbool(var Opts:string; Pos: Longint):boolean; +function Toption.Unsetbool(var Opts:TCmdStr; Pos: Longint):boolean; { checks if the character after pos in Opts is a + or a - and returns resp. false or true. If it is another character (or none), it also returns false } begin @@ -367,11 +367,11 @@ procedure TOption.interpret_option(const opt:string;ispara:boolean); var code : integer; c : char; - more : string; + more : TCmdStr; major,minor : longint; error : integer; j,l : longint; - d,s : string; + d,s : TCmdStr; begin if opt='' then exit; @@ -2097,7 +2097,6 @@ begin if option.quickinfo<>'' then option.writequickinfo; end; - { Stop if errors in options } if ErrorCount>0 then StopOptions(1); @@ -2133,7 +2132,6 @@ begin { CPU Define } def_system_macro('CPU'+Cputypestr[init_settings.cputype]); - { Check file to compile } if param_file='' then begin diff --git a/compiler/parser.pas b/compiler/parser.pas index d23cfcb10a..2fedb4925e 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -106,7 +106,7 @@ implementation DefFile:=TDefFile.Create(outputexedir+ChangeFileExt(inputfilename,target_info.defext)); { list of generated .o files, so the linker can remove them } - SmartLinkOFiles:=TStringList.Create; + SmartLinkOFiles:=TCmdStrList.Create; { codegen } if paraprintnodetree<>0 then diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index fb31afa84e..d402ca4a0d 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -50,7 +50,7 @@ implementation var DLLScanner : TDLLScanner; s : string; - KeepShared : TStringList; + KeepShared : TCmdStrList; begin { try to create import entries from system dlls } if (tf_has_dllscanner in target_info.flags) and @@ -61,7 +61,7 @@ implementation DLLScanner:=CDLLScanner[target_info.system].Create else internalerror(200104121); - KeepShared:=TStringList.Create; + KeepShared:=TCmdStrList.Create; { Walk all shared libs } While not current_module.linkOtherSharedLibs.Empty do begin diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 0cbcf425c7..76651f98a9 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -1455,10 +1455,10 @@ In case not, the value returned can be arbitrary. procedure dir_include; - function findincludefile(const path,name:string;var foundfile:string):boolean; + function findincludefile(const path,name:TCmdStr;var foundfile:TCmdStr):boolean; var found : boolean; - hpath : string; + hpath : TCmdStr; begin (* look for the include file If path was specified as part of {$I } then @@ -1491,10 +1491,10 @@ In case not, the value returned can be arbitrary. end; var + foundfile : TCmdStr; path, name, args, - foundfile, hs : tpathstr; hp : tinputfile; found : boolean; diff --git a/compiler/script.pas b/compiler/script.pas index 8ed483d86a..c8746c2d61 100644 --- a/compiler/script.pas +++ b/compiler/script.pas @@ -24,14 +24,16 @@ unit script; {$i fpcdefs.inc} interface - +{$H+} uses + sysutils, + globtype, cclasses; type TScript=class fn : string[100]; - data : TStringList; + data : TCmdStrList; executable : boolean; constructor Create(const s:string); constructor CreateExec(const s:string); @@ -44,61 +46,61 @@ type TAsmScript = class (TScript) Constructor Create(Const ScriptName : String); virtual; - Procedure AddAsmCommand (Const Command, Options,FileName : String);virtual;abstract; - Procedure AddLinkCommand (Const Command, Options, FileName : String);virtual;abstract; - Procedure AddDeleteCommand (Const FileName : String);virtual;abstract; - Procedure AddDeleteDirCommand (Const FileName : String);virtual;abstract; + Procedure AddAsmCommand (Const Command, Options,FileName : TCmdStr);virtual;abstract; + Procedure AddLinkCommand (Const Command, Options, FileName : TCmdStr);virtual;abstract; + Procedure AddDeleteCommand (Const FileName : TCmdStr);virtual;abstract; + Procedure AddDeleteDirCommand (Const FileName : TCmdStr);virtual;abstract; end; TAsmScriptDos = class (TAsmScript) - Constructor Create (Const ScriptName : String); override; - Procedure AddAsmCommand (Const Command, Options,FileName : String);override; - Procedure AddLinkCommand (Const Command, Options, FileName : String);override; - Procedure AddDeleteCommand (Const FileName : String);override; - Procedure AddDeleteDirCommand (Const FileName : String);override; + Constructor Create (Const ScriptName : TCmdStr); override; + Procedure AddAsmCommand (Const Command, Options,FileName : TCmdStr);override; + Procedure AddLinkCommand (Const Command, Options, FileName : TCmdStr);override; + Procedure AddDeleteCommand (Const FileName : TCmdStr);override; + Procedure AddDeleteDirCommand (Const FileName : TCmdStr);override; Procedure WriteToDisk;override; end; TAsmScriptAmiga = class (TAsmScript) Constructor Create (Const ScriptName : String); override; - Procedure AddAsmCommand (Const Command, Options,FileName : String);override; - Procedure AddLinkCommand (Const Command, Options, FileName : String);override; - Procedure AddDeleteCommand (Const FileName : String);override; - Procedure AddDeleteDirCommand (Const FileName : String);override; + Procedure AddAsmCommand (Const Command, Options,FileName : TCmdStr);override; + Procedure AddLinkCommand (Const Command, Options, FileName : TCmdStr);override; + Procedure AddDeleteCommand (Const FileName : TCmdStr);override; + Procedure AddDeleteDirCommand (Const FileName : TCmdStr);override; Procedure WriteToDisk;override; end; TAsmScriptUnix = class (TAsmScript) Constructor Create (Const ScriptName : String);override; - Procedure AddAsmCommand (Const Command, Options,FileName : String);override; - Procedure AddLinkCommand (Const Command, Options, FileName : String);override; - Procedure AddDeleteCommand (Const FileName : String);override; - Procedure AddDeleteDirCommand (Const FileName : String);override; + Procedure AddAsmCommand (Const Command, Options,FileName : TCmdStr);override; + Procedure AddLinkCommand (Const Command, Options, FileName : TCmdStr);override; + Procedure AddDeleteCommand (Const FileName : TCmdStr);override; + Procedure AddDeleteDirCommand (Const FileName : TCmdStr);override; Procedure WriteToDisk;override; end; TAsmScriptMPW = class (TAsmScript) - Constructor Create (Const ScriptName : String); override; - Procedure AddAsmCommand (Const Command, Options,FileName : String);override; - Procedure AddLinkCommand (Const Command, Options, FileName : String);override; - Procedure AddDeleteCommand (Const FileName : String);override; - Procedure AddDeleteDirCommand (Const FileName : String);override; + Constructor Create (Const ScriptName : TCmdStr); override; + Procedure AddAsmCommand (Const Command, Options,FileName : TCmdStr);override; + Procedure AddLinkCommand (Const Command, Options, FileName : TCmdStr);override; + Procedure AddDeleteCommand (Const FileName : TCmdStr);override; + Procedure AddDeleteDirCommand (Const FileName : TCmdStr);override; Procedure WriteToDisk;override; end; TLinkRes = Class (TScript) section: string[30]; - procedure Add(const s:string); - procedure AddFileName(const s:string); - procedure EndSection(const s:string); - procedure StartSection(const s:string); + procedure Add(const s:ansistring); + procedure AddFileName(const s:ansistring); + procedure EndSection(const s:ansistring); + procedure StartSection(const s:ansistring); end; var AsmRes : TAsmScript; -Function ScriptFixFileName(const s:string):string; -Procedure GenerateAsmRes(const st : string); +Function ScriptFixFileName(const s:TCmdStr):TCmdStr; +Procedure GenerateAsmRes(const st : TCmdStr); implementation @@ -107,16 +109,15 @@ uses {$ifdef hasUnix} BaseUnix, {$endif} - SysUtils, cutils,cfileutils, - globtype,globals,systems,verbose; + globals,systems,verbose; {**************************************************************************** Helpers ****************************************************************************} - Function ScriptFixFileName(const s:string):string; + Function ScriptFixFileName(const s:TCmdStr):TCmdStr; begin if cs_link_on_target in current_settings.globalswitches then ScriptFixFileName:=TargetFixFileName(s) @@ -128,15 +129,15 @@ uses TScript ****************************************************************************} -constructor TScript.Create(const s:string); +constructor TScript.Create(const s: TCmdStr); begin fn:=FixFileName(s); executable:=false; - data:=TStringList.Create; + data:=TCmdStrList.Create; end; -constructor TScript.CreateExec(const s:string); +constructor TScript.CreateExec(const s:TCmdStr); begin fn:=FixFileName(s); if cs_link_on_target in current_settings.globalswitches then @@ -144,7 +145,7 @@ begin else fn:=ChangeFileExt(fn,source_info.scriptext); executable:=true; - data:=TStringList.Create; + data:=TCmdStrList.Create; end; @@ -154,13 +155,13 @@ begin end; -procedure TScript.AddStart(const s:string); +procedure TScript.AddStart(const s:TCmdStr); begin data.Insert(s); end; -procedure TScript.Add(const s:string); +procedure TScript.Add(const s:TCmdStr); begin data.Concat(s); end; @@ -175,7 +176,7 @@ procedure TScript.WriteToDisk; var t : file; i : longint; - s : string; + s : ansistring; le: string[2]; begin @@ -208,7 +209,7 @@ end; Asm Response ****************************************************************************} -Constructor TAsmScript.Create (Const ScriptName : String); +Constructor TAsmScript.Create (Const ScriptName : TCmdStr); begin Inherited CreateExec(ScriptName); end; @@ -218,13 +219,13 @@ end; DOS Asm Response ****************************************************************************} -Constructor TAsmScriptDos.Create (Const ScriptName : String); +Constructor TAsmScriptDos.Create (Const ScriptName : TCmdStr); begin Inherited Create(ScriptName); end; -Procedure TAsmScriptDos.AddAsmCommand (Const Command, Options,FileName : String); +Procedure TAsmScriptDos.AddAsmCommand (Const Command, Options,FileName : TCmdStr); begin if FileName<>'' then begin @@ -236,7 +237,7 @@ begin end; -Procedure TAsmScriptDos.AddLinkCommand (Const Command, Options, FileName : String); +Procedure TAsmScriptDos.AddLinkCommand (Const Command, Options, FileName : TCmdStr); begin if FileName<>'' then begin @@ -248,13 +249,13 @@ begin end; -Procedure TAsmScriptDos.AddDeleteCommand (Const FileName : String); +Procedure TAsmScriptDos.AddDeleteCommand (Const FileName : TCmdStr); begin Add('Del ' + MaybeQuoted (ScriptFixFileName (FileName))); end; -Procedure TAsmScriptDos.AddDeleteDirCommand (Const FileName : String); +Procedure TAsmScriptDos.AddDeleteDirCommand (Const FileName : TCmdStr); begin Add('Rmdir ' + MaybeQuoted (ScriptFixFileName (FileName))); end; @@ -282,21 +283,21 @@ end; {$IF DEFINED(MORPHOS) OR DEFINED(AMIGA)} { * PathConv is implemented in the system unit! * } -function PathConv(path: string): string; external name 'PATHCONV'; +function PathConv(path: TCmdStr): TCmdStr; external name 'PATHCONV'; {$ELSE} -function PathConv(path: string): string; +function PathConv(path: TCmdStr): TCmdStr; begin PathConv:=path; end; {$ENDIF} -Constructor TAsmScriptAmiga.Create (Const ScriptName : String); +Constructor TAsmScriptAmiga.Create (Const ScriptName : TCmdStr); begin Inherited Create(ScriptName); end; -Procedure TAsmScriptAmiga.AddAsmCommand (Const Command, Options,FileName : String); +Procedure TAsmScriptAmiga.AddAsmCommand (Const Command, Options,FileName : TCmdStr); begin if FileName<>'' then begin @@ -313,7 +314,7 @@ begin end; -Procedure TAsmScriptAmiga.AddLinkCommand (Const Command, Options, FileName : String); +Procedure TAsmScriptAmiga.AddLinkCommand (Const Command, Options, FileName : TCmdStr); begin if FileName<>'' then begin @@ -327,13 +328,13 @@ begin end; -Procedure TAsmScriptAmiga.AddDeleteCommand (Const FileName : String); +Procedure TAsmScriptAmiga.AddDeleteCommand (Const FileName : TCmdStr); begin Add('Delete ' + PathConv(MaybeQuoted(ScriptFixFileName(FileName))) + ' Quiet'); end; -Procedure TAsmScriptAmiga.AddDeleteDirCommand (Const FileName : String); +Procedure TAsmScriptAmiga.AddDeleteDirCommand (Const FileName : TCmdStr); begin Add('Delete ' + PathConv(MaybeQuoted(ScriptFixFileName(FileName))) + ' All Quiet'); end; @@ -358,13 +359,13 @@ end; Unix Asm Response ****************************************************************************} -Constructor TAsmScriptUnix.Create (Const ScriptName : String); +Constructor TAsmScriptUnix.Create (Const ScriptName : TCmdStr); begin Inherited Create(ScriptName); end; -Procedure TAsmScriptUnix.AddAsmCommand (Const Command, Options,FileName : String); +Procedure TAsmScriptUnix.AddAsmCommand (Const Command, Options,FileName : TCmdStr); begin if FileName<>'' then Add('echo Assembling '+ScriptFixFileName(FileName)); @@ -373,7 +374,7 @@ begin end; -Procedure TAsmScriptUnix.AddLinkCommand (Const Command, Options, FileName : String); +Procedure TAsmScriptUnix.AddLinkCommand (Const Command, Options, FileName : TCmdStr); begin if FileName<>'' then Add('echo Linking '+ScriptFixFileName(FileName)); @@ -382,13 +383,13 @@ begin end; -Procedure TAsmScriptUnix.AddDeleteCommand (Const FileName : String); +Procedure TAsmScriptUnix.AddDeleteCommand (Const FileName : TCmdStr); begin Add('rm ' + MaybeQuoted (ScriptFixFileName(FileName))); end; -Procedure TAsmScriptUnix.AddDeleteDirCommand (Const FileName : String); +Procedure TAsmScriptUnix.AddDeleteDirCommand (Const FileName : TCmdStr); begin Add('rmdir ' + MaybeQuoted (ScriptFixFileName(FileName))); end; @@ -413,13 +414,13 @@ end; MPW (MacOS) Asm Response ****************************************************************************} -Constructor TAsmScriptMPW.Create (Const ScriptName : String); +Constructor TAsmScriptMPW.Create (Const ScriptName : TCmdStr); begin Inherited Create(ScriptName); end; -Procedure TAsmScriptMPW.AddAsmCommand (Const Command, Options,FileName : String); +Procedure TAsmScriptMPW.AddAsmCommand (Const Command, Options,FileName : TCmdStr); begin if FileName<>'' then Add('Echo Assembling '+ScriptFixFileName(FileName)); @@ -428,7 +429,7 @@ begin end; -Procedure TAsmScriptMPW.AddLinkCommand (Const Command, Options, FileName : String); +Procedure TAsmScriptMPW.AddLinkCommand (Const Command, Options, FileName : TCmdStr); begin if FileName<>'' then Add('Echo Linking '+ScriptFixFileName(FileName)); @@ -444,13 +445,13 @@ begin end; -Procedure TAsmScriptMPW.AddDeleteCommand (Const FileName : String); +Procedure TAsmScriptMPW.AddDeleteCommand (Const FileName : TCmdStr); begin Add('Delete ' + MaybeQuoted (ScriptFixFileName(FileName))); end; -Procedure TAsmScriptMPW.AddDeleteDirCommand (Const FileName : String); +Procedure TAsmScriptMPW.AddDeleteDirCommand (Const FileName : TCmdStr); begin Add('Delete ' + MaybeQuoted (ScriptFixFileName (FileName))); end; @@ -465,7 +466,7 @@ end; -Procedure GenerateAsmRes(const st : string); +Procedure GenerateAsmRes(const st : TCmdStr); var scripttyp : tscripttype; begin @@ -490,13 +491,13 @@ end; Link Response ****************************************************************************} -procedure TLinkRes.Add(const s:string); +procedure TLinkRes.Add(const s:TCmdStr); begin if s<>'' then inherited Add(s); end; -procedure TLinkRes.AddFileName(const s:string); +procedure TLinkRes.AddFileName(const s:TCmdStr); begin if section<>'' then begin @@ -517,7 +518,7 @@ begin end; end; -procedure TLinkRes.EndSection(const s:string); +procedure TLinkRes.EndSection(const s:TCmdStr); begin { only terminate if we started the section } if section='' then @@ -525,7 +526,7 @@ begin section:=''; end; -procedure TLinkRes.StartSection(const s:string); +procedure TLinkRes.StartSection(const s:TCmdStr); begin section:=s; end; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 3e84a0076d..a183a0bd12 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -429,7 +429,7 @@ interface procsym : tsym; procsymderef : tderef; { alias names } - aliasnames : tstringlist; + aliasnames : TCmdStrList; { symtables } localst : TSymtable; funcretsym : tsym; @@ -2827,7 +2827,7 @@ implementation _mangledname:=nil; fileinfo:=current_filepos; extnumber:=$ffff; - aliasnames:=tstringlist.create; + aliasnames:=TCmdStrList.create; funcretsym:=nil; forwarddef:=true; interfacedef:=false; @@ -2906,7 +2906,7 @@ implementation (tf_need_export in target_info.flags) and (po_exports in procoptions) then deffile.AddExport(mangledname); - aliasnames:=tstringlist.create; + aliasnames:=TCmdStrList.create; forwarddef:=false; interfacedef:=false; hasforward:=false; diff --git a/compiler/systems/t_amiga.pas b/compiler/systems/t_amiga.pas index aa8476d62e..1b34263e67 100644 --- a/compiler/systems/t_amiga.pas +++ b/compiler/systems/t_amiga.pas @@ -96,7 +96,7 @@ function TLinkerAmiga.WriteResponseFile(isdll: boolean): boolean; var linkres : TLinkRes; i : longint; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; linklibc : boolean; begin @@ -106,22 +106,22 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin s:=HPath.Str; if (cs_link_on_target in current_settings.globalswitches) then s:=ScriptFixFileName(s); LinkRes.Add('-L'+s); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin s:=HPath.Str; if s<>'' then LinkRes.Add('SEARCH_DIR('+PathConv(maybequoted(s))+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; LinkRes.Add('INPUT ('); diff --git a/compiler/systems/t_beos.pas b/compiler/systems/t_beos.pas index e186ac8cc8..1866e0d1dd 100644 --- a/compiler/systems/t_beos.pas +++ b/compiler/systems/t_beos.pas @@ -213,8 +213,8 @@ Var i : integer; cprtobj, prtobj : string[80]; - HPath : TStringListItem; - s : string; + HPath : TCmdStrListItem; + s : TCmdStr; linklibc : boolean; begin WriteResponseFile:=False; @@ -250,17 +250,17 @@ begin LinkRes.Add('-m elf_i386_be -shared -Bsymbolic'); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin LinkRes.Add(maybequoted('-L'+HPath.Str)); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin LinkRes.Add(maybequoted('-L'+HPath.Str)); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { try to add crti and crtbegin if linking to C } diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas index 2ac1f59985..6caf3a80d2 100644 --- a/compiler/systems/t_bsd.pas +++ b/compiler/systems/t_bsd.pas @@ -283,8 +283,8 @@ Var cprtobj, gprtobj, prtobj : string[80]; - HPath : TStringListItem; - s,s1,s2 : string; + HPath : TCmdStrListItem; + s,s1,s2 : TCmdStr; linkdynamic, linklibc : boolean; Fl1,Fl2 : Boolean; @@ -372,23 +372,23 @@ begin end; end; { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin if LdSupportsNoResponseFile then LinkRes.Add(maybequoted('-L'+HPath.Str)) else LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin if LdSupportsNoResponseFile then LinkRes.Add(maybequoted('-L'+HPath.Str)) else LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; if not LdSupportsNoResponseFile then diff --git a/compiler/systems/t_embedded.pas b/compiler/systems/t_embedded.pas index ab0c9ce3b3..33a0c6606a 100644 --- a/compiler/systems/t_embedded.pas +++ b/compiler/systems/t_embedded.pas @@ -71,8 +71,8 @@ Function TlinkerEmbedded.WriteResponseFile: Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; - s,s1,s2 : string; + HPath : TCmdStrListItem; + s,s1,s2 : TCmdStr; prtobj, cprtobj : string[80]; linklibc : boolean; @@ -90,22 +90,22 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin s:=HPath.Str; if (cs_link_on_target in current_settings.globalswitches) then s:=ScriptFixFileName(s); LinkRes.Add('-L'+s); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin s:=HPath.Str; if s<>'' then LinkRes.Add('SEARCH_DIR('+(maybequoted(s))+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; LinkRes.Add('INPUT ('); diff --git a/compiler/systems/t_emx.pas b/compiler/systems/t_emx.pas index cd4e87dbcd..9114ec5692 100644 --- a/compiler/systems/t_emx.pas +++ b/compiler/systems/t_emx.pas @@ -389,7 +389,7 @@ Function TLinkerEMX.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; begin WriteResponseFile:=False; @@ -398,17 +398,17 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { add objectfiles, start with prt0 always } diff --git a/compiler/systems/t_gba.pas b/compiler/systems/t_gba.pas index 45d1aa0c07..a4d60595ea 100644 --- a/compiler/systems/t_gba.pas +++ b/compiler/systems/t_gba.pas @@ -71,8 +71,8 @@ Function TLinkerGba.WriteResponseFile: Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; - s,s1,s2 : string; + HPath : TCmdStrListItem; + s,s1,s2 : TCmdStr; prtobj, cprtobj : string[80]; linklibc : boolean; @@ -90,22 +90,22 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin s:=HPath.Str; if (cs_link_on_target in current_settings.globalswitches) then s:=ScriptFixFileName(s); LinkRes.Add('-L'+s); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin s:=HPath.Str; if s<>'' then LinkRes.Add('SEARCH_DIR('+(maybequoted(s))+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; LinkRes.Add('INPUT ('); diff --git a/compiler/systems/t_go32v2.pas b/compiler/systems/t_go32v2.pas index fab538c2b6..b8cfea633e 100644 --- a/compiler/systems/t_go32v2.pas +++ b/compiler/systems/t_go32v2.pas @@ -153,7 +153,7 @@ end; Function TExternalLinkerGo32v2.WriteScript(isdll:boolean) : Boolean; Var scriptres : TLinkRes; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; begin WriteScript:=False; @@ -211,17 +211,17 @@ begin ScriptRes.Add(' }'); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin ScriptRes.Add('SEARCH_DIR("'+GetShortName(HPath.Str)+'")'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin ScriptRes.Add('SEARCH_DIR("'+GetShortName(HPath.Str)+'")'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { Write and Close response } diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index be4d945cb5..768bff0e9f 100644 --- a/compiler/systems/t_linux.pas +++ b/compiler/systems/t_linux.pas @@ -386,8 +386,8 @@ Function TLinkerLinux.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; - s,s1,s2 : string; + HPath : TCmdStrListItem; + s,s1,s2 : TCmdStr; found1, found2 : boolean; begin @@ -405,17 +405,17 @@ begin with linkres do begin { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; StartSection('INPUT('); diff --git a/compiler/systems/t_morph.pas b/compiler/systems/t_morph.pas index 26079525f3..4f4ffc42dd 100644 --- a/compiler/systems/t_morph.pas +++ b/compiler/systems/t_morph.pas @@ -89,7 +89,7 @@ Function TLinkerMorphOS.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; linklibc : boolean; begin @@ -99,22 +99,22 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin s:=HPath.Str; if (cs_link_on_target in current_settings.globalswitches) then s:=ScriptFixFileName(s); LinkRes.Add('-L'+s); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin s:=HPath.Str; if s<>'' then LinkRes.Add('SEARCH_DIR('+PathConv(maybequoted(s))+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; LinkRes.Add('INPUT ('); diff --git a/compiler/systems/t_nds.pas b/compiler/systems/t_nds.pas index 01faa975d7..7e781c1de0 100644 --- a/compiler/systems/t_nds.pas +++ b/compiler/systems/t_nds.pas @@ -74,8 +74,8 @@ Function TLinkerNDS.WriteResponseFile: Boolean; Var
linkres : TLinkRes;
i : longint;
- HPath : TStringListItem;
- s,s1,s2 : string;
+ HPath : TCmdStrListItem;
+ s,s1,s2 : TCmdStr;
prtobj,
cprtobj : string[80];
linklibc,
@@ -107,22 +107,22 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
{ Write path to search libraries }
- HPath:=TStringListItem(current_module.locallibrarysearchpath.First);
+ HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
while assigned(HPath) do
begin
s:=HPath.Str;
if (cs_link_on_target in current_settings.globalswitches) then
s:=ScriptFixFileName(s);
LinkRes.Add('-L'+s);
- HPath:=TStringListItem(HPath.Next);
+ HPath:=TCmdStrListItem(HPath.Next);
end;
- HPath:=TStringListItem(LibrarySearchPath.First);
+ HPath:=TCmdStrListItem(LibrarySearchPath.First);
while assigned(HPath) do
begin
s:=HPath.Str;
if s<>'' then
LinkRes.Add('SEARCH_DIR('+(maybequoted(s))+')');
- HPath:=TStringListItem(HPath.Next);
+ HPath:=TCmdStrListItem(HPath.Next);
end;
LinkRes.Add('INPUT (');
diff --git a/compiler/systems/t_nwl.pas b/compiler/systems/t_nwl.pas index c17b8c1727..8eecfeeed0 100644 --- a/compiler/systems/t_nwl.pas +++ b/compiler/systems/t_nwl.pas @@ -273,7 +273,7 @@ Function TLinkerNetwlibc.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - s,s2,s3 : string; + s,s2,s3 : TCmdStr; ProgNam : string [80]; NlmNam : string [80]; hp2 : texported_item; { for exports } diff --git a/compiler/systems/t_nwm.pas b/compiler/systems/t_nwm.pas index 912ce9b839..f6130c1e62 100644 --- a/compiler/systems/t_nwm.pas +++ b/compiler/systems/t_nwm.pas @@ -265,7 +265,7 @@ Function TLinkerNetware.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - s,s2,s3 : string; + s,s2,s3 : TCmdStr; ProgNam : string [80]; NlmNam : string [80]; hp2 : texported_item; { for exports } diff --git a/compiler/systems/t_os2.pas b/compiler/systems/t_os2.pas index 377da7a7c2..848e9d6c64 100644 --- a/compiler/systems/t_os2.pas +++ b/compiler/systems/t_os2.pas @@ -388,7 +388,7 @@ Function TLinkeros2.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; begin WriteResponseFile:=False; @@ -397,17 +397,17 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { add objectfiles, start with prt0 always } diff --git a/compiler/systems/t_palmos.pas b/compiler/systems/t_palmos.pas index d83c9c49fe..ed0139c064 100644 --- a/compiler/systems/t_palmos.pas +++ b/compiler/systems/t_palmos.pas @@ -74,7 +74,7 @@ Function TLinkerPalmOS.WriteResponseFile : Boolean; Var linkres : TLinkRes; i : longint; - HPath : TStringListItem; + HPath : TCmdStrListItem; s : string; linklibc : boolean; begin @@ -84,17 +84,17 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin LinkRes.Add('-L'+HPath.Str); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { add objectfiles, start with crt0 always } diff --git a/compiler/systems/t_sunos.pas b/compiler/systems/t_sunos.pas index 32c4b81407..2740703ce2 100644 --- a/compiler/systems/t_sunos.pas +++ b/compiler/systems/t_sunos.pas @@ -235,8 +235,8 @@ Var cprtobj, gprtobj, prtobj : string[80]; - HPath : TStringListItem; - s,s2 : string; + HPath : TCmdStrListItem; + s,s2 : TCmdStr; linkdynamic, linklibc : boolean; begin @@ -268,17 +268,17 @@ begin LinkRes:=TLinkRes.Create(outputexedir+Info.ResName); { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; LinkRes.Add('INPUT('); diff --git a/compiler/systems/t_win.pas b/compiler/systems/t_win.pas index 50ac0709d6..053c782070 100644 --- a/compiler/systems/t_win.pas +++ b/compiler/systems/t_win.pas @@ -900,7 +900,7 @@ implementation procedure TInternalLinkerWin.DefaultLinkScript; var s,s2, - ibase : string; + ibase : TCmdStr; begin with LinkScript do begin @@ -1069,8 +1069,8 @@ implementation Function TExternalLinkerWin.WriteResponseFile(isdll:boolean) : Boolean; Var linkres : TLinkRes; - HPath : TStringListItem; - s,s2 : string; + HPath : TCmdStrListItem; + s,s2 : TCmdStr; i : integer; begin WriteResponseFile:=False; @@ -1088,17 +1088,17 @@ implementation with linkres do begin { Write path to search libraries } - HPath:=TStringListItem(current_module.locallibrarysearchpath.First); + HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); while assigned(HPath) do begin Add('SEARCH_DIR('+MaybeQuoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; - HPath:=TStringListItem(LibrarySearchPath.First); + HPath:=TCmdStrListItem(LibrarySearchPath.First); while assigned(HPath) do begin Add('SEARCH_DIR('+MaybeQuoted(HPath.Str)+')'); - HPath:=TStringListItem(HPath.Next); + HPath:=TCmdStrListItem(HPath.Next); end; { add objectfiles, start with prt0 always } @@ -1686,7 +1686,7 @@ implementation function TDLLScannerWin.scan(const binname:string):boolean; var hs, - dllname : string; + dllname : TCmdStr; begin result:=false; { is there already an import library the we will use that one } diff --git a/compiler/verbose.pas b/compiler/verbose.pas index bdaf5de028..eb0af127d3 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -85,7 +85,7 @@ interface procedure SetErrorFlags(const s:string); procedure GenerateError; procedure Internalerror(i:longint); - procedure Comment(l:longint;s:string); + procedure Comment(l:longint;s:ansistring); function MessagePchar(w:longint):pchar; procedure Message(w:longint;onqueue:tmsgqueueevent=nil); procedure Message1(w:longint;const s1:string;onqueue:tmsgqueueevent=nil); @@ -475,7 +475,7 @@ var end; - procedure Comment(l:longint;s:string); + procedure Comment(l:longint;s:ansistring); var dostop : boolean; begin @@ -506,7 +506,7 @@ var end; - Procedure Msg2Comment(s:string;w:longint;onqueue:tmsgqueueevent); + Procedure Msg2Comment(s:ansistring;w:longint;onqueue:tmsgqueueevent); var idx,i,v : longint; dostop : boolean; diff --git a/ide/fpvars.pas b/ide/fpvars.pas index bda2a771b9..790707308a 100644 --- a/ide/fpvars.pas +++ b/ide/fpvars.pas @@ -70,7 +70,7 @@ const ClipboardWindow : PClipboardWindow = nil; UseMouse : boolean = true; MainFile : string = ''; PrevMainFile : string = ''; - EXEFile : string = ''; + EXEFile : ansistring = ''; CompilationPhase : TCompPhase = cpNothing; {$ifndef NODEBUG} GDBWindow : PGDBWindow = nil; |