Skip to content

Commit

Permalink
Merge pull request #1116 from mabraham/pacify-clang-analyzer
Browse files Browse the repository at this point in the history
Reuse result from getenv
  • Loading branch information
GiovanniBussi authored Oct 4, 2024
2 parents 2047882 + 6980cf8 commit 18896fd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wrapper/Plumed.h
Original file line number Diff line number Diff line change
Expand Up @@ -4015,6 +4015,8 @@ void plumed_retrieve_functions(plumed_plumedmain_function_holder* functions, plu
void* p;
char* debug;
int dlopenmode;
/* possible value of PLUMED_LOAD_NAMESPACE environment variable */
char *load_namespace;
g.create=__PLUMED_WRAPPER_CXX_NULLPTR;
g.cmd=__PLUMED_WRAPPER_CXX_NULLPTR;
g.finalize=__PLUMED_WRAPPER_CXX_NULLPTR;
Expand Down Expand Up @@ -4045,7 +4047,8 @@ void plumed_retrieve_functions(plumed_plumedmain_function_holder* functions, plu
__PLUMED_FPRINTF(stderr,"+++ PLUMED_KERNEL=\"%s\" +++\n",path);
if(debug) __PLUMED_FPRINTF(stderr,"+++ Loading with mode RTLD_NOW");
dlopenmode=RTLD_NOW;
if(__PLUMED_GETENV("PLUMED_LOAD_NAMESPACE") && !__PLUMED_WRAPPER_STD strcmp(__PLUMED_GETENV("PLUMED_LOAD_NAMESPACE"),"GLOBAL")) {
load_namespace = __PLUMED_GETENV("PLUMED_LOAD_NAMESPACE");
if(load_namespace && !__PLUMED_WRAPPER_STD strcmp(load_namespace,"GLOBAL")) {
dlopenmode=dlopenmode|RTLD_GLOBAL;
if(debug) __PLUMED_FPRINTF(stderr,"|RTLD_GLOBAL");
} else {
Expand Down Expand Up @@ -4151,6 +4154,8 @@ plumed plumed_create(void) {
plumed p;
/* pointer to implementation */
plumed_implementation* pimpl;
/* possible value of PLUMED_LOAD_DLCLOSE environment variable */
char *load_dlclose;
/* allocate space for implementation object. this is free-ed in plumed_finalize(). */
pimpl=plumed_malloc_pimpl();
/* store pointers in pimpl */
Expand All @@ -4161,7 +4166,8 @@ plumed plumed_create(void) {
#endif
/* note if handle should not be dlclosed */
pimpl->dlclose=1;
if(__PLUMED_GETENV("PLUMED_LOAD_DLCLOSE") && !__PLUMED_WRAPPER_STD strcmp(__PLUMED_GETENV("PLUMED_LOAD_DLCLOSE"),"no")) pimpl->dlclose=0;
load_dlclose = __PLUMED_GETENV("PLUMED_LOAD_DLCLOSE");
if(load_dlclose && !__PLUMED_WRAPPER_STD strcmp(load_dlclose,"no")) pimpl->dlclose=0;
/* in case of failure, return */
/* the resulting object should be plumed_finalized, though you cannot use plumed_cmd */
if(!pimpl->functions.create) {
Expand Down

1 comment on commit 18896fd

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/ANGLES.tmp
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/CAVITY.tmp
Found broken examples in automatic/CLASSICAL_MDS.tmp
Found broken examples in automatic/CLUSTER_DIAMETER.tmp
Found broken examples in automatic/CLUSTER_DISTRIBUTION.tmp
Found broken examples in automatic/CLUSTER_PROPERTIES.tmp
Found broken examples in automatic/CONSTANT.tmp
Found broken examples in automatic/CONTACT_MATRIX.tmp
Found broken examples in automatic/CONTACT_MATRIX_PROPER.tmp
Found broken examples in automatic/CONVERT_TO_FES.tmp
Found broken examples in automatic/COORDINATIONNUMBER.tmp
Found broken examples in automatic/DFSCLUSTERING.tmp
Found broken examples in automatic/DISTANCE_FROM_CONTOUR.tmp
Found broken examples in automatic/DUMPCUBE.tmp
Found broken examples in automatic/DUMPGRID.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FIND_CONTOUR.tmp
Found broken examples in automatic/FIND_CONTOUR_SURFACE.tmp
Found broken examples in automatic/FIND_SPHERICAL_CONTOUR.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HBOND_MATRIX.tmp
Found broken examples in automatic/HISTOGRAM.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/INCYLINDER.tmp
Found broken examples in automatic/INENVELOPE.tmp
Found broken examples in automatic/INTERPOLATE_GRID.tmp
Found broken examples in automatic/LOCAL_AVERAGE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/METATENSOR.tmp
Found broken examples in automatic/MULTICOLVARDENS.tmp
Found broken examples in automatic/OUTPUT_CLUSTER.tmp
Found broken examples in automatic/PAMM.tmp
Found broken examples in automatic/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in automatic/PYCVINTERFACE.tmp
Found broken examples in automatic/PYTHONFUNCTION.tmp
Found broken examples in automatic/Q3.tmp
Found broken examples in automatic/Q4.tmp
Found broken examples in automatic/Q6.tmp
Found broken examples in automatic/QUATERNION.tmp
Found broken examples in automatic/REWEIGHT_BIAS.tmp
Found broken examples in automatic/REWEIGHT_METAD.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_LINEAR_PROJ.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_MAHA_DIST.tmp
Found broken examples in automatic/SPRINT.tmp
Found broken examples in automatic/TETRAHEDRALPORE.tmp
Found broken examples in automatic/TORSIONS.tmp
Found broken examples in automatic/WHAM_HISTOGRAM.tmp
Found broken examples in automatic/WHAM_WEIGHTS.tmp
Found broken examples in AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.