From d684b705555c948f9d0d3d464ff3c119b2cefcf7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 18 Oct 2019 15:45:25 +0200 Subject: [PATCH] reduce compiler warnings in USER-AWPMD --- lib/awpmd/ivutils/include/logexc.h | 15 ++++++--------- lib/awpmd/ivutils/include/pairhash.h | 2 +- lib/awpmd/ivutils/include/wavepacket.h | 4 ++-- lib/awpmd/systems/interact/TCP/wpmd.h | 2 +- lib/awpmd/systems/interact/TCP/wpmd_split.cpp | 11 ++++------- src/USER-AWPMD/fix_nve_awpmd.cpp | 6 +++--- src/USER-AWPMD/pair_awpmd_cut.cpp | 6 +++--- 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 400b3fb7d2..4c8364671a 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -43,12 +43,12 @@ enum vbLEVELS{ template struct log_exception_traits{ /// exeption level according to the vbLEVELS - static int level(const exc_t &signal){ return vblFATAL; } + static int level(const exc_t & /* signal */){ return vblFATAL; } /// the string name of exception category - static string name(const exc_t &signal){ return typeid(exc_t).name();} + static string name(const exc_t & /* signal */){ return typeid(exc_t).name();} /// adds some more explanations to the description /// default behaviour: nothing done - static exc_t add_words(const exc_t &orig, const char *words){ + static exc_t add_words(const exc_t &orig, const char * /* words */){ return orig; } }; @@ -80,7 +80,7 @@ struct log_exception_traits{ return "integer exception";*/ } /// default behaviour: nothing done - static int add_words(const int &orig, const char *words){ + static int add_words(const int &orig, const char * /* words */){ return orig; } }; @@ -90,14 +90,11 @@ template<> struct log_exception_traits{ static int level(const enum vbLEVELS &signal){ return log_exception_traits::level(signal); } static string name(const enum vbLEVELS &signal){ return log_exception_traits::name(signal); } - static enum vbLEVELS add_words(const enum vbLEVELS &orig, const char *words){ + static enum vbLEVELS add_words(const enum vbLEVELS &orig, const char * /* words */){ return orig; } }; - - - /// Logger class to control (computational) function behaviour when something requiring user attention has happened. /// message(signal,errcode, text) is used to either throw an exception or return errorcode /// At first, the the level of error is determined via log_exception_traits<>::level(signal) @@ -205,7 +202,7 @@ public: return errcode; } - virtual void log_text(int level, const char *messtype, const char *messtext){ + virtual void log_text(int /* level */, const char *messtype, const char *messtext){ if(descriptor!="") // descriptor is used as header printf("%s:\n",descriptor.c_str()); if(string(messtype)!=string("")) diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index a4eed54385..1fbc1b8b64 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -324,7 +324,7 @@ public: } //e initializes by unmanaged pointer - sqmatrix(size_t n, T *ptr):size(n){ + sqmatrix(size_t n, T * /* ptr */):size(n){ init(n); } diff --git a/lib/awpmd/ivutils/include/wavepacket.h b/lib/awpmd/ivutils/include/wavepacket.h index e24ac4e237..c4f3837022 100644 --- a/lib/awpmd/ivutils/include/wavepacket.h +++ b/lib/awpmd/ivutils/include/wavepacket.h @@ -24,7 +24,7 @@ class WavePacket; ///\en Template for v=der operation in \ref Wavepacket::int2phys_der() template struct eq_second : public binary_function { - Type operator()(const Type& _Left, const Type& _Right) const{ + Type operator()(const Type& /* _Left */, const Type& _Right) const{ return _Right; } }; @@ -32,7 +32,7 @@ struct eq_second : public binary_function { ///\en Template for v=-der operation in \ref Wavepacket::int2phys_der() template struct eq_minus_second : public binary_function { - Type operator()(const Type& _Left, const Type& _Right) const{ + Type operator()(const Type& /* _Left */, const Type& _Right) const{ return -_Right; } }; diff --git a/lib/awpmd/systems/interact/TCP/wpmd.h b/lib/awpmd/systems/interact/TCP/wpmd.h index c0132bd6e3..bcb99e2092 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.h +++ b/lib/awpmd/systems/interact/TCP/wpmd.h @@ -425,7 +425,7 @@ public: /// calculated only once based on particle tags) /// If force multiplier is zero, then the term may be omitted (energy will also be zero). /// NOW ASSIGNS BASED ON THE FIRST PAIR ONLY - pair check_part1(int s1,int icj1,int ick2, int s2=-1,int icj3=-1,int ick4=-1){ + pair check_part1(int s1,int icj1,int ick2){ int res=check_ee(s1,icj1,ick2); if(res==1){ // my term //printf(" *\n"); diff --git a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp index 361fae1f34..691dbac91b 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd_split.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd_split.cpp @@ -331,7 +331,7 @@ void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, fe_pw[ic1+k1]+=E_der[s1][indw1+8*k1+1]/(2*w*h_plank); for(int i=0;i<3;i++){ fe_x[ic1+k1][i]+= -2*real(wk.a)*E_der[s1][indw1+8*k1+2+2*i]-2*imag(wk.a)*E_der[s1][indw1+8*k1+2+2*i+1]; - fe_p[ic1+k1][i]+= (-E_der[s1][indw1+8*k1+2+2*i+1])*(m_electron/h_plank); //*(h_plank/m_electron); + fe_p[ic1+k1][i]+= (-E_der[s1][indw1+8*k1+2+2*i+1])*(m_electron/h_plank); // *(h_plank/m_electron); fe_pw[ic1+k1]+=(r[i]*E_der[s1][indw1+8*k1+2+2*i+1]/w)/h_plank; fe_w[ic1+k1]+=2*r[i]*(t*E_der[s1][indw1+8*k1+2+2*i]+imag(wk.a)*E_der[s1][indw1+8*k1+2+2*i+1]/w); }*/ @@ -368,7 +368,6 @@ int AWPMD_split::interaction_hartree(int flag, Vector_3P fi, Vector_3P fe_x, for(int c1=0;c1ftm2v; @@ -131,7 +131,7 @@ void FixNVEAwpmd::initial_integrate_respa(int vflag, int ilevel, int iloop) /* ---------------------------------------------------------------------- */ -void FixNVEAwpmd::final_integrate_respa(int ilevel, int iloop) +void FixNVEAwpmd::final_integrate_respa(int ilevel, int /* iloop */) { dtf = 0.5 * step_respa[ilevel] * force->ftm2v; final_integrate(); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 75ebb0e251..fb5db83286 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -642,7 +642,7 @@ void PairAWPMDCut::read_restart_settings(FILE *fp) these arrays are stored locally by pair style ------------------------------------------------------------------------- */ -void PairAWPMDCut::min_xf_pointers(int ignore, double **xextra, double **fextra) +void PairAWPMDCut::min_xf_pointers(int /* ignore */, double **xextra, double **fextra) { // grow arrays if necessary // need to be atom->nmax in length @@ -665,7 +665,7 @@ void PairAWPMDCut::min_xf_pointers(int ignore, double **xextra, double **fextra) calculate and store in min_eradius and min_erforce ------------------------------------------------------------------------- */ -void PairAWPMDCut::min_xf_get(int ignore) +void PairAWPMDCut::min_xf_get(int /* ignore */) { double *eradius = atom->eradius; double *erforce = atom->erforce; @@ -704,7 +704,7 @@ void PairAWPMDCut::min_xf_get(int ignore) propagate the minimizer values to the atom values ------------------------------------------------------------------------- */ -void PairAWPMDCut::min_x_set(int ignore) +void PairAWPMDCut::min_x_set(int /* ignore */) { double *eradius = atom->eradius; double **v=atom->v;