소스 검색

* replaced most (if not all) remaining fields/parameters in the compiler
that deal with paths/filenames with TPathStr (= ansistring) to prevent
cutting off long paths (no change in speed when compiling the compiler,
1% extra memory usage)

git-svn-id: trunk@21120 -

Jonas Maebe 13 년 전
부모
커밋
14cfe770a4
46개의 변경된 파일341개의 추가작업 그리고 398개의 파일을 삭제
  1. 4 4
      compiler/aggas.pas
  2. 3 3
      compiler/agjasmin.pas
  3. 9 9
      compiler/assemble.pas
  4. 11 18
      compiler/browcol.pas
  5. 6 6
      compiler/comphook.pas
  6. 8 8
      compiler/comprsrc.pas
  7. 1 1
      compiler/cresstr.pas
  8. 9 9
      compiler/dbgdwarf.pas
  9. 4 4
      compiler/dbgstabs.pas
  10. 3 3
      compiler/dbgstabx.pas
  11. 60 87
      compiler/finput.pas
  12. 21 41
      compiler/fmodule.pas
  13. 35 38
      compiler/fppu.pas
  14. 18 18
      compiler/link.pas
  15. 1 1
      compiler/ogcoff.pas
  16. 1 1
      compiler/ogelf.pas
  17. 1 1
      compiler/ognlm.pas
  18. 1 1
      compiler/optdead.pas
  19. 14 14
      compiler/pmodules.pas
  20. 2 2
      compiler/scandir.pas
  21. 9 9
      compiler/scanner.pas
  22. 5 5
      compiler/systems/t_aix.pas
  23. 3 3
      compiler/systems/t_amiga.pas
  24. 6 6
      compiler/systems/t_beos.pas
  25. 9 9
      compiler/systems/t_bsd.pas
  26. 6 6
      compiler/systems/t_embed.pas
  27. 4 4
      compiler/systems/t_emx.pas
  28. 6 6
      compiler/systems/t_gba.pas
  29. 2 2
      compiler/systems/t_go32v2.pas
  30. 6 6
      compiler/systems/t_haiku.pas
  31. 10 10
      compiler/systems/t_linux.pas
  32. 7 7
      compiler/systems/t_macos.pas
  33. 4 4
      compiler/systems/t_morph.pas
  34. 7 7
      compiler/systems/t_nds.pas
  35. 4 4
      compiler/systems/t_nwl.pas
  36. 3 3
      compiler/systems/t_nwm.pas
  37. 5 5
      compiler/systems/t_os2.pas
  38. 2 2
      compiler/systems/t_palmos.pas
  39. 5 5
      compiler/systems/t_sunos.pas
  40. 2 2
      compiler/systems/t_watcom.pas
  41. 1 1
      compiler/systems/t_wdosx.pas
  42. 5 5
      compiler/systems/t_wii.pas
  43. 10 10
      compiler/systems/t_win.pas
  44. 2 2
      compiler/x86/agx86int.pas
  45. 2 2
      compiler/x86/agx86nsm.pas
  46. 4 4
      ide/fpcompil.pas

+ 4 - 4
compiler/aggas.pas

@@ -1530,11 +1530,11 @@ implementation
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       Comment(V_Debug,'Start writing gas-styled assembler output for '+current_module.mainsource^);
+       Comment(V_Debug,'Start writing gas-styled assembler output for '+current_module.mainsource);
 {$endif}
 
-      if assigned(current_module.mainsource) then
-        n:=ExtractFileName(current_module.mainsource^)
+      if current_module.mainsource<>'' then
+        n:=ExtractFileName(current_module.mainsource)
       else
         n:=InputFileName;
 
@@ -1574,7 +1574,7 @@ implementation
       AsmLn;
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       Comment(V_Debug,'Done writing gas-styled assembler output for '+current_module.mainsource^);
+       Comment(V_Debug,'Done writing gas-styled assembler output for '+current_module.mainsource);
 {$endif EXTDEBUG}
     end;
 

+ 3 - 3
compiler/agjasmin.pas

@@ -531,7 +531,7 @@ implementation
         // include files are not support by Java, and the directory of the main
         // source file must not be specified
         if assigned(current_module.mainsource) then
-          n:=ExtractFileName(current_module.mainsource^)
+          n:=ExtractFileName(current_module.mainsource)
         else
           n:=InputFileName;
         AsmWriteLn('.source '+ExtractFileName(n));
@@ -1066,7 +1066,7 @@ implementation
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       Comment(V_Debug,'Start writing Jasmin-styled assembler output for '+current_module.mainsource^);
+       Comment(V_Debug,'Start writing Jasmin-styled assembler output for '+current_module.mainsource);
 {$endif}
 
       AsmStartSize:=AsmSize;
@@ -1093,7 +1093,7 @@ implementation
       AsmLn;
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       Comment(V_Debug,'Done writing gas-styled assembler output for '+current_module.mainsource^);
+       Comment(V_Debug,'Done writing gas-styled assembler output for '+current_module.mainsource);
 {$endif EXTDEBUG}
     end;
 

+ 9 - 9
compiler/assemble.pas

@@ -45,11 +45,11 @@ interface
       TAssembler=class(TAbstractAssembler)
       public
       {filenames}
-        path        : string;
+        path        : TPathStr;
         name        : string;
         AsmFileName,         { current .s and .o file }
         ObjFileName,
-        ppufilename  : string;
+        ppufilename  : TPathStr;
         asmprefix    : string;
         SmartAsm     : boolean;
         SmartFilesCount,
@@ -221,15 +221,15 @@ Implementation
     Constructor TAssembler.Create(smart:boolean);
       begin
       { load start values }
-        AsmFileName:=current_module.AsmFilename^;
-        ObjFileName:=current_module.ObjFileName^;
+        AsmFileName:=current_module.AsmFilename;
+        ObjFileName:=current_module.ObjFileName;
         name:=Lower(current_module.modulename^);
-        path:=current_module.outputpath^;
+        path:=current_module.outputpath;
         asmprefix := current_module.asmprefix^;
-        if not assigned(current_module.outputpath) then
+        if current_module.outputpath = '' then
           ppufilename := ''
         else
-          ppufilename := current_module.ppufilename^;
+          ppufilename := current_module.ppufilename;
         SmartAsm:=smart;
         SmartFilesCount:=0;
         SmartHeaderCount:=0;
@@ -699,7 +699,7 @@ Implementation
           begin
             if (infile<>lastinfile) then
               begin
-                AsmWriteLn(target_asm.comment+'['+infile.name^+']');
+                AsmWriteLn(target_asm.comment+'['+infile.name+']');
                 if assigned(lastinfile) then
                   lastinfile.close;
               end;
@@ -1555,7 +1555,7 @@ Implementation
         ObjWriter : TObjectWriter;
       begin
         if not(cs_asm_leave in current_settings.globalswitches) then
-          ObjWriter:=TARObjectWriter.create(current_module.staticlibfilename^)
+          ObjWriter:=TARObjectWriter.create(current_module.staticlibfilename)
         else
           ObjWriter:=TObjectwriter.create;
 

+ 11 - 18
compiler/browcol.pas

@@ -1699,9 +1699,9 @@ end;
           begin
             DefPos:=tstoredsym(sym).FileInfo;
             inputfile:=get_source_file(defpos.moduleindex,defpos.fileindex);
-            if Assigned(inputfile) and Assigned(inputfile.name) then
+            if Assigned(inputfile) and (inputfile.name<>'') then
               begin
