Skip to content

Commit

Permalink
Comment out unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kwsm committed Jun 9, 2021
1 parent c3143e6 commit fb7d831
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
11 changes: 1 addition & 10 deletions include/openbabel/base.h
Expand Up @@ -28,15 +28,6 @@ GNU General Public License for more details.
#include <iostream>
#include <openbabel/tokenst.h>

#ifdef UNUSED
#elif (__GNUC__ == 4)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif

namespace OpenBabel
{

Expand Down Expand Up @@ -283,7 +274,7 @@ class OBConversion; //used only as pointer
//! \brief Base type does nothing
//! Made virtual around r3535 to simplify code which passes around OBBase*.
//Currently no title data member in base class.
virtual const char *GetTitle(bool UNUSED(replaceNewlines) = true) const { return "";}
virtual const char *GetTitle(bool /*replaceNewlines*/ = true) const { return ""; }
virtual void SetTitle(const char *) {}

//! \name Generic data handling methods (via OBGenericData)
Expand Down
16 changes: 8 additions & 8 deletions include/openbabel/forcefield.h
Expand Up @@ -910,56 +910,56 @@ const double GAS_CONSTANT = 8.31446261815324e-3 / KCAL_TO_KJ; //!< kcal mol^-1
* OBFF_LOGLVL_MEDIUM: energy for individual energy terms \n
* OBFF_LOGLVL_HIGH: energy for individual energy interactions \n
*/
virtual double Energy(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double Energy(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Bond stretching energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Bond(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Bond(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Angle bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Angle(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Angle(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Stretch bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_StrBnd(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_StrBnd(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Torsional energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Torsion(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Torsion(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Out-Of-Plane bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_OOP(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_OOP(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Van der Waals energy.
* \par Output to log:
* see Energy()
*/
virtual double E_VDW(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_VDW(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Electrostatic energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Electrostatic(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Electrostatic(bool /*gradients*/ = true) { return 0.0f; }
//@}

/////////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 2 additions & 11 deletions include/openbabel/rotor.h
Expand Up @@ -24,15 +24,6 @@ GNU General Public License for more details.
#include <openbabel/typer.h>
#include <openbabel/bitvec.h>

#ifdef UNUSED
#elif (__GNUC__ == 4)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif

namespace OpenBabel
{
class OBRing;
Expand Down Expand Up @@ -425,7 +416,7 @@ namespace OpenBabel
///@name Deprecated
///@{
/** @deprecated Has no effect. */
void SetDelta(double UNUSED(d)) {}
void SetDelta(double) {}
/** @deprecated Has no effect. */
double GetDelta() { return 10.0; }
/** @deprecated */
Expand All @@ -441,7 +432,7 @@ namespace OpenBabel
/** @deprecated Bad name, see GetTorsionValues() */
std::vector<double> &GetResolution() { return _torsionAngles; }
/** @deprecated */
void SetNumCoords(int UNUSED(nc)) {}
void SetNumCoords(int) {}
///@}

; // Added to workaround https://github.com/swig/swig/issues/1636
Expand Down

0 comments on commit fb7d831

Please sign in to comment.