Pārlūkot izejas kodu

* 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 gadi atpakaļ
vecāks
revīzija
14cfe770a4
46 mainītis faili ar 341 papildinājumiem un 398 dzēšanām
  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
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif}
 
 
-      if assigned(current_module.mainsource) then
-        n:=ExtractFileName(current_module.mainsource^)
+      if current_module.mainsource<>'' then
+        n:=ExtractFileName(current_module.mainsource)
       else
       else
         n:=InputFileName;
         n:=InputFileName;
 
 
@@ -1574,7 +1574,7 @@ implementation
       AsmLn;
       AsmLn;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif EXTDEBUG}
     end;
     end;
 
 

+ 3 - 3
compiler/agjasmin.pas

@@ -531,7 +531,7 @@ implementation
         // include files are not support by Java, and the directory of the main
         // include files are not support by Java, and the directory of the main
         // source file must not be specified
         // source file must not be specified
         if assigned(current_module.mainsource) then
         if assigned(current_module.mainsource) then
-          n:=ExtractFileName(current_module.mainsource^)
+          n:=ExtractFileName(current_module.mainsource)
         else
         else
           n:=InputFileName;
           n:=InputFileName;
         AsmWriteLn('.source '+ExtractFileName(n));
         AsmWriteLn('.source '+ExtractFileName(n));
@@ -1066,7 +1066,7 @@ implementation
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif}
 
 
       AsmStartSize:=AsmSize;
       AsmStartSize:=AsmSize;
@@ -1093,7 +1093,7 @@ implementation
       AsmLn;
       AsmLn;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif EXTDEBUG}
     end;
     end;
 
 

+ 9 - 9
compiler/assemble.pas

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

+ 11 - 18
compiler/browcol.pas

@@ -1699,9 +1699,9 @@ end;
           begin
           begin
             DefPos:=tstoredsym(sym).FileInfo;
             DefPos:=tstoredsym(sym).FileInfo;
             inputfile:=get_source_file(defpos.moduleindex,defpos.fileindex);
             inputfile:=get_source_file(defpos.moduleindex,defpos.fileindex);
-            if Assigned(inputfile) and Assigned(inputfile.name) then
+            if Assigned(inputfile) and (inputfile.name<>'') then
               begin
               begin
-                New(Reference, Init(ModuleNames^.Add(inputfile.name^),
+                New(Reference, Init(ModuleNames^.Add(inputfile.name),
                   DefPos.line,DefPos.column));
                   DefPos.line,DefPos.column));
                 Symbol^.References^.Insert(Reference);
                 Symbol^.References^.Insert(Reference);
               end;
               end;
@@ -1712,9 +1712,9 @@ end;
             while assigned(Ref) do
             while assigned(Ref) do
               begin
               begin
                 inputfile:=get_source_file(ref.refinfo.moduleindex,ref.refinfo.fileindex);
                 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
                   begin
-                    New(Reference, Init(ModuleNames^.Add(inputfile.name^),
+                    New(Reference, Init(ModuleNames^.Add(inputfile.name),
                       ref.refinfo.line,ref.refinfo.column));
                       ref.refinfo.line,ref.refinfo.column));
                     Symbol^.References^.Insert(Reference);
                     Symbol^.References^.Insert(Reference);
                   end;
                   end;
@@ -1773,7 +1773,7 @@ begin
        if assigned(t) then
        if assigned(t) then
          begin
          begin
            name:=GetStr(T.Name);
            name:=GetStr(T.Name);
-           msource:=GetStr(hp.mainsource);
+           msource:=hp.mainsource;
            New(UnitS, Init(Name,msource));
            New(UnitS, Init(Name,msource));
            if Assigned(hp.loaded_from) then
            if Assigned(hp.loaded_from) then
              if assigned(hp.loaded_from.globalsymtable) then
              if assigned(hp.loaded_from.globalsymtable) then
@@ -1785,8 +1785,8 @@ begin
              pif:=hp.sourcefiles.files;
              pif:=hp.sourcefiles.files;
              while (pif<>nil) do
              while (pif<>nil) do
              begin
              begin