-                New(Reference, Init(ModuleNames^.Add(inputfile.name^),
+                New(Reference, Init(ModuleNames^.Add(inputfile.name),
                   DefPos.line,DefPos.column));
                 Symbol^.References^.Insert(Reference);
               end;
@@ -1712,9 +1712,9 @@ end;
             while assigned(Ref) do
               begin
                 inputfile:=get_source_file(ref.refinfo.moduleindex,ref.refinfo.fileindex);
-                if Assigned(inputfile) and Assigned(inputfile.name) then
+                if Assigned(inputfile) and (inputfile.name<>'') then
                   begin
-                    New(Reference, Init(ModuleNames^.Add(inputfile.name^),
+                    New(Reference, Init(ModuleNames^.Add(inputfile.name),
                       ref.refinfo.line,ref.refinfo.column));
                     Symbol^.References^.Insert(Reference);
                   end;
@@ -1773,7 +1773,7 @@ begin
        if assigned(t) then
          begin
            name:=GetStr(T.Name);
-           msource:=GetStr(hp.mainsource);
+           msource:=hp.mainsource;
            New(UnitS, Init(Name,msource));
            if Assigned(hp.loaded_from) then
              if assigned(hp.loaded_from.globalsymtable) then
@@ -1785,8 +1785,8 @@ begin
              pif:=hp.sourcefiles.files;
              while (pif<>nil) do
              begin
-               path:=GetStr(pif.path);
-               name:=GetStr(pif.name);
+               path:=pif.path;
+               name:=pif.name;
                UnitS^.AddSourceFile(path+name);
                pif:=pif.next;
              end;
@@ -1994,7 +1994,6 @@ end;
 procedure BuildSourceList;
 var m: tmodule;
     s: tinputfile;
-    p: pstring;
     ppu,obj: string;
     source: string;
 begin
@@ -2009,24 +2008,18 @@ begin
     m:=tmodule(loaded_units.first);
     while assigned(m) do
     begin
-      obj:=ExpandFileName(m.objfilename^);
+      obj:=ExpandFileName(m.objfilename);
       ppu:=''; source:='';
       if m.is_unit then
-        ppu:=ExpandFileName(m.ppufilename^);
+        ppu:=ExpandFileName(m.ppufilename);
       if (m.is_unit=false) and (m.islibrary=false) then
-        ppu:=ExpandFileName(m.exefilename^);
+        ppu:=ExpandFileName(m.exefilename);
       if assigned(m.sourcefiles) then
         begin
           s:=m.sourcefiles.files;
           while assigned(s) do
           begin
-            source:='';
-            p:=s.path;
-            if assigned(p) then
-              source:=source+p^;
-            p:=s.name;
-            if assigned(p) then
-              source:=source+p^;
+            source:=s.path+s.name;
             source:=ExpandFileName(source);
 
             sourcefiles^.Insert(New(PSourceFile, Init(source,obj,ppu)));

+ 6 - 6
compiler/comphook.pas

@@ -130,8 +130,8 @@ function  def_CheckVerbosity(v:longint):boolean;
 procedure def_initsymbolinfo;
 procedure def_donesymbolinfo;
 procedure def_extractsymbolinfo;
-function  def_openinputfile(const filename: string): tinputfile;
-Function  def_getnamedfiletime(Const F : String) : Longint;
+function  def_openinputfile(const filename: TPathStr): tinputfile;
+Function  def_getnamedfiletime(Const F : TPathStr) : Longint;
 { Function redirecting for IDE support }
 type
   tstopprocedure         = procedure(err:longint);
@@ -143,8 +143,8 @@ type
   tinitsymbolinfoproc = procedure;
   tdonesymbolinfoproc = procedure;
   textractsymbolinfoproc = procedure;
-  topeninputfilefunc = function(const filename: string): tinputfile;
-  tgetnamedfiletimefunc = function(const filename: string): longint;
+  topeninputfilefunc = function(const filename: TPathStr): tinputfile;
+  tgetnamedfiletimefunc = function(const filename: TPathStr): longint;
 
 const
   do_status        : tstatusfunction  = @def_status;
@@ -394,13 +394,13 @@ procedure def_extractsymbolinfo;
 begin
 end;
 
-function  def_openinputfile(const filename: string): tinputfile;
+function  def_openinputfile(const filename: TPathStr): tinputfile;
 begin
   def_openinputfile:=tdosinputfile.create(filename);
 end;
 
 
-Function def_GetNamedFileTime (Const F : String) : Longint;
+Function def_GetNamedFileTime (Const F : TPathStr) : Longint;
 begin
   Result:=FileAge(F);
 end;

+ 8 - 8
compiler/comprsrc.pas

@@ -262,7 +262,7 @@ var
   end;
 
 begin
-  srcfilepath:=ExtractFilePath(current_module.mainsource^);
+  srcfilepath:=ExtractFilePath(current_module.mainsource);
   if output=roRES then
     begin
       s:=target_res.rccmd;
@@ -424,7 +424,7 @@ begin
       Include(current_settings.globalswitches, cs_link_nolink);
       exit;
     end;
-  dst:=CFileStreamClass.Create(current_module.outputpath^+outf,fmCreate);
+  dst:=CFileStreamClass.Create(current_module.outputpath+outf,fmCreate);
   if CStreamError<>0 then
     begin
       Message1(exec_e_cant_write_resource_file, dst.FileName);
@@ -450,7 +450,7 @@ begin
      (res_no_compile in target_res.resflags) then
     exit;
 
-  p:=ExtractFilePath(ExpandFileName(current_module.mainsource^));
+  p:=ExtractFilePath(ExpandFileName(current_module.mainsource));
   res:=TCmdStrListItem(current_module.ResourceFiles.First);
   while res<>nil do
     begin
@@ -469,7 +469,7 @@ begin
       if resourcefile.IsCompiled(s) then
         begin
           resourcefile.free;
-          if AnsiCompareFileName(IncludeTrailingPathDelimiter(ExpandFileName(current_module.outputpath^)), p) <> 0 then
+          if AnsiCompareFileName(IncludeTrailingPathDelimiter(ExpandFileName(current_module.outputpath)), p) <> 0 then
             begin
               { Copy .res file to units output dir. Otherwise .res file will not be found
                 when only compiled units path is available }
@@ -491,7 +491,7 @@ begin
               outfmt:=roRES;
               res.FPStr:=ChangeFileExt(res.FPStr,target_info.resext);
             end;
-          resourcefile.compile(outfmt, current_module.outputpath^+res.FPStr);
+          resourcefile.compile(outfmt, current_module.outputpath+res.FPStr);
           resourcefile.free;
         end;
       res:=TCmdStrListItem(res.Next);
@@ -515,9 +515,9 @@ var
           s:=res.FPStr
         else
           begin
-            s:=u.path^+res.FPStr;
+            s:=u.path+res.FPStr;
             if not FileExists(s,True) then
-              s:=u.outputpath^+res.FPStr;
+              s:=u.outputpath+res.FPStr;
           end;
         resourcefile.Collect(s);
         res:=TCmdStrListItem(res.Next);
@@ -533,7 +533,7 @@ begin
       exit;
 //  if cs_link_nolink in current_settings.globalswitches then
 //    exit;
-  s:=ChangeFileExt(current_module.ppufilename^,target_info.resobjext);
+  s:=ChangeFileExt(current_module.ppufilename,target_info.resobjext);
   if (res_arch_in_file_name in target_res.resflags) then
     s:=ChangeFileExt(s,'.'+cpu2str[target_cpu]+target_info.resobjext);
   resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(s));

+ 1 - 1
compiler/cresstr.pas

@@ -230,7 +230,7 @@ uses
         end;
 
       begin
-        ResFileName:=ChangeFileExt(current_module.ppufilename^,'.rst');
+        ResFileName:=ChangeFileExt(current_module.ppufilename,'.rst');
         message1 (general_i_writingresourcefile,ExtractFileName(ResFileName));
         Assign(F,ResFileName);
         {$push}{$i-}

+ 9 - 9
compiler/dbgdwarf.pas

@@ -1040,13 +1040,13 @@ implementation
         diridx: Integer;
         fileitem: TFileIndexItem;
       begin
-        if afile.path^ = '' then
+        if afile.path = '' then
           dirname := '.'
         else
           begin
             { add the canonical form here already to avoid problems with }
             { paths such as './' etc                                     }
-            dirname := relative_dwarf_path(afile.path^);
+            dirname := relative_dwarf_path(afile.path);
             if dirname = '' then
               dirname := '.';
           end;
@@ -1055,11 +1055,11 @@ implementation
           diritem := TDirIndexItem.Create(dirlist,dirname, dirlist.Count);
         diridx := diritem.IndexNr;
 
-        fileitem := TFileIndexItem(diritem.files.Find(afile.name^));
+        fileitem := TFileIndexItem(diritem.files.Find(afile.name));
         if fileitem = nil then
           begin
             Inc(filesequence);
-            fileitem := TFileIndexItem.Create(diritem.files,afile.name^, diridx, filesequence);
+            fileitem := TFileIndexItem.Create(diritem.files,afile.name, diridx, filesequence);
           end;
         Result := fileitem.IndexNr;
       end;
@@ -3090,7 +3090,7 @@ implementation
 
         { first manadatory compilation unit TAG }
         append_entry(DW_TAG_compile_unit,true,[
-          DW_AT_name,DW_FORM_string,relative_dwarf_path(current_module.sourcefiles.get_file(1).path^+current_module.sourcefiles.get_file(1).name^)+#0,
+          DW_AT_name,DW_FORM_string,relative_dwarf_path(current_module.sourcefiles.get_file(1).path+current_module.sourcefiles.get_file(1).name)+#0,
           DW_AT_producer,DW_FORM_string,'Free Pascal '+full_version_string+' '+date_string+#0,
           DW_AT_comp_dir,DW_FORM_string,BSToSlash(FixPath(GetCurrentDir,false))+#0,
           DW_AT_language,DW_FORM_data1,DW_LANG_Pascal83,
@@ -3308,13 +3308,13 @@ implementation
                         currfileidx := get_file_index(infile);
                         if prevfileidx <> currfileidx then
                           begin
-                            list.insertbefore(tai_comment.Create(strpnew('path: '+infile.path^)), hp);
-                            list.insertbefore(tai_comment.Create(strpnew('file: '+infile.name^)), hp);
+                            list.insertbefore(tai_comment.Create(strpnew('path: '+infile.path)), hp);
+                            list.insertbefore(tai_comment.Create(strpnew('file: '+infile.name)), hp);
                             list.insertbefore(tai_comment.Create(strpnew('indx: '+tostr(currfileidx))), hp);
 
                             { set file }
-                            asmline.concat(tai_comment.Create(strpnew('path: '+infile.path^)));
-                            asmline.concat(tai_comment.Create(strpnew('file: '+infile.name^)));
+                            asmline.concat(tai_comment.Create(strpnew('path: '+infile.path)));
+                            asmline.concat(tai_comment.Create(strpnew('file: '+infile.name)));
                             asmline.concat(tai_const.create_8bit(DW_LNS_set_file));
                             asmline.concat(tai_const.create_uleb128bit(currfileidx));
 

+ 4 - 4
compiler/dbgstabs.pas

@@ -1714,11 +1714,11 @@ implementation
                         current_asmdata.getlabel(hlabel,alt_dbgfile);
                         { emit stabs }
                         if not(ds_stabs_abs_include_files in current_settings.debugswitches) or
-                           path_absolute(infile.path^) then
-                          list.insertbefore(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(infile.path^,false))+FixFileName(infile.name^)+'",'+tostr(stabs_n_includefile)+
+                           path_absolute(infile.path) then
+                          list.insertbefore(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(infile.path,false))+FixFileName(infile.name)+'",'+tostr(stabs_n_includefile)+
                                             ',0,0,'+hlabel.name),hp)
                         else
-                          list.insertbefore(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false)+FixPath(infile.path^,false))+FixFileName(infile.name^)+'",'+tostr(stabs_n_includefile)+
+                          list.insertbefore(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false)+FixPath(infile.path,false))+FixFileName(infile.name)+'",'+tostr(stabs_n_includefile)+
                                             ',0,0,'+hlabel.name),hp);
                         list.insertbefore(tai_label.create(hlabel),hp);
                         { force new line info }
@@ -1761,7 +1761,7 @@ implementation
           current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(make_mangledname('DEBUGSTART',current_module.localsymtable,''),AT_DATA,0));
         current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false))+'",'+
           base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));
-        current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(infile.path^,false))+FixFileName(infile.name^)+'",'+
+        current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(infile.path,false))+FixFileName(infile.name)+'",'+
           base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));
         current_asmdata.asmlists[al_start].concat(tai_label.create(hlabel));
         { for darwin, you need a "module marker" too to work around      }

+ 3 - 3
compiler/dbgstabx.pas

@@ -357,7 +357,7 @@ implementation
                   if curincludefileinfo.fileindex<>0 then
                     begin
                       infile:=get_module(curincludefileinfo.moduleindex).sourcefiles.get_file(curincludefileinfo.fileindex);
-                      list.insertbefore(Tai_stab.Create_str(stabx_ei,'"'+FixFileName(infile.name^)+'"'),inclinsertpos);
+                      list.insertbefore(Tai_stab.Create_str(stabx_ei,'"'+FixFileName(infile.name)+'"'),inclinsertpos);
                       curincludefileinfo.fileindex:=0;
                     end;
                   if currfileinfo.fileindex<>1 then
@@ -365,7 +365,7 @@ implementation
                       infile:=get_module(currfileinfo.moduleindex).sourcefiles.get_file(currfileinfo.fileindex);
                       if assigned(infile) then
                         begin
-                          list.insertbefore(Tai_stab.Create_str(stabx_bi,'"'+FixFileName(infile.name^)+'"'),inclinsertpos);
+                          list.insertbefore(Tai_stab.Create_str(stabx_bi,'"'+FixFileName(infile.name)+'"'),inclinsertpos);
                           curincludefileinfo:=currfileinfo;
                           { force new line info }
                           lastfileinfo.line:=-1;
@@ -421,7 +421,7 @@ implementation
       if curincludefileinfo.fileindex<>0 then
         begin
           infile:=get_module(curincludefileinfo.moduleindex).sourcefiles.get_file(curincludefileinfo.fileindex);
-          list.insertbefore(Tai_stab.Create_str(stabx_ei,'"'+FixFileName(infile.name^)+'"'),last);
+          list.insertbefore(Tai_stab.Create_str(stabx_ei,'"'+FixFileName(infile.name)+'"'),last);
           curincludefileinfo.fileindex:=0;
         end;
     end;

+ 60 - 87
compiler/finput.pas

@@ -26,7 +26,7 @@ unit finput;
 interface
 
     uses
-      cutils,cclasses,cstreams;
+      cutils,globtype,cclasses,cstreams;
 
     const
        InputFileBufSize=32*1024+1;
@@ -37,7 +37,7 @@ interface
        plongintarr = ^tlongintarr;
 
        tinputfile = class
-         path,name : pshortstring;       { path and filename }
+         path,name : TPathStr;       { path and filename }
          next      : tinputfile;    { next file for reading }
 
          is_macro,
@@ -59,7 +59,7 @@ interface
          ref_index  : longint;
          ref_next   : tinputfile;
 
-         constructor create(const fn:string);
+         constructor create(const fn:TPathStr);
          destructor  destroy;override;
          procedure setpos(l:longint);
          procedure seekbuf(fpos:longint);
@@ -74,7 +74,7 @@ interface
          function  getfiletime:longint;
        protected
          filetime  : longint;
-         function fileopen(const filename: string): boolean; virtual; abstract;
+         function fileopen(const filename: TPathStr): boolean; virtual; abstract;
          function fileseek(pos: longint): boolean; virtual; abstract;
          function fileread(var databuf; maxsize: longint): longint; virtual; abstract;
          function fileeof: boolean; virtual; abstract;
