Skip to content

Commit

Permalink
make suggested code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
etpalmer63 committed May 27, 2022
1 parent a664558 commit 5b15894
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
5 changes: 3 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ endif
#DEFINES += -DSCROLLBARERROR
#DEFINES += -DFIXDENORMALS

DEFINES += -DAMRVIS_CONFIG_FILEPATH='"${CONFIG_FILEPATH}"'

ifdef CONFIG_FILEPATH
DEFINES += -DAMRVIS_CONFIG_FILEPATH='"${CONFIG_FILEPATH}"'
endif
############################################### float fix
# if we are using float override FOPTF which sets -real_size 64
ifeq ($(PRECISION), FLOAT)
Expand Down
13 changes: 0 additions & 13 deletions GlobalUtilities.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <AMReX_Box.H>
#include <AMReX_Vector.H>

#define CONFIG_FILE_PATH

#include <list>
#include <string>
using std::list;
Expand Down Expand Up @@ -100,16 +98,5 @@ namespace AVGlobals {
#define VSHOWVAL(verbose, val) { if(verbose) { \
cout << #val << " = " << val << endl; } }

//std::string ConfigFilePath (){
//#ifdef CONFIG_FILE_PATH
// return std::string(CONFIG_FILE_PATH);
//#else
// return std::string("Unknown");
//#endif
//}


} // end namespace AVGlobals


#endif
9 changes: 5 additions & 4 deletions GlobalUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ void AVGlobals::GetDefaults(const string &defaultsFile) {

string fullDefaultsFile;

const char *homePath = getenv("HOME");
int homePathLen = strlen(getenv("HOME"));
string homePathStr(homePath, homePathLen);
//const char *homePath = getenv("HOME");
//int homePathLen = strlen(getenv("HOME"));
//string homePathStr(homePath, homePathLen);

const string homePathStr = getenv("HOME");

std::vector<string> fullDefaultsFileList;
#ifdef AMRVIS_CONFIG_FILEPATH
Expand All @@ -298,7 +300,6 @@ void AVGlobals::GetDefaults(const string &defaultsFile) {
bool fileFound = false;

for ( int i=0; i< fullDefaultsFileList.size(); ++i){
cout << fullDefaultsFileList[i] << "\n";

defs.clear(); // must do this to clear the fail bit
defs.open(fullDefaultsFileList[i].c_str());
Expand Down

0 comments on commit 5b15894

Please sign in to comment.