-               path:=GetStr(pif.path);
-               name:=GetStr(pif.name);
+               path:=pif.path;
+               name:=pif.name;
                UnitS^.AddSourceFile(path+name);
                UnitS^.AddSourceFile(path+name);
                pif:=pif.next;
                pif:=pif.next;
              end;
              end;
@@ -1994,7 +1994,6 @@ end;
 procedure BuildSourceList;
 procedure BuildSourceList;
 var m: tmodule;
 var m: tmodule;
     s: tinputfile;
     s: tinputfile;
-    p: pstring;
     ppu,obj: string;
     ppu,obj: string;
     source: string;
     source: string;
 begin
 begin
@@ -2009,24 +2008,18 @@ begin
     m:=tmodule(loaded_units.first);
     m:=tmodule(loaded_units.first);
     while assigned(m) do
     while assigned(m) do
     begin
     begin
-      obj:=ExpandFileName(m.objfilename^);
+      obj:=ExpandFileName(m.objfilename);
       ppu:=''; source:='';
       ppu:=''; source:='';
       if m.is_unit then
       if m.is_unit then
-        ppu:=ExpandFileName(m.ppufilename^);
+        ppu:=ExpandFileName(m.ppufilename);
       if (m.is_unit=false) and (m.islibrary=false) then
       if (m.is_unit=false) and (m.islibrary=false) then
-        ppu:=ExpandFileName(m.exefilename^);
+        ppu:=ExpandFileName(m.exefilename);
       if assigned(m.sourcefiles) then
       if assigned(m.sourcefiles) then
         begin
         begin
           s:=m.sourcefiles.files;
           s:=m.sourcefiles.files;
           while assigned(s) do
           while assigned(s) do
           begin
           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);
             source:=ExpandFileName(source);
 
 
             sourcefiles^.Insert(New(PSourceFile, Init(source,obj,ppu)));
             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_initsymbolinfo;
 procedure def_donesymbolinfo;
 procedure def_donesymbolinfo;
 procedure def_extractsymbolinfo;
 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 }
 { Function redirecting for IDE support }
 type
 type
   tstopprocedure         = procedure(err:longint);
   tstopprocedure         = procedure(err:longint);
@@ -143,8 +143,8 @@ type
   tinitsymbolinfoproc = procedure;
   tinitsymbolinfoproc = procedure;
   tdonesymbolinfoproc = procedure;
   tdonesymbolinfoproc = procedure;
   textractsymbolinfoproc = 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
 const
   do_status        : tstatusfunction  = @def_status;
   do_status        : tstatusfunction  = @def_status;
@@ -394,13 +394,13 @@ procedure def_extractsymbolinfo;
 begin
 begin
 end;
 end;
 
 
-function  def_openinputfile(const filename: string): tinputfile;
+function  def_openinputfile(const filename: TPathStr): tinputfile;
 begin
 begin
   def_openinputfile:=tdosinputfile.create(filename);
   def_openinputfile:=tdosinputfile.create(filename);
 end;
 end;
 
 
 
 
-Function def_GetNamedFileTime (Const F : String) : Longint;
+Function def_GetNamedFileTime (Const F : TPathStr) : Longint;
 begin
 begin
   Result:=FileAge(F);
   Result:=FileAge(F);
 end;
 end;

+ 8 - 8
compiler/comprsrc.pas

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

+ 1 - 1
compiler/cresstr.pas

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

+ 9 - 9
compiler/dbgdwarf.pas

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

+ 4 - 4
compiler/dbgstabs.pas