@@ -84,7 +84,7 @@ interface
 
        tdosinputfile = class(tinputfile)
        protected
-         function fileopen(const filename: string): boolean; override;
+         function fileopen(const filename: TPathStr): boolean; override;
          function fileseek(pos: longint): boolean; override;
          function fileread(var databuf; maxsize: longint): longint; override;
          function fileeof: boolean; override;
@@ -103,8 +103,8 @@ interface
           destructor destroy;override;
           procedure register_file(f : tinputfile);
           function  get_file(l:longint) : tinputfile;
-          function  get_file_name(l :longint):string;
-          function  get_file_path(l :longint):string;
+          function  get_file_name(l :longint):TPathStr;
+          function  get_file_path(l :longint):TPathStr;
        end;
 
 {****************************************************************************
@@ -137,11 +137,10 @@ interface
           sourcefiles      : tinputfilemanager;
           { paths and filenames }
           paramallowoutput : boolean;  { original allowoutput parameter }
-          paramfn,                  { original filename }
-          path,                     { path where the module is find/created }
-          outputpath,               { path where the .s / .o / exe are created }
           modulename,               { name of the module in uppercase }
-          realmodulename,           { name of the module in the orignal case }
+          realmodulename: pshortstring; { name of the module in the orignal case }
+          paramfn,                  { original filename }
+          mainsource,               { name of the main sourcefile }
           objfilename,              { fullname of the objectfile }
           asmfilename,              { fullname of the assemblerfile }
           ppufilename,              { fullname of the ppufile }
@@ -151,21 +150,22 @@ interface
           mapfilename,              { fullname of the mapfile }
           exefilename,              { fullname of the exefile }
           dbgfilename,              { fullname of the debug info file }
-          mainsource   : pshortstring;   { name of the main sourcefile }
+          path,                     { path where the module is find/created }
+          outputpath   : TPathStr;  { path where the .s / .o / exe are created }
           constructor create(const s:string);
           destructor destroy;override;
-          procedure setfilename(const fn:string;allowoutput:boolean);
+          procedure setfilename(const fn:TPathStr;allowoutput:boolean);
        end;
 
 
-     Function GetNamedFileTime (Const F : String) : Longint;
+     Function GetNamedFileTime (Const F : TPathStr) : Longint;
 
 
 implementation
 
 uses
   SysUtils,
-  GlobType,Comphook,
+  Comphook,
 {$ifdef heaptrc}
   fmodule,
   ppheap,
@@ -179,7 +179,7 @@ uses
                                   Utils
  ****************************************************************************}
 
-   Function GetNamedFileTime (Const F : String) : Longint;
+   Function GetNamedFileTime (Const F : TPathStr) : Longint;
      begin
        GetNamedFileTime:=do_getnamedfiletime(F);
      end;
@@ -189,10 +189,10 @@ uses
                                   TINPUTFILE
  ****************************************************************************}
 
-    constructor tinputfile.create(const fn:string);
+    constructor tinputfile.create(const fn:TPathStr);
       begin
-        name:=stringdup(ExtractFileName(fn));
-        path:=stringdup(ExtractFilePath(fn));
+        name:=ExtractFileName(fn);
+        path:=ExtractFilePath(fn);
         next:=nil;
         filetime:=-1;
       { file info }
@@ -220,8 +220,6 @@ uses
       begin
         if not closed then
          close;
-        stringdispose(path);
-        stringdispose(name);
       { free memory }
         if assigned(linebuf) then
          freemem(linebuf,maxlinebuf shl 2);
@@ -262,7 +260,7 @@ uses
         open:=false;
         if not closed then
          Close;
-        if not fileopen(path^+name^) then
+        if not fileopen(path+name) then
          exit;
       { file }
         endoffile:=false;
@@ -284,8 +282,8 @@ uses
               Freemem(buf,maxbufsize);
               buf:=nil;
             end;
-           stringdispose(name);
-           stringdispose(path);
+           name:='';
+           path:='';
            closed:=true;
            exit;
          end;
@@ -336,7 +334,7 @@ uses
          end;
         if not closed then
          exit;
-        if not fileopen(path^+name^) then
+        if not fileopen(path+name) then
          exit;
         closed:=false;
       { get new mem }
@@ -447,7 +445,7 @@ uses
                                 TDOSINPUTFILE
  ****************************************************************************}
 
-    function tdosinputfile.fileopen(const filename: string): boolean;
+    function tdosinputfile.fileopen(const filename: TPathStr): boolean;
       begin
         { Check if file exists, this will also check if it is
           a real file and not a directory }
@@ -502,7 +500,7 @@ uses
 
     procedure tdosinputfile.filegettime;
       begin
-        filetime:=getnamedfiletime(path^+name^);
+        filetime:=getnamedfiletime(path+name);
       end;
 
 
@@ -574,25 +572,25 @@ uses
      end;
 
 
-   function tinputfilemanager.get_file_name(l :longint):string;
+   function tinputfilemanager.get_file_name(l :longint):TPathStr;
      var
        hp : tinputfile;
      begin
        hp:=get_file(l);
        if assigned(hp) then
-        get_file_name:=hp.name^
+        get_file_name:=hp.name
        else
         get_file_name:='';
      end;
 
 
-   function tinputfilemanager.get_file_path(l :longint):string;
+   function tinputfilemanager.get_file_path(l :longint):TPathStr;
      var
        hp : tinputfile;
      begin
        hp:=get_file(l);
        if assigned(hp) then
-        get_file_path:=hp.path^
+        get_file_path:=hp.path
        else
         get_file_path:='';
      end;
@@ -602,31 +600,19 @@ uses
                                 TModuleBase
  ****************************************************************************}
 
-    procedure tmodulebase.setfilename(const fn:string;allowoutput:boolean);
+    procedure tmodulebase.setfilename(const fn:TPathStr;allowoutput:boolean);
       var
-        p,n,
+        p, n,
         prefix,
-        suffix : string;
+        suffix : TPathStr;
       begin
-         stringdispose(objfilename);
-         stringdispose(asmfilename);
-         stringdispose(ppufilename);
-         stringdispose(importlibfilename);
-         stringdispose(staticlibfilename);
-         stringdispose(sharedlibfilename);
-         stringdispose(mapfilename);
-         stringdispose(exefilename);
-         stringdispose(dbgfilename);
-         stringdispose(outputpath);
-         stringdispose(path);
-         stringdispose(paramfn);
          { Create names }
-         paramfn := stringdup(fn);
+         paramfn := fn;
          paramallowoutput := allowoutput;
          p := FixPath(ExtractFilePath(fn),false);
          n := FixFileName(ChangeFileExt(ExtractFileName(fn),''));
          { set path }
-         path:=stringdup(p);
+         path:=p;
          { obj,asm,ppu names }
          if AllowOutput then
            begin
@@ -636,31 +622,31 @@ uses
                if (OutputExeDir<>'') then
                  p:=OutputExeDir;
            end;
-         outputpath:=stringdup(p);
-         asmfilename:=stringdup(p+n+target_info.asmext);
-         objfilename:=stringdup(p+n+target_info.objext);
-         ppufilename:=stringdup(p+n+target_info.unitext);
-         importlibfilename:=stringdup(p+target_info.importlibprefix+n+target_info.importlibext);
-         staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
+         outputpath:=p;
+         asmfilename:=p+n+target_info.asmext;
+         objfilename:=p+n+target_info.objext;
+         ppufilename:=p+n+target_info.unitext;
+         importlibfilename:=p+target_info.importlibprefix+n+target_info.importlibext;
+         staticlibfilename:=p+target_info.staticlibprefix+n+target_info.staticlibext;
 
          { output dir of exe can be specified separatly }
          if AllowOutput and (OutputExeDir<>'') then
            p:=OutputExeDir
          else
-           p:=path^;
+           p:=path;
 
          { lib and exe could be loaded with a file specified with -o }
          if AllowOutput and
             (compile_level=1) and
             (OutputFileName<>'')then
            begin
-             exefilename:=stringdup(p+OutputFileName);
-             sharedlibfilename:=stringdup(p+OutputFileName);
+             exefilename:=p+OutputFileName;
+             sharedlibfilename:=p+OutputFileName;
              n:=ChangeFileExt(OutputFileName,''); { for mapfilename and dbgfilename } 
            end
          else
            begin
-             exefilename:=stringdup(p+n+target_info.exeext);
+             exefilename:=p+n+target_info.exeext;
              if Assigned(OutputPrefix) then
                prefix := OutputPrefix^
              else
@@ -669,10 +655,10 @@ uses
                suffix := OutputSuffix^
              else
                suffix := '';
-             sharedlibfilename:=stringdup(p+prefix+n+suffix+target_info.sharedlibext);
+             sharedlibfilename:=p+prefix+n+suffix+target_info.sharedlibext;
            end;
-         mapfilename:=stringdup(p+n+'.map');
-         dbgfilename:=stringdup(p+n+'.dbg');
+         mapfilename:=p+n+'.map';
+         dbgfilename:=p+n+'.dbg';
       end;
 
 
@@ -680,19 +666,19 @@ uses
       begin
         modulename:=stringdup(Upper(s));
         realmodulename:=stringdup(s);
-        mainsource:=nil;
-        ppufilename:=nil;
-        objfilename:=nil;
-        asmfilename:=nil;
-        importlibfilename:=nil;
-        staticlibfilename:=nil;
-        sharedlibfilename:=nil;
-        exefilename:=nil;
-        dbgfilename:=nil;
-        mapfilename:=nil;
-        outputpath:=nil;
-        paramfn:=nil;
-        path:=nil;
+        mainsource:='';
+        ppufilename:='';
+        objfilename:='';
+        asmfilename:='';
+        importlibfilename:='';
+        staticlibfilename:='';
+        sharedlibfilename:='';
+        exefilename:='';
+        dbgfilename:='';
+        mapfilename:='';
+        outputpath:='';
+        paramfn:='';
+        path:='';
         { status }
         state:=ms_registered;
         { unit index }
@@ -708,21 +694,8 @@ uses
         if assigned(sourcefiles) then
          sourcefiles.free;
         sourcefiles:=nil;
-        stringdispose(objfilename);
-        stringdispose(asmfilename);
-        stringdispose(ppufilename);
-        stringdispose(importlibfilename);
-        stringdispose(staticlibfilename);
-        stringdispose(sharedlibfilename);
-        stringdispose(exefilename);
-        stringdispose(dbgfilename);
-        stringdispose(mapfilename);
-        stringdispose(outputpath);
-        stringdispose(path);
         stringdispose(modulename);
         stringdispose(realmodulename);
-        stringdispose(mainsource);
-        stringdispose(paramfn);
         inherited destroy;
       end;
 

+ 21 - 41
compiler/fmodule.pas

@@ -70,17 +70,16 @@ interface
 
       tlinkcontaineritem=class(tlinkedlistitem)
       public
-         data : pshortstring;
+         data : TPathStr;
          needlink : cardinal;
-         constructor Create(const s:string;m:cardinal);
-         destructor Destroy;override;
+         constructor Create(const s:TPathStr;m:cardinal);
       end;
 
       tlinkcontainer=class(tlinkedlist)
-         procedure add(const s : string;m:cardinal);
-         function get(var m:cardinal) : string;
-         function getusemask(mask:cardinal) : string;
-         function find(const s:string):boolean;
+         procedure add(const s : TPathStr;m:cardinal);
+         function get(var m:cardinal) : TPathStr;
+         function getusemask(mask:cardinal) : TPathStr;
+         function find(const s:TPathStr):boolean;
       end;
 
       tmodule = class;
