mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Reverted change concerning the location of the construction of the "null" strings.
Changed dotFoam function to use null-constructed strings rather that the "null" strings.
This commit is contained in:
@ -91,7 +91,9 @@ Foam::string Foam::getEnv(const word& envName)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return string::null;
|
// Return null-constructed string rather than string::null
|
||||||
|
// to avoid cyclic dependencies in the construction of globals
|
||||||
|
return string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +279,9 @@ Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
|
|||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName::null;
|
// Return null-constructed fileName rather than fileName::null
|
||||||
|
// to avoid cyclic dependencies in the construction of globals
|
||||||
|
return fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,11 +37,6 @@ Description
|
|||||||
|
|
||||||
const char* const Foam::FOAMversion = "WM_PROJECT_VERSION";
|
const char* const Foam::FOAMversion = "WM_PROJECT_VERSION";
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
// Static initializers for string::null, word::null and fileName::null
|
|
||||||
|
|
||||||
#include "stringsGlobals.C"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Setup an error handler for the global new operator
|
// Setup an error handler for the global new operator
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ pid_t pgid();
|
|||||||
bool env(const word&);
|
bool env(const word&);
|
||||||
|
|
||||||
//- Return environment variable of given name
|
//- Return environment variable of given name
|
||||||
// Return string::null if the environment is undefined
|
// Return string() if the environment is undefined
|
||||||
string getEnv(const word& name);
|
string getEnv(const word& name);
|
||||||
|
|
||||||
//- Set an environment variable
|
//- Set an environment variable
|
||||||
@ -101,7 +101,7 @@ bool chDir(const fileName& dir);
|
|||||||
// -# shipped settings:
|
// -# shipped settings:
|
||||||
// - $WM_PROJECT_DIR/etc/
|
// - $WM_PROJECT_DIR/etc/
|
||||||
//
|
//
|
||||||
// @return the full path name or fileName::null if the name cannot be found
|
// @return the full path name or fileName() if the name cannot be found
|
||||||
// Optionally abort if the file cannot be found
|
// Optionally abort if the file cannot be found
|
||||||
fileName findEtcFile(const fileName& name, bool mandatory=false);
|
fileName findEtcFile(const fileName& name, bool mandatory=false);
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ License
|
|||||||
|
|
||||||
const char* const Foam::fileName::typeName = "fileName";
|
const char* const Foam::fileName::typeName = "fileName";
|
||||||
int Foam::fileName::debug(debug::debugSwitch(fileName::typeName, 0));
|
int Foam::fileName::debug(debug::debugSwitch(fileName::typeName, 0));
|
||||||
|
const Foam::fileName Foam::fileName::null;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,7 @@ License
|
|||||||
|
|
||||||
const char* const Foam::string::typeName = "string";
|
const char* const Foam::string::typeName = "string";
|
||||||
int Foam::string::debug(debug::debugSwitch(string::typeName, 0));
|
int Foam::string::debug(debug::debugSwitch(string::typeName, 0));
|
||||||
|
const Foam::string Foam::string::null;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -38,8 +38,4 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::string Foam::string::null;
|
|
||||||
const Foam::word Foam::word::null;
|
|
||||||
const Foam::fileName Foam::fileName::null;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -31,5 +31,6 @@ License
|
|||||||
|
|
||||||
const char* const Foam::word::typeName = "word";
|
const char* const Foam::word::typeName = "word";
|
||||||
int Foam::word::debug(Foam::debug::debugSwitch(word::typeName, 0));
|
int Foam::word::debug(Foam::debug::debugSwitch(word::typeName, 0));
|
||||||
|
const Foam::word Foam::word::null;
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user