@@ -1714,11 +1714,11 @@ implementation
                         current_asmdata.getlabel(hlabel,alt_dbgfile);
                         current_asmdata.getlabel(hlabel,alt_dbgfile);
                         { emit stabs }
                         { emit stabs }
                         if not(ds_stabs_abs_include_files in current_settings.debugswitches) or
                         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)
                                             ',0,0,'+hlabel.name),hp)
                         else
                         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);
                                             ',0,0,'+hlabel.name),hp);
                         list.insertbefore(tai_label.create(hlabel),hp);
                         list.insertbefore(tai_label.create(hlabel),hp);
                         { force new line info }
                         { 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_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))+'",'+
         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)));
           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)));
           base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));
         current_asmdata.asmlists[al_start].concat(tai_label.create(hlabel));
         current_asmdata.asmlists[al_start].concat(tai_label.create(hlabel));
         { for darwin, you need a "module marker" too to work around      }
         { 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
                   if curincludefileinfo.fileindex<>0 then
                     begin
                     begin
                       infile:=get_module(curincludefileinfo.moduleindex).sourcefiles.get_file(curincludefileinfo.fileindex);
                       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;
                       curincludefileinfo.fileindex:=0;
                     end;
                     end;
                   if currfileinfo.fileindex<>1 then
                   if currfileinfo.fileindex<>1 then
@@ -365,7 +365,7 @@ implementation
                       infile:=get_module(currfileinfo.moduleindex).sourcefiles.get_file(currfileinfo.fileindex);
                       infile:=get_module(currfileinfo.moduleindex).sourcefiles.get_file(currfileinfo.fileindex);
                       if assigned(infile) then
                       if assigned(infile) then
                         begin
                         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;
                           curincludefileinfo:=currfileinfo;
                           { force new line info }
                           { force new line info }
                           lastfileinfo.line:=-1;
                           lastfileinfo.line:=-1;
@@ -421,7 +421,7 @@ implementation
       if curincludefileinfo.fileindex<>0 then
       if curincludefileinfo.fileindex<>0 then
         begin
         begin
           infile:=get_module(curincludefileinfo.moduleindex).sourcefiles.get_file(curincludefileinfo.fileindex);
           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;
           curincludefileinfo.fileindex:=0;
         end;
         end;
     end;
     end;

+ 60 - 87
compiler/finput.pas

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

+ 21 - 41
compiler/fmodule.pas

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

+ 35 - 38
compiler/fppu.pas

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

+ 18 - 18
compiler/link.pas

@@ -57,7 +57,7 @@ interface
          Constructor Create;virtual;
          Constructor Create;virtual;
          Destructor Destroy;override;
          Destructor Destroy;override;
          procedure AddModuleFiles(hp:tmodule);
          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 AddStaticLibrary(const S : TCmdStr);
          Procedure AddSharedLibrary(S : TCmdStr);
          Procedure AddSharedLibrary(S : TCmdStr);
          Procedure AddStaticCLibrary(const S : TCmdStr);
          Procedure AddStaticCLibrary(const S : TCmdStr);
@@ -151,7 +151,7 @@ Implementation
                                    Helpers
                                    Helpers
 *****************************************************************************}
 *****************************************************************************}
 
 
-    function GetFileCRC(const fn:string):cardinal;
+    function GetFileCRC(const fn:TPathStr):cardinal;
       var
       var
         fs : TCStream;
         fs : TCStream;
         bufcount,
         bufcount,
@@ -309,8 +309,8 @@ Implementation
            4. exe path of the compiler (not when linking on target)
            4. exe path of the compiler (not when linking on target)
           for all searches don't use the directory cache }
           for all searches don't use the directory cache }
         found:=FindFile(s, CurDirRelPath(source_info), false,foundfile);
         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
         if (not found) then
          found:=current_module.locallibrarysearchpath.FindFile(s,false,foundfile);
          found:=current_module.locallibrarysearchpath.FindFile(s,false,foundfile);
         if (not found) then
         if (not found) then
@@ -421,7 +421,7 @@ Implementation
                end;
                end;
               { unit files }
               { unit files }
               while not linkunitofiles.empty do
               while not linkunitofiles.empty do
-                AddObject(linkunitofiles.getusemask(mask),path^,true);
+                AddObject(linkunitofiles.getusemask(mask),path,true);
               while not linkunitstaticlibs.empty do
               while not linkunitstaticlibs.empty do
                 AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
                 AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
               while not linkunitsharedlibs.empty do
               while not linkunitsharedlibs.empty do
@@ -430,7 +430,7 @@ Implementation
            { Other needed .o and libs, specified using $L,$LINKLIB,external }
            { Other needed .o and libs, specified using $L,$LINKLIB,external }
            mask:=link_always;
            mask:=link_always;
            while not linkotherofiles.empty do
            while not linkotherofiles.empty do
-            AddObject(linkotherofiles.Getusemask(mask),path^,false);
+            AddObject(linkotherofiles.Getusemask(mask),path,false);
            while not linkotherstaticlibs.empty do
            while not linkotherstaticlibs.empty do
             AddStaticCLibrary(linkotherstaticlibs.Getusemask(mask));
             AddStaticCLibrary(linkotherstaticlibs.Getusemask(mask));
            while not linkothersharedlibs.empty do
            while not linkothersharedlibs.empty do