@@ -199,7 +198,7 @@ interface
         points to the module calling it. It is nil for the first compiled
         module. This allow inheritence of all path lists. MUST pay attention
         to that when creating link.res!!!!(mazen)}
-        constructor create(LoadedFrom:TModule;const amodulename,afilename:string;_is_unit:boolean);
+        constructor create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
         destructor destroy;override;
         procedure reset;virtual;
         procedure adddependency(callermodule:tmodule);
@@ -302,7 +301,7 @@ implementation
               begin
                 current_scanner.tempopeninputfile;
                 current_scanner.gettokenpos;
-                parser_current_file:=current_scanner.inputfile.name^;
+                parser_current_file:=current_scanner.inputfile.name;
               end
             else
               begin
@@ -359,31 +358,25 @@ implementation
                              TLinkContainerItem
  ****************************************************************************}
 
-    constructor TLinkContainerItem.Create(const s:string;m:cardinal);
+    constructor TLinkContainerItem.Create(const s:TPathStr;m:cardinal);
       begin
         inherited Create;
-        data:=stringdup(s);
+        data:=s;
         needlink:=m;
       end;
 
 
-    destructor TLinkContainerItem.Destroy;
-      begin
-        stringdispose(data);
-      end;
-
-
 {****************************************************************************
                            TLinkContainer
  ****************************************************************************}
 
-    procedure TLinkContainer.add(const s : string;m:cardinal);
+    procedure TLinkContainer.add(const s : TPathStr;m:cardinal);
       begin
         inherited concat(TLinkContainerItem.Create(s,m));
       end;
 
 
-    function TLinkContainer.get(var m:cardinal) : string;
+    function TLinkContainer.get(var m:cardinal) : TPathStr;
       var
         p : tlinkcontaineritem;
       begin
@@ -395,14 +388,14 @@ implementation
          end
         else
          begin
-           get:=p.data^;
+           get:=p.data;
            m:=p.needlink;
            p.free;
          end;
       end;
 
 
-    function TLinkContainer.getusemask(mask:cardinal) : string;
+    function TLinkContainer.getusemask(mask:cardinal) : TPathStr;
       var
          p : tlinkcontaineritem;
          found : boolean;
@@ -415,14 +408,14 @@ implementation
              getusemask:='';
              exit;
            end;
-          getusemask:=p.data^;
+          getusemask:=p.data;
           found:=(p.needlink and mask)<>0;
           p.free;
         until found;
       end;
 
 
-    function TLinkContainer.find(const s:string):boolean;
+    function TLinkContainer.find(const s:TPathStr):boolean;
       var
         newnode : tlinkcontaineritem;
       begin
@@ -430,7 +423,7 @@ implementation
         newnode:=tlinkcontaineritem(First);
         while assigned(newnode) do
          begin
-           if newnode.data^=s then
+           if newnode.data=s then
             begin
               find:=true;
               exit;
@@ -479,9 +472,10 @@ implementation
                                   TMODULE
  ****************************************************************************}
 
-    constructor tmodule.create(LoadedFrom:TModule;const amodulename,afilename:string;_is_unit:boolean);
+    constructor tmodule.create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
       var
-        n,fn:string;
+        n:string;
+        fn:TPathStr;
       begin
         if amodulename='' then
           n:=ChangeFileExt(ExtractFileName(afilename),'')
@@ -496,7 +490,7 @@ implementation
          inherited create(amodulename)
         else
          inherited create('Program');
-        mainsource:=stringdup(fn);
+        mainsource:=fn;
         { Dos has the famous 8.3 limit :( }
 {$ifdef shortasmprefix}
         asmprefix:=stringdup(FixFileName('as'));
@@ -628,17 +622,6 @@ implementation
         stringdispose(mainname);
         FImportLibraryList.Free;
         extendeddefs.Free;
-        stringdispose(objfilename);
-        stringdispose(asmfilename);
-        stringdispose(ppufilename);
-        stringdispose(importlibfilename);
-        stringdispose(staticlibfilename);
-        stringdispose(sharedlibfilename);
-        stringdispose(exefilename);
-        stringdispose(outputpath);
-        stringdispose(path);
-        stringdispose(realmodulename);
-        stringdispose(mainsource);
         stringdispose(asmprefix);
         stringdispose(deprecatedmsg);
         stringdispose(namespace);
@@ -666,7 +649,6 @@ implementation
 {$ifdef MEMDEBUG}
         memsymtable.stop;
 {$endif}
-        stringdispose(modulename);
         inherited Destroy;
       end;
 
@@ -983,8 +965,6 @@ implementation
 
     procedure tmodule.setmodulename(const s:string);
       begin
-        stringdispose(modulename);
-        stringdispose(realmodulename);
         modulename:=stringdup(upper(s));
         realmodulename:=stringdup(s);
         { also update asmlibrary names }

+ 35 - 38
compiler/fppu.pas

@@ -46,7 +46,7 @@ interface
 
        tppumodule = class(tmodule)
           ppufile    : tcompilerppufile; { the PPU file }
-          sourcefn   : pshortstring; { Source specified with "uses .. in '..'" }
+          sourcefn   : TPathStr; { Source specified with "uses .. in '..'" }
           comments   : TCmdStrList;
 {$ifdef Test_Double_checksum}
           crc_array  : pointer;
@@ -54,7 +54,7 @@ interface
           crc_array2 : pointer;
           crc_size2  : longint;
 {$endif def Test_Double_checksum}
-          constructor create(LoadedFrom:TModule;const amodulename,afilename:string;_is_unit:boolean);
+          constructor create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
           destructor destroy;override;
           procedure reset;override;
           function  openppu:boolean;
@@ -125,11 +125,11 @@ var
                                 TPPUMODULE
  ****************************************************************************}
 
-    constructor tppumodule.create(LoadedFrom:TModule;const amodulename,afilename:string;_is_unit:boolean);
+    constructor tppumodule.create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
       begin
         inherited create(LoadedFrom,amodulename,afilename,_is_unit);
         ppufile:=nil;
-        sourcefn:=stringdup(afilename);
+        sourcefn:=afilename;
       end;
 
 
@@ -140,7 +140,6 @@ var
         ppufile:=nil;
         comments.free;
         comments:=nil;
-        stringdispose(sourcefn);
         inherited Destroy;
       end;
 
@@ -183,14 +182,14 @@ var
         ppufiletime : longint;
       begin
         openppu:=false;
-        Message1(unit_t_ppu_loading,ppufilename^,@queuecomment);
+        Message1(unit_t_ppu_loading,ppufilename,@queuecomment);
       { Get ppufile time (also check if the file exists) }
-        ppufiletime:=getnamedfiletime(ppufilename^);
+        ppufiletime:=getnamedfiletime(ppufilename);
         if ppufiletime=-1 then
          exit;
       { Open the ppufile }
-        Message1(unit_u_ppu_name,ppufilename^);
-        ppufile:=tcompilerppufile.create(ppufilename^);
+        Message1(unit_u_ppu_name,ppufilename);
+        ppufile:=tcompilerppufile.create(ppufilename);
         if not ppufile.openfile then
          begin
            ppufile.free;
@@ -330,12 +329,12 @@ var
               { Check for .p, if mode is macpas}
               Found:=UnitExists(pext,hs);
             end;
-           stringdispose(mainsource);
+           mainsource:='';
            if Found then
             begin
               sources_avail:=true;
               { Load Filenames when found }
-              mainsource:=StringDup(hs);
+              mainsource:=hs;
               SetFileName(hs,false);
             end
            else
@@ -375,7 +374,7 @@ var
 
        var
          fnd : boolean;
-         hs  : TCmdStr;
+         hs  : TPathStr;
        begin
          if shortname then
           filename:=FixFileName(Copy(realmodulename^,1,8))
@@ -394,46 +393,45 @@ var
          if not onlysource then
           begin
             fnd:=PPUSearchPath('.');
-            if (not fnd) and (outputpath^<>'') then
-             fnd:=PPUSearchPath(outputpath^);
-            if (not fnd) and Assigned(main_module) and (main_module.Path^<>'')  then
-             fnd:=PPUSearchPath(main_module.Path^);
+            if (not fnd) and (outputpath<>'') then
+             fnd:=PPUSearchPath(outputpath);
+            if (not fnd) and Assigned(main_module) and (main_module.Path<>'')  then
+             fnd:=PPUSearchPath(main_module.Path);
           end;
-         if (not fnd) and (sourcefn^<>'') then
+         if (not fnd) and (sourcefn<>'') then
           begin
             { the full filename is specified so we can't use here the
               searchpath (PFV) }
             if CheckVerbosity(V_Tried) then
-              Message1(unit_t_unitsearch,ChangeFileExt(sourcefn^,sourceext));
-            fnd:=FindFile(ChangeFileExt(sourcefn^,sourceext),'',true,hs);
+              Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,sourceext));
+            fnd:=FindFile(ChangeFileExt(sourcefn,sourceext),'',true,hs);
             if not fnd then
              begin
                if CheckVerbosity(V_Tried) then
-                 Message1(unit_t_unitsearch,ChangeFileExt(sourcefn^,pasext));
-               fnd:=FindFile(ChangeFileExt(sourcefn^,pasext),'',true,hs);
+                 Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pasext));
+               fnd:=FindFile(ChangeFileExt(sourcefn,pasext),'',true,hs);
              end;
             if not fnd and
                ((m_mac in current_settings.modeswitches) or
                 (tf_p_ext_support in target_info.flags)) then
              begin
                if CheckVerbosity(V_Tried) then
-                 Message1(unit_t_unitsearch,ChangeFileExt(sourcefn^,pext));
-               fnd:=FindFile(ChangeFileExt(sourcefn^,pext),'',true,hs);
+                 Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pext));
+               fnd:=FindFile(ChangeFileExt(sourcefn,pext),'',true,hs);
              end;
             if fnd then
              begin
                sources_avail:=true;
                do_compile:=true;
                recompile_reason:=rr_noppu;
-               stringdispose(mainsource);
-               mainsource:=StringDup(hs);
+               mainsource:=hs;
                SetFileName(hs,false);
              end;
           end;
          if not fnd then
            fnd:=SourceSearchPath('.');
-         if (not fnd) and Assigned(main_module) and (main_module.Path^<>'') then
-           fnd:=SourceSearchPath(main_module.Path^);
+         if (not fnd) and Assigned(main_module) and (main_module.Path<>'') then
+           fnd:=SourceSearchPath(main_module.Path);
          if (not fnd) and Assigned(loaded_from) then
            fnd:=SearchPathList(loaded_from.LocalUnitSearchPath);
          if not fnd then
@@ -494,7 +492,7 @@ var
             hp:=sourcefiles.files;
             for i:=1 to j-1 do
               hp:=hp.ref_next;
-            ppufile.putstring(hp.name^);
+            ppufile.putstring(hp.name);
             ppufile.putlongint(hp.getfiletime);
             dec(j);
          end;
@@ -536,7 +534,7 @@ var
     procedure tppumodule.writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
       var
         hcontainer : tlinkcontainer;
-        s : string;
+        s : TPathStr;
         mask : cardinal;
       begin
         hcontainer:=TLinkContainer.Create;
@@ -748,10 +746,10 @@ var
                  2 path of main source
                  3 current dir
                  4 include/unit path }
-              Source_Time:=GetNamedFileTime(path^+hs);
+              Source_Time:=GetNamedFileTime(path+hs);
               found:=false;
               if Source_Time<>-1 then
-                hs:=path^+hs
+                hs:=path+hs
               else
                if not(is_main) then
                 begin
@@ -784,7 +782,7 @@ var
                     begin
                       do_compile:=true;
                       recompile_reason:=rr_sourcenewer;
