@@ -2586,8 +2586,8 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep
25862586#ifndef WIN32
25872587 const char * stderrfile = " /dev/null" ;
25882588#else
2589- TString stderrfile;
2590- stderrfile = gSystem ->PrependPathName (build_loc,TString ( " stderr.tmp " ) );
2589+ TString stderrfile= " stderr.tmp " ;
2590+ gSystem ->PrependPathName (build_loc, stderrfile );
25912591#endif
25922592 TString bakdepfilename = depfilename + " .bak" ;
25932593
@@ -2898,7 +2898,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
28982898 if (build_loc == " ." ) {
28992899 build_loc = WorkingDirectory ();
29002900 } else if (build_loc.Length () && (!IsAbsoluteFileName (build_loc)) ) {
2901- build_loc = PrependPathName ( WorkingDirectory (), build_loc );
2901+ PrependPathName ( WorkingDirectory (), build_loc );
29022902 }
29032903
29042904 // Get the include directory list in the dir1:dir2:dir3 format
@@ -2991,7 +2991,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
29912991 library = library_specified;
29922992 ExpandPathName ( library );
29932993 if (! IsAbsoluteFileName (library) ) {
2994- library = PrependPathName ( WorkingDirectory (), library );
2994+ PrependPathName ( WorkingDirectory (), library );
29952995 }
29962996 libname_noext = library_specified;
29972997 library = TString (library) + " ." + fSoExt ;
@@ -3030,15 +3030,17 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
30303030 if (pos==0 ) lib_location.Remove (pos,3 );
30313031
30323032 if (flatBuildDir) {
3033- library = PrependPathName ( build_loc, TString (libname_ext)) ;
3033+ library = libname_ext;
3034+ PrependPathName ( build_loc, library) ;
30343035 } else {
3035- library = PrependPathName ( build_loc, library) ;
3036+ PrependPathName ( build_loc, library) ;
30363037 }
30373038
30383039 Bool_t canWriteBuild_loc = !gSystem ->AccessPathName (build_loc,kWritePermission );
30393040 TString build_loc_store ( build_loc );
30403041 if (!flatBuildDir) {
3041- build_loc = PrependPathName ( build_loc, TString (lib_location));
3042+ TString temp_lib_location = lib_location;
3043+ build_loc = PrependPathName ( build_loc, temp_lib_location);
30423044 }
30433045
30443046 if (gSystem ->AccessPathName (build_loc,kFileExists )) {
@@ -3140,8 +3142,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
31403142 {
31413143 UserGroup_t *ug = gSystem ->GetUserInfo (gSystem ->GetUid ());
31423144 if (ug) {
3143- TString user = (ug->fUser ).Data ();
3144- emergency_loc = PrependPathName ( TempDirectory (), user );
3145+ emergency_loc = (ug->fUser ).Data ();
3146+ PrependPathName ( TempDirectory (), emergency_loc );
31453147 delete ug;
31463148 } else {
31473149 emergency_loc = TempDirectory ();
@@ -3154,8 +3156,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
31543156
31553157 // Generate the dependency filename
31563158 TString depdir = build_loc;
3157- TString depfilename;
3158- depfilename = PrependPathName (depdir, TString ( BaseName (libname_noext)) );
3159+ TString depfilename = BaseName (libname_noext) ;
3160+ PrependPathName (depdir, depfilename );
31593161 depfilename += " _" + extension + " .d" ;
31603162
31613163 if ( !recompile ) {
@@ -3175,7 +3177,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
31753177 if ( gSystem ->GetPathInfo ( depfilename, nullptr ,(Long_t*) nullptr , nullptr , &file_time ) != 0 ) {
31763178 if (!canWrite) {
31773179 depdir = emergency_loc;
3178- depfilename = PrependPathName (depdir, TString (BaseName (libname_noext)));
3180+ depfilename = BaseName (libname_noext);
3181+ PrependPathName (depdir, depfilename);
31793182 depfilename += " _" + extension + " .d" ;
31803183 }
31813184 R__WriteDependencyFile (build_loc, depfilename, filename_fullpath, library, libname, extension, version_var_prefix, includes, defines, incPath);
@@ -3327,8 +3330,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
33273330
33283331 }
33293332
3330- TString libmapfilename;
3331- libmapfilename = PrependPathName ( build_loc, TString (libname) );
3333+ TString libmapfilename = libname ;
3334+ PrependPathName ( build_loc, libmapfilename );
33323335 libmapfilename += " .rootmap" ;
33333336#if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) || defined(R__WIN32)
33343337 Bool_t produceRootmap = kTRUE ;
@@ -3448,8 +3451,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
34483451 dictObj += fObjExt ;
34493452
34503453 // ======= Generate a linkdef file
3451-
3452- TString linkdef = PrependPathName ( build_loc, TString (libname) );
3454+ TString linkdef = libname;
3455+ PrependPathName ( build_loc, linkdef );
34533456 linkdef += " _ACLiC_linkdef.h" ;
34543457 std::ofstream linkdefFile ( linkdef, std::ios::out );
34553458 linkdefFile << " // File Automatically generated by the ROOT Script Compiler "
@@ -3500,8 +3503,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
35003503 linkdefFile.close ();
35013504 // ======= Generate the list of rootmap files to be looked at
35023505
3503- TString mapfile;
3504- mapfile = PrependPathName ( build_loc, TString (libname) );
3506+ TString mapfile = libname ;
3507+ PrependPathName ( build_loc, mapfile );
35053508 mapfile += " _ACLiC_map" ;
35063509 TString mapfilein = mapfile + " .in" ;
35073510 TString mapfileout = mapfile + " .out" ;
@@ -3518,20 +3521,23 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
35183521 {
35193522 TString name = " .rootmap" ;
35203523 TString sname = " system.rootmap" ;
3521- TString file;
3522- file = PrependPathName (TROOT::GetEtcDir (), TString (sname) );
3524+ TString file = sname ;
3525+ PrependPathName (TROOT::GetEtcDir (), file );
35233526 if (gSystem ->AccessPathName (file)) {
35243527 // for backward compatibility check also $ROOTSYS/system<name> if
35253528 // $ROOTSYS/etc/system<name> does not exist
3526- file = PrependPathName (TROOT::GetRootSys (), sname);
3529+ file = sname;
3530+ PrependPathName (TROOT::GetRootSys (), file);
35273531 if (gSystem ->AccessPathName (file)) {
35283532 // for backward compatibility check also $ROOTSYS/<name> if
35293533 // $ROOTSYS/system<name> does not exist
3530- file = PrependPathName (TROOT::GetRootSys (), TString (name));
3534+ file = name;
3535+ PrependPathName (TROOT::GetRootSys (), file);
35313536 }
35323537 }
35333538 mapfileStream << file << std::endl;
3534- file = PrependPathName (gSystem ->HomeDirectory (), TString (name) );
3539+ file = name;
3540+ PrependPathName (gSystem ->HomeDirectory (), file );
35353541 mapfileStream << file << std::endl;
35363542 mapfileStream << name << std::endl;
35373543 if (gInterpreter ->GetRootMapFiles ()) {
@@ -3748,7 +3754,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
37483754#endif
37493755
37503756 TString testcmd = fMakeExe ;
3751- TString fakeMain = PrependPathName ( build_loc, TString (libname) );
3757+ TString fakeMain = libname;
3758+ PrependPathName ( build_loc, fakeMain );
37523759 fakeMain += " _ACLiC_main" ;
37533760 fakeMain += extension;
37543761 std::ofstream fakeMainFile ( fakeMain, std::ios::out );
@@ -3764,7 +3771,8 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
37643771 // however compilation would fail if a main is already there
37653772 // (like stress.cxx)
37663773 // dict.Append(" ").Append(fakeMain);
3767- TString exec = PrependPathName ( build_loc, TString (libname) );
3774+ TString exec = libname;
3775+ PrependPathName ( build_loc, exec );
37683776 exec += " _ACLiC_exec" ;
37693777 testcmd.ReplaceAll (" $SourceFiles" ," -D__ACLIC__ \" $SourceFiles\" " );
37703778 testcmd.ReplaceAll (" $SourceFiles" ,dict);
0 commit comments