@@ -457,7 +457,7 @@ Implementation
       end;
       end;
 
 
 
 
-    Procedure TLinker.AddObject(const S,unitpath : TCmdStr;isunit:boolean);
+    Procedure TLinker.AddObject(const S,unitpath : TPathStr;isunit:boolean);
       begin
       begin
         ObjectFiles.Concat(FindObjectFile(s,unitpath,isunit));
         ObjectFiles.Concat(FindObjectFile(s,unitpath,isunit));
       end;
       end;
@@ -676,7 +676,7 @@ Implementation
       var
       var
         filecontent : TCmdStr;
         filecontent : TCmdStr;
         f : text;
         f : text;
-        st : string;
+        st : TCmdStr;
       begin
       begin
         if not (tf_no_backquote_support in source_info.flags) or
         if not (tf_no_backquote_support in source_info.flags) or
            (cs_link_on_target in current_settings.globalswitches) then
            (cs_link_on_target in current_settings.globalswitches) then
@@ -739,9 +739,9 @@ Implementation
            if showinfo then
            if showinfo then
              begin
              begin
                if DLLsource then
                if DLLsource then
-                 AsmRes.AddLinkCommand(Command,Para,current_module.sharedlibfilename^)
+                 AsmRes.AddLinkCommand(Command,Para,current_module.sharedlibfilename)
                else
                else
-                 AsmRes.AddLinkCommand(Command,Para,current_module.exefilename^);
+                 AsmRes.AddLinkCommand(Command,Para,current_module.exefilename);
              end
              end
            else
            else
             AsmRes.AddLinkCommand(Command,Para,'');
             AsmRes.AddLinkCommand(Command,Para,'');
@@ -770,9 +770,9 @@ Implementation
       begin
       begin
         MakeStaticLibrary:=false;
         MakeStaticLibrary:=false;
       { remove the library, to be sure that it is rewritten }
       { remove the library, to be sure that it is rewritten }
-        DeleteFile(current_module.staticlibfilename^);
+        DeleteFile(current_module.staticlibfilename);
       { Call AR }
       { 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);
         SplitBinCmd(target_ar.arcmd,binstr,cmdstr);
         binstr := FindUtil(utilsprefix + binstr);
         binstr := FindUtil(utilsprefix + binstr);
 
 
@@ -786,7 +786,7 @@ Implementation
             Assign(script, scriptfile);
             Assign(script, scriptfile);
             Rewrite(script);
             Rewrite(script);
             try
             try
-              writeln(script, 'CREATE ' + current_module.staticlibfilename^);
+              writeln(script, 'CREATE ' + current_module.staticlibfilename);
               current := TCmdStrListItem(SmartLinkOFiles.First);
               current := TCmdStrListItem(SmartLinkOFiles.First);
               while current <> nil do
               while current <> nil do
                 begin
                 begin
@@ -802,7 +802,7 @@ Implementation
           end
           end
         else
         else
           begin
           begin
-            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename^));
+            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename));
             { create AR commands }
             { create AR commands }
             success := true;
             success := true;
             current := TCmdStrListItem(SmartLinkOFiles.First);
             current := TCmdStrListItem(SmartLinkOFiles.First);
@@ -817,7 +817,7 @@ Implementation
           begin
           begin
             SplitBinCmd(target_ar.arfinishcmd,binstr,cmdstr);
             SplitBinCmd(target_ar.arfinishcmd,binstr,cmdstr);
             binstr := FindUtil(utilsprefix + binstr);
             binstr := FindUtil(utilsprefix + binstr);
-            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename^));
+            Replace(cmdstr,'$LIB',maybequoted(current_module.staticlibfilename));
             success:=DoExec(binstr,cmdstr,false,true);
             success:=DoExec(binstr,cmdstr,false,true);
           end;
           end;
 
 
@@ -1228,7 +1228,7 @@ Implementation
         exeoutput:=CExeOutput.Create;
         exeoutput:=CExeOutput.Create;
 
 
         if (cs_link_map in current_settings.globalswitches) then
         if (cs_link_map in current_settings.globalswitches) then