-                      Message2(unit_u_source_modified,hs,ppufilename^,@queuecomment);
+                      Message2(unit_u_source_modified,hs,ppufilename,@queuecomment);
                       temp:=temp+' *';
                     end;
                 end
@@ -799,8 +797,7 @@ var
             end;
            if is_main then
              begin
-               stringdispose(mainsource);
-               mainsource:=stringdup(hs);
+               mainsource:=hs;
              end;
            Message1(unit_u_ppu_source,hs+temp,@queuecomment);
            is_main:=false;
@@ -938,7 +935,7 @@ var
           { make sure we don't throw away a precompiled unit if the user simply
             forgot to specify the right wpo feedback file
           }
-          message3(unit_e_different_wpo_file,ppufilename^,orgwpofilename,filetimestring(orgwpofiletime));
+          message3(unit_e_different_wpo_file,ppufilename,orgwpofilename,filetimestring(orgwpofiletime));
       end;
 
 
@@ -1068,7 +1065,7 @@ var
 {$endif def Test_Double_checksum_write}
 
          { create new ppufile }
-         ppufile:=tcompilerppufile.create(ppufilename^);
+         ppufile:=tcompilerppufile.create(ppufilename);
          if not ppufile.createfile then
           Message(unit_f_ppu_cannot_write);
 
@@ -1225,7 +1222,7 @@ var
 {$endif def Test_Double_checksum_write}
 
          { create new ppufile }
-         ppufile:=tcompilerppufile.create(ppufilename^);
+         ppufile:=tcompilerppufile.create(ppufilename);
          ppufile.crc_only:=true;
          if not ppufile.createfile then
            Message(unit_f_ppu_cannot_write);
@@ -1668,7 +1665,7 @@ var
               { compile this module }
               if not(state in [ms_compile,ms_second_compile]) then
                 state:=ms_compile;
-              compile(mainsource^);
+              compile(mainsource);
               setdefgeneration;
             end
            else

+ 18 - 18
compiler/link.pas

@@ -57,7 +57,7 @@ interface
          Constructor Create;virtual;
          Destructor Destroy;override;
          procedure AddModuleFiles(hp:tmodule);
-         Procedure AddObject(const S,unitpath : TCmdStr;isunit:boolean);
+         Procedure AddObject(const S,unitpath : TPathStr;isunit:boolean);
          Procedure AddStaticLibrary(const S : TCmdStr);
          Procedure AddSharedLibrary(S : TCmdStr);
          Procedure AddStaticCLibrary(const S : TCmdStr);
@@ -151,7 +151,7 @@ Implementation
                                    Helpers
 *****************************************************************************}
 
-    function GetFileCRC(const fn:string):cardinal;
+    function GetFileCRC(const fn:TPathStr):cardinal;
       var
         fs : TCStream;
         bufcount,
@@ -309,8 +309,8 @@ Implementation
            4. exe path of the compiler (not when linking on target)
           for all searches don't use the directory cache }
         found:=FindFile(s, CurDirRelPath(source_info), false,foundfile);
-        if (not found) and (current_module.outputpath^<>'') then
-         found:=FindFile(s,current_module.outputpath^,false,foundfile);
+        if (not found) and (current_module.outputpath<>'') then
+         found:=FindFile(s,current_module.outputpath,false,foundfile);
         if (not found) then
          found:=current_module.locallibrarysearchpath.FindFile(s,false,foundfile);
         if (not found) then
@@ -421,7 +421,7 @@ Implementation
                end;
               { unit files }
               while not linkunitofiles.empty do
-                AddObject(linkunitofiles.getusemask(mask),path^,true);
+                AddObject(linkunitofiles.getusemask(mask),path,true);
               while not linkunitstaticlibs.empty do
                 AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
               while not linkunitsharedlibs.empty do
@@ -430,7 +430,7 @@ Implementation
            { Other needed .o and libs, specified using $L,$LINKLIB,external }
            mask:=link_always;
            while not linkotherofiles.empty do
-            AddObject(linkotherofiles.Getusemask(mask),path^,false);
+            AddObject(linkotherofiles.Getusemask(mask),path,false);
            while not linkotherstaticlibs.empty do
             AddStaticCLibrary(linkotherstaticlibs.Getusemask(mask));
            while not linkothersharedlibs.empty do
@@ -457,7 +457,7 @@ Implementation
       end;
 
 
-    Procedure TLinker.AddObject(const S,unitpath : TCmdStr;isunit:boolean);
+    Procedure TLinker.AddObject(const S,unitpath : TPathStr;isunit:boolean);
       begin
         ObjectFiles.Concat(FindObjectFile(s,unitpath,isunit));
       end;
@@ -676,7 +676,7 @@ Implementation
       var
         filecontent : TCmdStr;
         f : text;
-        st : string;
+        st : TCmdStr;
       begin
         if not (tf_no_backquote_support in source_info.flags) or
            (cs_link_on_target in current_settings.globalswitches) then
@@ -739,9 +739,9 @@ Implementation
            if showinfo then
              begin
                if DLLsource then
-                 AsmRes.AddLinkCommand(Command,Para,current_module.sharedlibfilename^)
+                 AsmRes.AddLinkCommand(Command,Para,current_module.sharedlibfilename)
                else
-                 AsmRes.AddLinkCommand(Command,Para,current_module.exefilename^);
+                 AsmRes.AddLinkCommand(Command,Para,current_module.exefilename);
              end
            else
             AsmRes.AddLinkCommand(Command,Para,'');
@@ -770,9 +770,9 @@ Implementation
       begin
         MakeStaticLibrary:=false;
       { remove the library, to be sure that it is rewritten }
-        DeleteFile(current_module.staticlibfilename^);
+        DeleteFile(current_module.staticlibfilename);
       { Call AR }
-        smartpath:=FixPath(ChangeFileExt(current_module.asmfilename^,target_info.smartext),false);
+        smartpath:=FixPath(ChangeFileExt(current_module.asmfilename,target_info.smartext),false);
         SplitBinCmd(target_ar.arcmd,binstr,cmdstr);
         binstr := FindUtil(utilsprefix + binstr);
 
@@ -786,7 +786,7 @@ Implementation
             Assign(script, scriptfile);
             Rewrite(script);
             try
-              writeln(script, 'CREATE ' + current_module.staticlibfilename^);
+              writeln(script, 'CREATE ' + current_module.staticlibfilename);
               current := TCmdStrListItem(SmartLinkOFiles.First);
               while current <> nil do
                 begin
@@ -802,7 +802,7 @@ Implementation
           end
         else
           begin
-            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename^));
+            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename));
             { create AR commands }
             success := true;
             current := TCmdStrListItem(SmartLinkOFiles.First);
@@ -817,7 +817,7 @@ Implementation
           begin
             SplitBinCmd(target_ar.arfinishcmd,binstr,cmdstr);
             binstr := FindUtil(utilsprefix + binstr);
-            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename^));
+            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename));
             success:=DoExec(binstr,cmdstr,false,true);
           end;
 
@@ -1228,7 +1228,7 @@ Implementation
         exeoutput:=CExeOutput.Create;
 
         if (cs_link_map in current_settings.globalswitches) then
-          exemap:=texemap.create(current_module.mapfilename^);
+          exemap:=texemap.create(current_module.mapfilename);
 
         PrintLinkerScript;
 
@@ -1323,14 +1323,14 @@ Implementation
     function TInternalLinker.MakeExecutable:boolean;
       begin
         IsSharedLibrary:=false;
-        result:=RunLinkScript(current_module.exefilename^);
+        result:=RunLinkScript(current_module.exefilename);
       end;
 
 
     function TInternalLinker.MakeSharedLibrary:boolean;
       begin
         IsSharedLibrary:=true;
-        result:=RunLinkScript(current_module.sharedlibfilename^);
+        result:=RunLinkScript(current_module.sharedlibfilename);
       end;
 
 

+ 1 - 1
compiler/ogcoff.pas

@@ -1361,7 +1361,7 @@ const pemagic : array[0..3] of byte = (
            { The `.file' record, and the file name auxiliary record }
            write_symbol('.file', 0, -2, COFF_SYM_FILE, 1);
            fillchar(filename,sizeof(filename),0);
-           filename:=ExtractFileName(current_module.mainsource^);
+           filename:=ExtractFileName(current_module.mainsource);
            inc(symidx);
            FCoffSyms.write(filename[1],sizeof(filename)-1);
            { Sections }

+ 1 - 1
compiler/ogelf.pas

@@ -1141,7 +1141,7 @@ implementation
              TElfObjSection.create_ext(ObjSectionList,'.note.GNU-stack',SHT_PROGBITS,0,0,0,1,0);
            { insert the empty and filename as first in strtab }
            strtabsect.writestr(#0);
-           strtabsect.writestr(ExtractFileName(current_module.mainsource^)+#0);
+           strtabsect.writestr(ExtractFileName(current_module.mainsource)+#0);
            { calc amount of sections we have }
            nsections:=1;
            { also create the index in the section header table }

+ 1 - 1
compiler/ognlm.pas

@@ -770,7 +770,7 @@ function SecOpts(SecOptions:TObjSectionOptions):string;
         { Initial header, will be updated later }
         nlmHeader.signature := NLM_SIGNATURE;
         nlmHeader.version := NLM_HEADER_VERSION;
-        moduleName := upperCase(current_module.exefilename^);
+        moduleName := upperCase(current_module.exefilename);
         nlmHeader.moduleName := moduleName;
         nlmHeader.codeImageOffset := TextExeSec.DataPos+TObjSection(TextExeSec.ObjSectionList[0]).dataalignbytes; // ??? may be that align has to be moved to fixups/imports
         nlmHeader.codeImageSize := TextExeSec.Size;

+ 1 - 1
compiler/optdead.pas

@@ -418,7 +418,7 @@ const
       { -p gives the same kind of output with Solaris nm as
         with GNU nm, and for GNU nm it simply means "unsorted"
       }
-      exitcode:=shell(symbolprogfullpath+maybequoted(current_module.exefilename^)+' > '+fsymfilename);
+      exitcode:=shell(symbolprogfullpath+maybequoted(current_module.exefilename)+' > '+fsymfilename);
       if (exitcode<>0) then
         begin
           cgmessage2(wpo_error_executing_symbol_prog,symbolprogfullpath,tostr(exitcode));

+ 14 - 14
compiler/pmodules.pas

@@ -117,12 +117,12 @@ implementation
     procedure insertobjectfile;
     { Insert the used object file for this unit in the used list for this unit }
       begin
-        current_module.linkunitofiles.add(current_module.objfilename^,link_static);
+        current_module.linkunitofiles.add(current_module.objfilename,link_static);
         current_module.flags:=current_module.flags or uf_static_linked;
 
         if create_smartlink_library then
          begin
-           current_module.linkunitstaticlibs.add(current_module.staticlibfilename^,link_smart);
+           current_module.linkunitstaticlibs.add(current_module.staticlibfilename ,link_smart);
            current_module.flags:=current_module.flags or uf_smart_linked;
          end;
       end;
@@ -787,12 +787,12 @@ implementation
 
          new(s1);
          s1^:=current_module.modulename^;
-         current_module.SetFileName(main_file.path^+main_file.name^,true);
+         current_module.SetFileName(main_file.path+main_file.name,true);
          current_module.SetModuleName(unitname);
 
          { check for system unit }
          new(s2);
-         s2^:=upper(ChangeFileExt(ExtractFileName(main_file.name^),''));
+         s2^:=upper(ChangeFileExt(ExtractFileName(main_file.name),''));
          unitname8:=copy(current_module.modulename^,1,8);
          if (cs_check_unit_name in current_settings.globalswitches) and
             (
@@ -1129,14 +1129,14 @@ implementation
          if not(cs_compilesystem in current_settings.moduleswitches) then
            begin
              if store_interface_crc<>current_module.interface_crc then
-               Message1(unit_u_interface_crc_changed,current_module.ppufilename^);
+               Message1(unit_u_interface_crc_changed,current_module.ppufilename);
              if store_indirect_crc<>current_module.indirect_crc then
-               Message1(unit_u_indirect_crc_changed,current_module.ppufilename^);
+               Message1(unit_u_indirect_crc_changed,current_module.ppufilename);
            end;
 {$ifdef EXTDEBUG}
          if not(cs_compilesystem in current_settings.moduleswitches) then
            if (store_crc<>current_module.crc) and simplify_ppu then
-             Message1(unit_u_implementation_crc_changed,current_module.ppufilename^);
+             Message1(unit_u_implementation_crc_changed,current_module.ppufilename);
 {$endif EXTDEBUG}
 
          { release local symtables that are not needed anymore }
@@ -1510,7 +1510,7 @@ implementation
               if (cs_debuginfo in current_settings.moduleswitches) and
                  (target_dbg.id=dbg_stabs) then
                 begin
-                  Message1(parser_w_parser_reloc_no_debug,current_module.mainsource^);
+                  Message1(parser_w_parser_reloc_no_debug,current_module.mainsource);
                   Message(parser_w_parser_win32_debug_needs_WN);
                   exclude(current_settings.moduleswitches,cs_debuginfo);
                 end;
@@ -1520,7 +1520,7 @@ implementation
          while assigned(main_file.next) do
            main_file := main_file.next;
 
-         current_module.SetFileName(main_file.path^+main_file.name^,true);
+         current_module.SetFileName(main_file.path+main_file.name,true);
 
          { consume _PACKAGE word }
          consume(_ID);
@@ -1597,7 +1597,7 @@ implementation
          if current_module.realmodulename^<>'' then
            tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
 
-         Message1(parser_u_parsing_implementation,current_module.mainsource^);
+         Message1(parser_u_parsing_implementation,current_module.mainsource);
 
          symtablestack.push(current_module.localsymtable);
 
@@ -1737,7 +1737,7 @@ implementation
              uu:=tused_unit(usedunits.first);
              while assigned(uu) do
                begin
-                 RewritePPU(uu.u.ppufilename^,uu.u.ppufilename^);
+                 RewritePPU(uu.u.ppufilename,uu.u.ppufilename);
                  uu:=tused_unit(uu.next);
                end;
 
@@ -1821,7 +1821,7 @@ implementation
               if (cs_debuginfo in current_settings.moduleswitches) and
                  (target_dbg.id=dbg_stabs) then
                 begin
-                  Message1(parser_w_parser_reloc_no_debug,current_module.mainsource^);
+                  Message1(parser_w_parser_reloc_no_debug,current_module.mainsource);
                   Message(parser_w_parser_win32_debug_needs_WN);
                   exclude(current_settings.moduleswitches,cs_debuginfo);
                 end;
@@ -1831,7 +1831,7 @@ implementation
          while assigned(main_file.next) do
            main_file := main_file.next;
 
-         current_module.SetFileName(main_file.path^+main_file.name^,true);
+         current_module.SetFileName(main_file.path+main_file.name,true);
 
          if islibrary then
            begin
@@ -1913,7 +1913,7 @@ implementation
          if current_module.realmodulename^<>'' then
            tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
 
-         Message1(parser_u_parsing_implementation,current_module.mainsource^);
+         Message1(parser_u_parsing_implementation,current_module.mainsource);
 
          symtablestack.push(current_module.localsymtable);
 

+ 2 - 2
compiler/scandir.pas

@@ -1047,7 +1047,7 @@ unit scandir;
           if Assigned(Current_Module) then
             begin
               delete(S,1,1);
-              insert(ChangeFileExt(ExtractFileName(current_module.mainsource^),''),S,1 );
+              insert(ChangeFileExt(ExtractFileName(current_module.mainsource),''),S,1 );
             end;
         s:=FixFileName(s);
         if ExtractFileExt(s)='' then
@@ -1159,7 +1159,7 @@ unit scandir;
           with current_scanner,current_module,localunitsearchpath do
             begin
               skipspace;
-              AddPath(path^,readcomment,false);
+              AddPath(path,readcomment,false);
             end;
       end;
 

+ 9 - 9
compiler/scanner.pas

@@ -673,7 +673,7 @@ implementation
         stringdispose(outputprefix);
         outputprefix := stringdup(s);
         with current_module do
-         setfilename(paramfn^, paramallowoutput);
+         setfilename(paramfn, paramallowoutput);
       end;
 
     procedure dir_libsuffix;
@@ -687,7 +687,7 @@ implementation
         stringdispose(outputsuffix);
         outputsuffix := stringdup(s);
         with current_module do
-          setfilename(paramfn^, paramallowoutput);
+          setfilename(paramfn, paramallowoutput);
       end;
 
     procedure dir_extension;
@@ -702,7 +702,7 @@ implementation
           OutputFileName:=InputFileName;
         OutputFileName:=ChangeFileExt(OutputFileName,'.'+s);
         with current_module do
-          setfilename(paramfn^, paramallowoutput);
+          setfilename(paramfn, paramallowoutput);
       end;
 
 {
@@ -1730,7 +1730,7 @@ In case not, the value returned can be arbitrary.
              end
            else
              begin
-               hpath:=current_scanner.inputfile.path^+';'+CurDirRelPath(source_info);
+               hpath:=current_scanner.inputfile.path+';'+CurDirRelPath(source_info);
                found:=FindFile(path+name, hpath,true,foundfile);
                if not found then
                  found:=current_module.localincludesearchpath.FindFile(path+name,true,foundfile);
@@ -1847,7 +1847,7 @@ In case not, the value returned can be arbitrary.
                 Message1(scan_f_cannot_open_includefile,hs);
               if (not current_scanner.openinputfile) then
                 Message1(scan_f_cannot_open_includefile,hs);
-               Message1(scan_t_start_include_file,current_scanner.inputfile.path^+current_scanner.inputfile.name^);
+               Message1(scan_t_start_include_file,current_scanner.inputfile.path+current_scanner.inputfile.name);
                current_scanner.reload;
              end
            else
@@ -1990,7 +1990,7 @@ In case not, the value returned can be arbitrary.
       begin
       { load block }
         if not openinputfile then
-          Message1(scan_f_cannot_open_input,inputfile.name^);
+          Message1(scan_f_cannot_open_input,inputfile.name);
         reload;
       end;
 
@@ -2086,7 +2086,7 @@ In case not, the value returned can be arbitrary.
         lastlinepos:=inputfile.savelastlinepos;
         line_no:=inputfile.saveline_no;
         if not inputfile.is_macro then
-          parser_current_file:=inputfile.name^;
+          parser_current_file:=inputfile.name;
       end;
 
 
@@ -2710,7 +2710,7 @@ In case not, the value returned can be arbitrary.
                 nextfile;
                 tempopeninputfile;
               { status }
-                Message1(scan_t_back_in,inputfile.name^);
+                Message1(scan_t_back_in,inputfile.name);
               end;
            { load next char }
              c:=inputpointer^;
@@ -2893,7 +2893,7 @@ In case not, the value returned can be arbitrary.
         while assigned(preprocstack) do
          begin
            Message4(scan_e_endif_expected,preprocstring[preprocstack.typ],preprocstack.name,
-             preprocstack.owner.inputfile.name^,tostr(preprocstack.line_nb));
+             preprocstack.owner.inputfile.name,tostr(preprocstack.line_nb));
            poppreprocstack;
          end;
       end;

+ 5 - 5
compiler/systems/t_aix.pas

@@ -237,7 +237,7 @@ var
   StripStr   : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
   linkscript:=nil;
 { Create some replacements }
@@ -246,14 +246,14 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
-   StripStr:='-bmap:'+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+   StripStr:='-bmap:'+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
 { Write used files and libraries }
   WriteResponseFile(false);
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   binstr:=FindUtil(utilsprefix+BinStr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   { the native AIX linker does not support linkres files, so we need
     CatFileContent(). The binutils cross-linker does support such files, so
@@ -327,7 +327,7 @@ var
 begin
   MakeSharedLibrary:=false;
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Write used files and libraries }
   WriteResponseFile(true);
@@ -367,7 +367,7 @@ begin
       cmdstr:=cmdstr+' -bE:'+maybequoted(outputexedir)+'linksyms.fpc';
     end;
 
-  libfn:=maybequoted(current_module.sharedlibfilename^);
+  libfn:=maybequoted(current_module.sharedlibfilename);
   { we have to use a script to use the IFS hack }
   linkscript:=GenerateScript(outputexedir+'ppaslink');
   linkscript.AddLinkCommand(binstr,CmdStr,'');

+ 3 - 3
compiler/systems/t_amiga.pas

@@ -207,7 +207,7 @@ begin
   { Call linker }
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
-  Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename^))));
+  Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
   Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STRIP',StripStr);
   MakeAmiga68kExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
@@ -226,7 +226,7 @@ begin
   { Call linker }
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
-  Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename^))));
+  Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
   Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STRIP',StripStr);
   MakeAmigaPPCExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
@@ -238,7 +238,7 @@ var
   success : boolean;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-    Message1(exec_i_linking,current_module.exefilename^);
+    Message1(exec_i_linking,current_module.exefilename);
 
   { Write used files and libraries }
   WriteResponseFile(false);

+ 6 - 6
compiler/systems/t_beos.pas

@@ -370,7 +370,7 @@ var
   StripStr   : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -401,7 +401,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
@@ -433,7 +433,7 @@ var
  begin
   MakeSharedLibrary:=false;
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -455,11 +455,11 @@ var
 { Write used files and libraries }
   WriteResponseFile(true,true);
 
-  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename^);
+  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename);
 
 { Call linker }
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
@@ -474,7 +474,7 @@ var
   if success and (cs_link_strip in current_settings.globalswitches) then
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
-     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
      success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
 

+ 9 - 9
compiler/systems/t_bsd.pas

@@ -607,7 +607,7 @@ var
   useshell : boolean;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -653,7 +653,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
@@ -673,7 +673,7 @@ begin
      (cs_link_separate_dbg_file in current_settings.globalswitches) then
     begin
       extdbgbinstr:=FindUtil(utilsprefix+'dsymutil');
-      extdbgcmdstr:=maybequoted(current_module.exefilename^);
+      extdbgcmdstr:=maybequoted(current_module.exefilename);
     end;
 
   if (LdSupportsNoResponseFile) and
@@ -730,7 +730,7 @@ begin
   MakeSharedLibrary:=false;
   GCSectionsStr:='';
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Write used files and libraries }
   WriteResponseFile(true);
@@ -745,14 +745,14 @@ begin
 
   InitStr:='-init FPC_LIB_START';
   FiniStr:='-fini FPC_LIB_EXIT';
-  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename^);
+  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename);
 
 { Call linker }
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
 {$ifndef darwin}
-  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
 {$else darwin}
-  Replace(cmdstr,'$EXE',maybequoted(ExpandFileName(current_module.sharedlibfilename^)));
+  Replace(cmdstr,'$EXE',maybequoted(ExpandFileName(current_module.sharedlibfilename)));
 {$endif darwin}
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
@@ -773,7 +773,7 @@ begin
      (cs_link_separate_dbg_file in current_settings.globalswitches) then
     begin
       extdbgbinstr:=FindUtil(utilsprefix+'dsymutil');
-      extdbgcmdstr:=maybequoted(current_module.sharedlibfilename^);
+      extdbgcmdstr:=maybequoted(current_module.sharedlibfilename);
     end;
 
   if (target_info.system in systems_darwin) then
@@ -816,7 +816,7 @@ begin
   if success and (cs_link_strip in current_settings.globalswitches) then
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
-     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
      success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,false,false);
    end;
 

+ 6 - 6
compiler/systems/t_embed.pas

@@ -684,7 +684,7 @@ begin
   GCSectionsStr:='--gc-sections';
   //if not(cs_link_extern in current_settings.globalswitches) then
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Write used files and libraries }
   WriteResponseFile();
@@ -694,7 +694,7 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   if not(cs_link_on_target in current_settings.globalswitches) then
    begin
-    Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
+    Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.elf')))));
     Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STRIP',StripStr);
@@ -703,7 +703,7 @@ begin
    end
   else
    begin
-    Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf'))));
+    Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.elf'))));
     Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STRIP',StripStr);
@@ -718,13 +718,13 @@ begin
 
 { Post process }
   if success then
-    success:=PostProcessExecutable(current_module.exefilename^+'.elf',false);
+    success:=PostProcessExecutable(current_module.exefilename+'.elf',false);
 
   if success and (target_info.system in [system_arm_embedded,system_avr_embedded]) then
     begin
       success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O ihex '+
-        ChangeFileExt(current_module.exefilename^,'.elf')+' '+
-        ChangeFileExt(current_module.exefilename^,'.hex'),true,false);
+        ChangeFileExt(current_module.exefilename,'.elf')+' '+
+        ChangeFileExt(current_module.exefilename,'.hex'),true,false);
     end;
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }

+ 4 - 4
compiler/systems/t_emx.pas

@@ -349,7 +349,7 @@ end;
             LibName:=FixFileName(ImportLibrary.Name + Target_Info.StaticCLibExt);
             seq_no:=1;
             current_module.linkotherstaticlibs.add(libname,link_always);
-            assign(out_file,current_module.outputpath^+libname);
+            assign(out_file,current_module.outputpath+libname);
             rewrite(out_file,1);
             blockwrite(out_file,ar_magic,sizeof(ar_magic));
             for j:=0 to ImportLibrary.ImportSymbolList.Count-1 do
@@ -464,10 +464,10 @@ var
   OutName: TPathStr;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
-  BaseFilename := ChangeFileExt(current_module.exefilename^,'');
+  BaseFilename := ChangeFileExt(current_module.exefilename,'');
   OutName := BaseFilename + '.out';
   if (cs_link_strip in current_settings.globalswitches) then
    StripStr := '-s '
@@ -521,7 +521,7 @@ begin
         Replace(cmdstr,'$OPT ',Info.ExtraOptions);
         Replace(cmdstr,'$RSRC ',RsrcStr);
         Replace(cmdstr,'$OUT',maybequoted(OutName));
-        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
         if i<>3 then
          success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false)
         else

+ 6 - 6
compiler/systems/t_gba.pas

@@ -576,12 +576,12 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
-   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
   //if not(cs_link_extern in current_settings.globalswitches) then
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Write used files and libraries }
   WriteResponseFile();
@@ -590,7 +590,7 @@ begin
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
 
-  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
+  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.elf')))));
   Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
@@ -608,13 +608,13 @@ begin
   if success then
     begin
       success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O binary '+
-        ChangeFileExt(current_module.exefilename^,'.elf')+' '+
-        current_module.exefilename^,true,false);
+        ChangeFileExt(current_module.exefilename,'.elf')+' '+
+        current_module.exefilename,true,false);
     end;
 
   if success then 
     begin
-      success:=DoExec(FindUtil('gbafix'), current_module.exefilename^,true,false);
+      success:=DoExec(FindUtil('gbafix'), current_module.exefilename,true,false);
     end;
 
 

+ 2 - 2
compiler/systems/t_go32v2.pas

@@ -112,7 +112,7 @@ begin
 (* Potential issues with older ld version??? *)
   if (cs_link_strip in current_settings.globalswitches) then
     LinkRes.Add('-s');
-  LinkRes.Add('-o '+maybequoted(current_module.exefilename^));
+  LinkRes.Add('-o '+maybequoted(current_module.exefilename));
 
   { Write staticlibraries }
   if not StaticLibFiles.Empty then
@@ -271,7 +271,7 @@ var
   success : boolean;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
   { Write used files and libraries and our own ld script }
   WriteScript(false);

+ 6 - 6
compiler/systems/t_haiku.pas

@@ -370,7 +370,7 @@ var
   StripStr   : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -401,7 +401,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
@@ -433,7 +433,7 @@ var
  begin
   MakeSharedLibrary:=false;
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -455,11 +455,11 @@ var
 { Write used files and libraries }
   WriteResponseFile(true,true);
 
-  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename^);
+  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename);
 
 { Call linker }
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
@@ -474,7 +474,7 @@ var
   if success and (cs_link_strip in current_settings.globalswitches) then
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
-     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
      success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
 

+ 10 - 10
compiler/systems/t_linux.pas

@@ -1000,7 +1000,7 @@ var
   StripStr   : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -1013,7 +1013,7 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
-   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
   If (cs_profile in current_settings.moduleswitches) or
@@ -1031,7 +1031,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STATIC',StaticStr);
@@ -1051,9 +1051,9 @@ begin
       for i:=1 to 3 do
         begin
           SplitBinCmd(Info.ExtDbgCmd[i],binstr,cmdstr);
-          Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
-          Replace(cmdstr,'$DBGFN',maybequoted(extractfilename(current_module.dbgfilename^)));
-          Replace(cmdstr,'$DBG',maybequoted(current_module.dbgfilename^));
+          Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
+          Replace(cmdstr,'$DBGFN',maybequoted(extractfilename(current_module.dbgfilename)));
+          Replace(cmdstr,'$DBG',maybequoted(current_module.dbgfilename));
           success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
           if not success then
             break;
@@ -1079,7 +1079,7 @@ var
 begin
   MakeSharedLibrary:=false;
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Write used files and libraries }
   WriteResponseFile(true);
@@ -1088,11 +1088,11 @@ begin
  { note: linux does not use exportlib.initname/fininame due to the custom startup code }
   InitStr:='-init FPC_SHARED_LIB_START';
   FiniStr:='-fini FPC_LIB_EXIT';
-  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename^);
+  SoNameStr:='-soname '+ExtractFileName(current_module.sharedlibfilename);
 
 { Call linker }
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$INIT',InitStr);
@@ -1106,7 +1106,7 @@ begin
      { only remove non global symbols and debugging info for a library }
      Info.DllCmd[2]:='strip --discard-all --strip-debug $EXE';
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
-     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
      success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
 

+ 7 - 7
compiler/systems/t_macos.pas

@@ -134,7 +134,7 @@ begin
       if apptype = app_cui then {If SIOW, to avoid some warnings.}
         Add('-ignoredups __start -ignoredups .__start -ignoredups main -ignoredups .main -ignoredups qd '#182);
 
-      Add('-tocdataref off -sym on -dead on -o '+ ScriptFixFileName(current_module.exefilename^));
+      Add('-tocdataref off -sym on -dead on -o '+ ScriptFixFileName(current_module.exefilename));
 
       Add('Exit If "{Status}" != 0');
 
@@ -150,14 +150,14 @@ begin
       if apptype <> app_tool then
         begin
           Add('Echo "data ''SIZE'' (-1) '#182'{ $'#182'"1080 ' + heapsizestr + ' ' + heapsizestr +
-                                         #182'" '#182'};" | Rez -a -o ' + ScriptFixFileName(current_module.exefilename^));
+                                         #182'" '#182'};" | Rez -a -o ' + ScriptFixFileName(current_module.exefilename));
           Add('Exit If "{Status}" != 0');
         end;
 
       {Add mac resources}
       if apptype = app_cui then
         begin
-          Add('Rez -a "{RIncludes}"SIOW.r -o ' + ScriptFixFileName(current_module.exefilename^));
+          Add('Rez -a "{RIncludes}"SIOW.r -o ' + ScriptFixFileName(current_module.exefilename));
           Add('Exit If "{Status}" != 0');
         end;
 
@@ -165,9 +165,9 @@ begin
         begin
           s := Current_module.ResourceFiles.GetFirst;
           if Copy(s,Length(s)-1,Length(s)) = '.r' then
-            Add('Rez -a ' + s + ' -o ' + ScriptFixFileName(current_module.exefilename^))
+            Add('Rez -a ' + s + ' -o ' + ScriptFixFileName(current_module.exefilename))
           else
-            Add('DeRez ' + s + ' | Rez -a -o ' + ScriptFixFileName(current_module.exefilename^));
+            Add('DeRez ' + s + ' | Rez -a -o ' + ScriptFixFileName(current_module.exefilename));
           Add('Exit If "{Status}" != 0');
         end;
 
@@ -193,7 +193,7 @@ begin
   //TODO Only external link in MPW is possible, otherwise yell.
 
   if not(cs_link_nolink in current_settings.globalswitches) then
-    Message1(exec_i_linking,current_module.exefilename^);
+    Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StripStr:='';
@@ -211,7 +211,7 @@ begin
 
 { Prepare linking }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename^)));
+  Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename)));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
   Replace(cmdstr,'$STATIC',StaticStr);

+ 4 - 4
compiler/systems/t_morph.pas

@@ -199,7 +199,7 @@ var
 begin
 
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
   if not (cs_link_on_target in current_settings.globalswitches) then
    begin
@@ -216,13 +216,13 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   if not(cs_link_on_target in current_settings.globalswitches) then
    begin
-    Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename^))));
+    Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
     Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
     Replace(cmdstr,'$STRIP',StripStr);
    end
   else
    begin
-    Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename^)));
+    Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename)));
     Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
    end;
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
@@ -236,7 +236,7 @@ begin
     if success and (cs_link_strip in current_settings.globalswitches) then
      begin
       SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
-      Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+      Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
       success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
      end;
    end;

+ 7 - 7
compiler/systems/t_nds.pas

@@ -723,11 +723,11 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
-   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Write used files and libraries }
   WriteResponseFile();
@@ -736,7 +736,7 @@ begin
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
 
-  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,preName)))));
+  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,preName)))));
   Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
@@ -754,16 +754,16 @@ begin
   if success then
     begin
       success:=DoExec(FindUtil(utilsprefix + 'objcopy'), '-O binary '+ 
-        ChangeFileExt(current_module.exefilename^, preName) + ' ' + 
-        ChangeFileExt(current_module.exefilename^, preName+target_info.exeext),
+        ChangeFileExt(current_module.exefilename, preName) + ' ' + 
+        ChangeFileExt(current_module.exefilename, preName+target_info.exeext),
         true,false);
     end;
 
   if success and (apptype=app_arm9) then 
     begin
       success:=DoExec(FindUtil('ndstool'), '-c ' + 
-        ChangeFileExt(current_module.exefilename^, '.nds') + ' -9 ' + 
-        ChangeFileExt(current_module.exefilename^, preName+target_info.exeext),
+        ChangeFileExt(current_module.exefilename, '.nds') + ' -9 ' + 
+        ChangeFileExt(current_module.exefilename, preName+target_info.exeext),
         true,false);
     end;
   MakeExecutable:=success;   { otherwise a recursive call to link method }

+ 4 - 4
compiler/systems/t_nwl.pas

@@ -281,7 +281,7 @@ Var
 begin
   WriteResponseFile:=False;
 
-  ProgNam := current_module.exefilename^;
+  ProgNam := current_module.exefilename;
   i:=Pos(target_info.exeext,ProgNam);
   if i>0 then
     Delete(ProgNam,i,255);
@@ -536,7 +536,7 @@ var
   f : file;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StripStr:='';
@@ -552,7 +552,7 @@ begin
 
 { if we have a xdc file, dont touch it, otherwise create a new
   one and remove it after nlmconv }
-  xdcname := ChangeFileExt(current_module.exefilename^,'.xdc');
+  xdcname := ChangeFileExt(current_module.exefilename,'.xdc');
   xdcpresent := FileExists (xdcname,false);
   if not xdcpresent then
   begin
@@ -574,7 +574,7 @@ begin
 { Call linker, this will generate a new object file that will be passed
   to nlmconv. Otherwise we could not create nlms without debug info }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));

+ 3 - 3
compiler/systems/t_nwm.pas

@@ -283,7 +283,7 @@ Var
 begin
   WriteResponseFile:=False;
 
-  ProgNam := current_module.exefilename^;
+  ProgNam := current_module.exefilename;
   i:=Pos(target_info.exeext,ProgNam);
   if i>0 then
     Delete(ProgNam,i,255);
@@ -540,7 +540,7 @@ var
   StripStr : string[2];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StripStr:='';
@@ -555,7 +555,7 @@ begin
 { Call linker, this will generate a new object file that will be passed
   to nlmconv. Otherwise we could not create nlms without debug info }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));

+ 5 - 5
compiler/systems/t_os2.pas

@@ -359,8 +359,8 @@ end;
           ImportSymbol  : TImportSymbol;
       begin
         seq_no:=1;
-        current_module.linkotherstaticlibs.add(Current_Module.ImportLibFilename^,link_always);
-        assign(out_file,Current_Module.ImportLibFilename^);
+        current_module.linkotherstaticlibs.add(Current_Module.ImportLibFilename,link_always);
+        assign(out_file,Current_Module.ImportLibFilename);
         rewrite(out_file,1);
         blockwrite(out_file,ar_magic,sizeof(ar_magic));
 
@@ -479,10 +479,10 @@ var
   OutName: TPathStr;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
-  BaseFilename := ChangeFileExt(current_module.exefilename^,'');
+  BaseFilename := ChangeFileExt(current_module.exefilename,'');
   OutName := BaseFilename + '.out';
   if (cs_link_strip in current_settings.globalswitches) then
    StripStr := '-s '
@@ -536,7 +536,7 @@ begin
         Replace(cmdstr,'$OPT ',Info.ExtraOptions);
         Replace(cmdstr,'$RSRC ',RsrcStr);
         Replace(cmdstr,'$OUT',maybequoted(OutName));
-        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
         if i<>3 then
          success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false)
         else

+ 2 - 2
compiler/systems/t_palmos.pas

@@ -165,7 +165,7 @@ var
   i : longint;
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-    Message1(exec_i_linking,current_module.exefilename^);
+    Message1(exec_i_linking,current_module.exefilename);
 
   { Create some replacements }
   StripStr:='';
@@ -182,7 +182,7 @@ begin
      SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
      if binstr<>'' then
       begin
-        Replace(cmdstr,'$EXE',MaybeQuoted(current_module.exefilename^));
+        Replace(cmdstr,'$EXE',MaybeQuoted(current_module.exefilename));
         Replace(cmdstr,'$OPT',Info.ExtraOptions);
         Replace(cmdstr,'$RES',MaybeQuoted(outputexedir+Info.ResName));
         Replace(cmdstr,'$STRIP',StripStr);

+ 5 - 5
compiler/systems/t_sunos.pas

@@ -478,7 +478,7 @@ var
   StripStr   : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StaticStr:='';
@@ -506,7 +506,7 @@ begin
     SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr)
   else
     SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   if use_gnu_ld then
     Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
@@ -550,7 +550,7 @@ var
 begin
   MakeSharedLibrary:=false;
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.sharedlibfilename^);
+   Message1(exec_i_linking,current_module.sharedlibfilename);
 
 { Write used files and libraries }
   WriteResponseFile(true);
@@ -595,7 +595,7 @@ begin
     SplitBinCmd(Info.DllCmd[1],binstr,cmdstr)
   else
     SplitBinCmd(Info.DllCmd[3],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$INITFINI',InitFiniStr);
   if use_gnu_ld then
@@ -623,7 +623,7 @@ begin
   if success and (cs_link_strip in current_settings.globalswitches) then
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
-     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+     Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
      success:=DoExec(utilsprefix+FindUtil(binstr),cmdstr,true,false);
    end;
 

+ 2 - 2
compiler/systems/t_watcom.pas

@@ -139,7 +139,7 @@ var
   StripStr : string[40];
 begin
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 { Create some replacements }
   StripStr:='debug dwarf all';
@@ -151,7 +151,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);

+ 1 - 1
compiler/systems/t_wdosx.pas

@@ -61,7 +61,7 @@ var
 begin
  b := Inherited MakeExecutable;
  if b then
-  DoExec(FindUtil('stubit'),current_module.exefilename^,false,false);
+  DoExec(FindUtil('stubit'),current_module.exefilename,false,false);
  Result := b;
 end;
 

+ 5 - 5
compiler/systems/t_wii.pas

@@ -550,11 +550,11 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
-   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
   if not(cs_link_nolink in current_settings.globalswitches) then
-   Message1(exec_i_linking,current_module.exefilename^);
+   Message1(exec_i_linking,current_module.exefilename);
 
 
 { Write used files and libraries }
@@ -562,7 +562,7 @@ begin
 
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
+  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.elf')))));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STATIC',StaticStr);
@@ -580,8 +580,8 @@ begin
 
   if success then 
    begin
-    success:=DoExec(FindUtil('elf2dol'),ChangeFileExt(current_module.exefilename^,'.elf')+' '+ 
-     current_module.exefilename^,true,false);
+    success:=DoExec(FindUtil('elf2dol'),ChangeFileExt(current_module.exefilename,'.elf')+' '+ 
+     current_module.exefilename,true,false);
    end;
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;

+ 10 - 10
compiler/systems/t_win.pas

@@ -388,8 +388,8 @@ implementation
         idatalabnr:=0;
         SmartFilesCount:=0;
         SmartHeaderCount:=0;
-        current_module.linkotherstaticlibs.add(current_module.importlibfilename^,link_always);
-        ObjWriter:=TARObjectWriter.create(current_module.importlibfilename^);
+        current_module.linkotherstaticlibs.add(current_module.importlibfilename,link_always);
+        ObjWriter:=TARObjectWriter.create(current_module.importlibfilename);
         ObjOutput:=TPECoffObjOutput.Create(ObjWriter);
         for i:=0 to current_module.ImportLibraryList.Count-1 do
           begin
@@ -1420,7 +1420,7 @@ implementation
         ImageBaseStr : string[40];
       begin
         if not(cs_link_nolink in current_settings.globalswitches) then
-         Message1(exec_i_linking,current_module.exefilename^);
+         Message1(exec_i_linking,current_module.exefilename);
 
         { Create some replacements }
         RelocStr:='';
@@ -1451,7 +1451,7 @@ implementation
         if (cs_link_strip in current_settings.globalswitches) then
           StripStr:='-s';
         if (cs_link_map in current_settings.globalswitches) then
-          MapStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+          MapStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
 
       { Write used files and libraries }
         WriteResponseFile(false);
@@ -1467,7 +1467,7 @@ implementation
            SplitBinCmd(Info.ExeCmd[i],binstr,cmdstr);
            if binstr<>'' then
             begin
-              Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+              Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
               Replace(cmdstr,'$OPT',Info.ExtraOptions);
               Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
               Replace(cmdstr,'$APPTYPE',AppTypeStr);
@@ -1493,7 +1493,7 @@ implementation
 
       { Post process }
         if success then
-         success:=PostProcessExecutable(current_module.exefilename^,false);
+         success:=PostProcessExecutable(current_module.exefilename,false);
 
       { Remove ReponseFile }
         if (success) and not(cs_link_nolink in current_settings.globalswitches) then
@@ -1526,7 +1526,7 @@ implementation
       begin
         MakeSharedLibrary:=false;
         if not(cs_link_nolink in current_settings.globalswitches) then
-         Message1(exec_i_linking,current_module.sharedlibfilename^);
+         Message1(exec_i_linking,current_module.sharedlibfilename);
 
       { Create some replacements }
         RelocStr:='';
@@ -1553,7 +1553,7 @@ implementation
         if (cs_link_strip in current_settings.globalswitches) then
           StripStr:='-s';
         if (cs_link_map in current_settings.globalswitches) then
-          MapStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+          MapStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'));
 
       { Write used files and libraries }
         WriteResponseFile(true);
@@ -1569,7 +1569,7 @@ implementation
            SplitBinCmd(Info.DllCmd[i],binstr,cmdstr);
            if binstr<>'' then
             begin
-              Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+              Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
               Replace(cmdstr,'$OPT',Info.ExtraOptions);
               Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
               Replace(cmdstr,'$APPTYPE',AppTypeStr);
@@ -1595,7 +1595,7 @@ implementation
 
       { Post process }
         if success then
-         success:=PostProcessExecutable(current_module.sharedlibfilename^,true);
+         success:=PostProcessExecutable(current_module.sharedlibfilename,true);
 
       { Remove ReponseFile }
         if (success) and not(cs_link_nolink in current_settings.globalswitches) then

+ 2 - 2
compiler/x86/agx86int.pas

@@ -903,7 +903,7 @@ implementation
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource^);
+       comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource);
 {$endif}
       if target_asm.id<>as_x86_64_masm then
         begin
@@ -944,7 +944,7 @@ implementation
 
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       comment(v_info,'Done writing intel-styled assembler output for '+current_module.mainsource^);
+       comment(v_info,'Done writing intel-styled assembler output for '+current_module.mainsource);
 {$endif EXTDEBUG}
    end;
 

+ 2 - 2
compiler/x86/agx86nsm.pas

@@ -1016,7 +1016,7 @@ interface
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       comment(v_info,'Start writing nasm-styled assembler output for '+current_module.mainsource^);
+       comment(v_info,'Start writing nasm-styled assembler output for '+current_module.mainsource);
 {$endif}
       AsmWriteLn('BITS 32');
       AsmLn;
@@ -1038,7 +1038,7 @@ interface
         end;
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
-       comment(v_info,'Done writing nasm-styled assembler output for '+current_module.mainsource^);
+       comment(v_info,'Done writing nasm-styled assembler output for '+current_module.mainsource);
 {$endif EXTDEBUG}
    end;
 

+ 4 - 4
ide/fpcompil.pas

@@ -94,7 +94,7 @@ type
     TFPInputFile = class(tinputfile)
       constructor Create(AEditor: PFileEditor);
     protected
-      function fileopen(const filename: string): boolean; override;
+      function fileopen(const filename: ansistring): boolean; override;
       function fileseek(pos: longint): boolean; override;
       function fileread(var databuf; maxsize: longint): longint; override;
       function fileeof: boolean; override;
@@ -733,7 +733,7 @@ begin
   CompilerStatus:=false;
 end;
 
-Function  CompilerGetNamedFileTime(const filename : string) : Longint;
+Function  CompilerGetNamedFileTime(const filename : ansistring) : Longint;
 var t: longint;
     W: PSourceWindow;
 begin
@@ -745,7 +745,7 @@ begin
   CompilerGetNamedFileTime:=t;
 end;
 
-function CompilerOpenInputFile(const filename: string): tinputfile;
+function CompilerOpenInputFile(const filename: ansistring): tinputfile;
 var f: tinputfile;
     W: PSourceWindow;
 begin
@@ -1207,7 +1207,7 @@ begin
 end;
 
 
-function TFPInputFile.fileopen(const filename: string): boolean;
+function TFPInputFile.fileopen(const filename: ansistring): boolean;
 var OK: boolean;
 begin
   S:=New(PMemoryStream, Init(0,0));