-          exemap:=texemap.create(current_module.mapfilename^);
+          exemap:=texemap.create(current_module.mapfilename);
 
 
         PrintLinkerScript;
         PrintLinkerScript;
 
 
@@ -1323,14 +1323,14 @@ Implementation
     function TInternalLinker.MakeExecutable:boolean;
     function TInternalLinker.MakeExecutable:boolean;
       begin
       begin
         IsSharedLibrary:=false;
         IsSharedLibrary:=false;
-        result:=RunLinkScript(current_module.exefilename^);
+        result:=RunLinkScript(current_module.exefilename);
       end;
       end;
 
 
 
 
     function TInternalLinker.MakeSharedLibrary:boolean;
     function TInternalLinker.MakeSharedLibrary:boolean;
       begin
       begin
         IsSharedLibrary:=true;
         IsSharedLibrary:=true;
-        result:=RunLinkScript(current_module.sharedlibfilename^);
+        result:=RunLinkScript(current_module.sharedlibfilename);
       end;
       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 }
            { The `.file' record, and the file name auxiliary record }
            write_symbol('.file', 0, -2, COFF_SYM_FILE, 1);
            write_symbol('.file', 0, -2, COFF_SYM_FILE, 1);
            fillchar(filename,sizeof(filename),0);
            fillchar(filename,sizeof(filename),0);
-           filename:=ExtractFileName(current_module.mainsource^);
+           filename:=ExtractFileName(current_module.mainsource);
            inc(symidx);
            inc(symidx);
            FCoffSyms.write(filename[1],sizeof(filename)-1);
            FCoffSyms.write(filename[1],sizeof(filename)-1);
            { Sections }
            { 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);
              TElfObjSection.create_ext(ObjSectionList,'.note.GNU-stack',SHT_PROGBITS,0,0,0,1,0);
            { insert the empty and filename as first in strtab }
            { insert the empty and filename as first in strtab }
            strtabsect.writestr(#0);
            strtabsect.writestr(#0);
-           strtabsect.writestr(ExtractFileName(current_module.mainsource^)+#0);
+           strtabsect.writestr(ExtractFileName(current_module.mainsource)+#0);
            { calc amount of sections we have }
            { calc amount of sections we have }
            nsections:=1;
            nsections:=1;
            { also create the index in the section header table }
            { 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 }
         { Initial header, will be updated later }
         nlmHeader.signature := NLM_SIGNATURE;
         nlmHeader.signature := NLM_SIGNATURE;
         nlmHeader.version := NLM_HEADER_VERSION;
         nlmHeader.version := NLM_HEADER_VERSION;
-        moduleName := upperCase(current_module.exefilename^);
+        moduleName := upperCase(current_module.exefilename);
         nlmHeader.moduleName := moduleName;
         nlmHeader.moduleName := moduleName;
         nlmHeader.codeImageOffset := TextExeSec.DataPos+TObjSection(TextExeSec.ObjSectionList[0]).dataalignbytes; // ??? may be that align has to be moved to fixups/imports
         nlmHeader.codeImageOffset := TextExeSec.DataPos+TObjSection(TextExeSec.ObjSectionList[0]).dataalignbytes; // ??? may be that align has to be moved to fixups/imports
         nlmHeader.codeImageSize := TextExeSec.Size;
         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
       { -p gives the same kind of output with Solaris nm as
         with GNU nm, and for GNU nm it simply means "unsorted"
         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
       if (exitcode<>0) then
         begin
         begin
           cgmessage2(wpo_error_executing_symbol_prog,symbolprogfullpath,tostr(exitcode));
           cgmessage2(wpo_error_executing_symbol_prog,symbolprogfullpath,tostr(exitcode));

+ 14 - 14
compiler/pmodules.pas

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

+ 2 - 2
compiler/scandir.pas

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

+ 9 - 9
compiler/scanner.pas

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

+ 5 - 5
compiler/systems/t_aix.pas

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

+ 3 - 3
compiler/systems/t_amiga.pas

@@ -207,7 +207,7 @@ begin
   { Call linker }
   { Call linker }
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   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,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   MakeAmiga68kExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
   MakeAmiga68kExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
@@ -226,7 +226,7 @@ begin
   { Call linker }
   { Call linker }
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   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,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   MakeAmigaPPCExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
   MakeAmigaPPCExe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
@@ -238,7 +238,7 @@ var
   success : boolean;
   success : boolean;
 begin
 begin
   if not(cs_link_nolink 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 }
   { Write used files and libraries }
   WriteResponseFile(false);
   WriteResponseFile(false);

+ 6 - 6
compiler/systems/t_beos.pas

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

+ 9 - 9
compiler/systems/t_bsd.pas

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

+ 6 - 6
compiler/systems/t_embed.pas

@@ -684,7 +684,7 @@ begin
   GCSectionsStr:='--gc-sections';
   GCSectionsStr:='--gc-sections';
   //if not(cs_link_extern in current_settings.globalswitches) then
   //if not(cs_link_extern in current_settings.globalswitches) then
   if not(cs_link_nolink 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 }
 { Write used files and libraries }
   WriteResponseFile();
   WriteResponseFile();
@@ -694,7 +694,7 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   if not(cs_link_on_target in current_settings.globalswitches) then
   if not(cs_link_on_target in current_settings.globalswitches) then
    begin
    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,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STRIP',StripStr);
     Replace(cmdstr,'$STRIP',StripStr);
@@ -703,7 +703,7 @@ begin
    end
    end
   else
   else
    begin
    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,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STATIC',StaticStr);
     Replace(cmdstr,'$STRIP',StripStr);
     Replace(cmdstr,'$STRIP',StripStr);
@@ -718,13 +718,13 @@ begin
 
 
 { Post process }
 { Post process }
   if success then
   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
   if success and (target_info.system in [system_arm_embedded,system_avr_embedded]) then
     begin
     begin
       success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O ihex '+
       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;
     end;
 
 
   MakeExecutable:=success;   { otherwise a recursive call to link method }
   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);
             LibName:=FixFileName(ImportLibrary.Name + Target_Info.StaticCLibExt);
             seq_no:=1;
             seq_no:=1;
             current_module.linkotherstaticlibs.add(libname,link_always);
             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);
             rewrite(out_file,1);
             blockwrite(out_file,ar_magic,sizeof(ar_magic));
             blockwrite(out_file,ar_magic,sizeof(ar_magic));
             for j:=0 to ImportLibrary.ImportSymbolList.Count-1 do
             for j:=0 to ImportLibrary.ImportSymbolList.Count-1 do
@@ -464,10 +464,10 @@ var
   OutName: TPathStr;
   OutName: TPathStr;
 begin
 begin
   if not(cs_link_nolink 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);
 
 
 { Create some replacements }
 { Create some replacements }
-  BaseFilename := ChangeFileExt(current_module.exefilename^,'');
+  BaseFilename := ChangeFileExt(current_module.exefilename,'');
   OutName := BaseFilename + '.out';
   OutName := BaseFilename + '.out';
   if (cs_link_strip in current_settings.globalswitches) then
   if (cs_link_strip in current_settings.globalswitches) then
    StripStr := '-s '
    StripStr := '-s '
@@ -521,7 +521,7 @@ begin
         Replace(cmdstr,'$OPT ',Info.ExtraOptions);
         Replace(cmdstr,'$OPT ',Info.ExtraOptions);
         Replace(cmdstr,'$RSRC ',RsrcStr);
         Replace(cmdstr,'$RSRC ',RsrcStr);
         Replace(cmdstr,'$OUT',maybequoted(OutName));
         Replace(cmdstr,'$OUT',maybequoted(OutName));
-        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
+        Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
         if i<>3 then
         if i<>3 then
          success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false)
          success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false)
         else
         else

+ 6 - 6
compiler/systems/t_gba.pas

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

+ 2 - 2
compiler/systems/t_go32v2.pas

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

+ 6 - 6
compiler/systems/t_haiku.pas

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

+ 10 - 10
compiler/systems/t_linux.pas

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

+ 7 - 7
compiler/systems/t_macos.pas

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

+ 4 - 4
compiler/systems/t_morph.pas

@@ -199,7 +199,7 @@ var
 begin
 begin
 
 
   if not(cs_link_nolink 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);
 
 
   if not (cs_link_on_target in current_settings.globalswitches) then
   if not (cs_link_on_target in current_settings.globalswitches) then
    begin
    begin
@@ -216,13 +216,13 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   if not(cs_link_on_target in current_settings.globalswitches) then
   if not(cs_link_on_target in current_settings.globalswitches) then
    begin
    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,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
     Replace(cmdstr,'$STRIP',StripStr);
     Replace(cmdstr,'$STRIP',StripStr);
    end
    end
   else
   else
    begin
    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)));
     Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
    end;
    end;
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
@@ -236,7 +236,7 @@ begin
     if success and (cs_link_strip in current_settings.globalswitches) then
     if success and (cs_link_strip in current_settings.globalswitches) then
      begin
      begin
       SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
       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);
       success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
      end;
      end;
    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
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
   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
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
    GCSectionsStr:='--gc-sections';
   if not(cs_link_nolink 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 }
 { Write used files and libraries }
   WriteResponseFile();
   WriteResponseFile();
@@ -736,7 +736,7 @@ begin
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   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,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
@@ -754,16 +754,16 @@ begin
   if success then
   if success then
     begin
     begin
       success:=DoExec(FindUtil(utilsprefix + 'objcopy'), '-O binary '+ 
       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);
         true,false);
     end;
     end;
 
 
   if success and (apptype=app_arm9) then 
   if success and (apptype=app_arm9) then 
     begin
     begin
       success:=DoExec(FindUtil('ndstool'), '-c ' + 
       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);
         true,false);
     end;
     end;
   MakeExecutable:=success;   { otherwise a recursive call to link method }
   MakeExecutable:=success;   { otherwise a recursive call to link method }

+ 4 - 4
compiler/systems/t_nwl.pas

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

+ 3 - 3
compiler/systems/t_nwm.pas

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

+ 5 - 5
compiler/systems/t_os2.pas

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

+ 2 - 2
compiler/systems/t_palmos.pas

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

+ 5 - 5
compiler/systems/t_sunos.pas

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

+ 2 - 2
compiler/systems/t_watcom.pas

@@ -139,7 +139,7 @@ var
   StripStr : string[40];
   StripStr : string[40];
 begin
 begin
   if not(cs_link_nolink 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);
 
 
 { Create some replacements }
 { Create some replacements }
   StripStr:='debug dwarf all';
   StripStr:='debug dwarf all';
@@ -151,7 +151,7 @@ begin
 
 
 { Call linker }
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   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,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);

+ 1 - 1
compiler/systems/t_wdosx.pas

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

+ 5 - 5
compiler/systems/t_wii.pas

@@ -550,11 +550,11 @@ begin
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
      not(cs_link_separate_dbg_file in current_settings.globalswitches) then
    StripStr:='-s';
    StripStr:='-s';
   if (cs_link_map in current_settings.globalswitches) then
   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
   if create_smartlink_sections then
    GCSectionsStr:='--gc-sections';
    GCSectionsStr:='--gc-sections';
   if not(cs_link_nolink 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 }
 { Write used files and libraries }
@@ -562,7 +562,7 @@ begin
 
 
 { Call linker }
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   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,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
@@ -580,8 +580,8 @@ begin
 
 
   if success then 
   if success then 
    begin
    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;
    end;
   MakeExecutable:=success;   { otherwise a recursive call to link method }
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
 end;

+ 10 - 10
compiler/systems/t_win.pas

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

+ 2 - 2
compiler/x86/agx86int.pas

@@ -903,7 +903,7 @@ implementation
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif}
       if target_asm.id<>as_x86_64_masm then
       if target_asm.id<>as_x86_64_masm then
         begin
         begin
@@ -944,7 +944,7 @@ implementation
 
 
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif EXTDEBUG}
    end;
    end;
 
 

+ 2 - 2
compiler/x86/agx86nsm.pas

@@ -1016,7 +1016,7 @@ interface
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif}
       AsmWriteLn('BITS 32');
       AsmWriteLn('BITS 32');
       AsmLn;
       AsmLn;
@@ -1038,7 +1038,7 @@ interface
         end;
         end;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       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}
 {$endif EXTDEBUG}
    end;
    end;
 
 

+ 4 - 4
ide/fpcompil.pas

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