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 22, 2022
1 parent 2f34bda commit 9926d92
Show file tree
Hide file tree
Showing 96 changed files with 162 additions and 180 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
4 changes: 2 additions & 2 deletions include/openbabel/chargemodel.h
Expand Up @@ -38,8 +38,8 @@ class OBAPI OBChargeModel : public OBPlugin

/// \return whether partial charges were successfully assigned to this molecule
/// \note The method should fill m_partialCharges and m_formalCharges as well
virtual bool ComputeCharges(OBMol &m ) { return false; };
virtual bool ComputeCharges(OBMol &m, const char *args) { return ComputeCharges( m ); }
virtual bool ComputeCharges(OBMol & /*m*/) { return false; };
virtual bool ComputeCharges(OBMol &m, const char * /*args*/) { return ComputeCharges( m ); }

/// \return a vector of the formal charges on each atom, indexed from 0
/// This method returns floating point formal charges since some
Expand Down
2 changes: 1 addition & 1 deletion include/openbabel/depict/asciipainter.h
Expand Up @@ -31,7 +31,7 @@ namespace OpenBabel
//@{
void NewCanvas(double width, double height);
bool IsGood() const;
void SetFontFamily(const std::string &fontFamily) {}
void SetFontFamily(const std::string &/*fontFamily*/) {}
void SetFontSize(int pointSize);
void SetFillColor(const OBColor &color);
void SetFillRadial(const OBColor &start, const OBColor &end);
Expand Down
2 changes: 1 addition & 1 deletion include/openbabel/depict/cairopainter.h
Expand Up @@ -15,7 +15,7 @@ namespace OpenBabel
//@{
void NewCanvas(double width, double height);
bool IsGood() const;
void SetFontFamily(const std::string &fontFamily) {} // FIXME
void SetFontFamily(const std::string &/*fontFamily*/) {} // FIXME
void SetFontSize(int pointSize);
void SetFillColor(const OBColor &color);
void SetFillRadial(const OBColor &start, const OBColor &end);
Expand Down
2 changes: 1 addition & 1 deletion include/openbabel/depict/commandpainter.h
Expand Up @@ -31,7 +31,7 @@ namespace OpenBabel
//@{
void NewCanvas(double width, double height);
bool IsGood() const;
void SetFontFamily(const std::string &fontFamily) {} // FIXME
void SetFontFamily(const std::string &/*fontFamily*/) {} // FIXME
void SetFontSize(int pointSize);
void SetFillColor(const OBColor &color);
void SetFillRadial(const OBColor &start, const OBColor &end);
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
4 changes: 2 additions & 2 deletions include/openbabel/kinetics.h
Expand Up @@ -41,7 +41,7 @@ class OBRateData : public OBGenericData
double TroeParams[4];
std::map<std::string,double> Efficiencies;
public:
virtual OBGenericData* Clone(OBBase* parent) const{return new OBRateData(*this);}
virtual OBGenericData* Clone(OBBase* /*parent*/) const{return new OBRateData(*this);}
enum rate_type {A, n, E};
enum reaction_type {ARRHENIUS=55555, LINDERMANN, TROE, SRI, THREEBODY};
reaction_type ReactionType;
Expand Down Expand Up @@ -141,7 +141,7 @@ class OBNasaThermoData : public OBGenericData
OBNasaThermoData(): LoT(300),MidT(1000),HiT(3000),phase('G')
{ _type = ThermoData; _attr = "Nasa thermo data";}

virtual OBGenericData* Clone(OBBase* parent) const{return new OBNasaThermoData(*this);}
virtual OBGenericData* Clone(OBBase* /*parent*/) const{return new OBNasaThermoData(*this);}

double GetCoeff(unsigned n) const
{
Expand Down
4 changes: 2 additions & 2 deletions include/openbabel/lineend.h
Expand Up @@ -71,7 +71,7 @@ namespace OpenBabel

//Pass the random acess functions to the source rdbuf and synchronize
virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way,
std::ios_base::openmode which = std::ios_base::in | std::ios_base::out )
std::ios_base::openmode /*which*/ = std::ios_base::in | std::ios_base::out )
{
setg( &myBuffer , &myBuffer , &myBuffer ) ; //ensure next character is from new position
mySource->seekg(off, way);
Expand All @@ -81,7 +81,7 @@ namespace OpenBabel
};

virtual std::streampos seekpos(std::streampos sp,
std::ios_base::openmode which = std::ios_base::in | std::ios_base::out )
std::ios_base::openmode /*which*/ = std::ios_base::in | std::ios_base::out )
{
setg( &myBuffer , &myBuffer , &myBuffer ) ;
//slight hack - if mySource has read past the end, won't let us seek
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
4 changes: 2 additions & 2 deletions include/openbabel/typer.h
Expand Up @@ -43,11 +43,11 @@ class OBAPI OBAtomTyper : public OBGlobalDataBase

public:
OBAtomTyper();
OBAtomTyper(const OBAtomTyper& rhs) {abort();}
OBAtomTyper(const OBAtomTyper& /*rhs*/) {abort();}
~OBAtomTyper();

//swig is requiring these, but I can't figure out how to make it not, so definte with abort
const OBAtomTyper& operator=(const OBAtomTyper& rhs) {abort();}
const OBAtomTyper& operator=(const OBAtomTyper& /*rhs*/) {abort();}

void ParseLine(const char*);
//! \return the number of internal hybridization rules
Expand Down
4 changes: 2 additions & 2 deletions include/openbabel/xml.h
Expand Up @@ -161,8 +161,8 @@ namespace OpenBabel
public:
~XMLBaseFormat(){}
virtual const char* NamespaceURI()const=0;
virtual bool DoElement(const std::string& ElName){return false;};
virtual bool EndElement(const std::string& ElName){return false;};
virtual bool DoElement(const std::string& /*ElName*/){return false;};
virtual bool EndElement(const std::string& /*ElName*/){return false;};
/// The tag at the end of the chemical object e.g. "/molecule>"
virtual const char* EndTag(){return ">";};

Expand Down
2 changes: 1 addition & 1 deletion src/charges/qeq.cpp
Expand Up @@ -157,7 +157,7 @@ namespace OpenBabel
}

//!Returns a triple of numbers: electronegativity (in eV), hardness (in eV), and Gaussian exponent (in bohr^-2)
Eigen::Vector3d QEqCharges::GetParameters(unsigned int Z, int Q)
Eigen::Vector3d QEqCharges::GetParameters(unsigned int Z, int /*Q*/)
{
Eigen::Vector3d P;
//For now, completely ignore the formal charge
Expand Down
2 changes: 1 addition & 1 deletion src/charges/qtpie.cpp
Expand Up @@ -148,7 +148,7 @@ QTPIECharges theQTPIECharges("qtpie"); //Global instance
}
}

Eigen::Vector3d QTPIECharges::GetParameters(unsigned int Z, int Q)
Eigen::Vector3d QTPIECharges::GetParameters(unsigned int Z, int /*Q*/)
{
//Returns a triple of numbers: electronegativity (in eV), hardness (in eV), and Gaussian exponent (in bohr^-2)

Expand Down
6 changes: 3 additions & 3 deletions src/conformersearch.cpp
Expand Up @@ -55,7 +55,7 @@ namespace OpenBabel {

OBConformerFilter::~OBConformerFilter() {}

bool OBStericConformerFilter::IsGood(const OBMol &mol, const RotorKey &key, double *conformer)
bool OBStericConformerFilter::IsGood(const OBMol &mol, const RotorKey & /*key*/, double *conformer)
{
unsigned int a1 = 0, a2 = 0;
unsigned int numAtoms = mol.NumAtoms();
Expand Down Expand Up @@ -104,7 +104,7 @@ namespace OpenBabel {
OBConformerScore::~OBConformerScore() {}

double OBRMSDConformerScore::Score(OBMol &mol, unsigned int index,
const RotorKeys &keys, const std::vector<double*> &conformers)
const RotorKeys & /*keys*/, const std::vector<double*> &conformers)
{
unsigned int numAtoms = mol.NumAtoms();

Expand Down Expand Up @@ -228,7 +228,7 @@ namespace OpenBabel {
}

double OBMinimizingRMSDConformerScore::Score(OBMol &mol, unsigned int index,
const RotorKeys &keys, const std::vector<double*> &conformers)
const RotorKeys & /*keys*/, const std::vector<double*> &conformers)
{
unsigned int numAtoms = mol.NumAtoms();
double *origCoords = mol.GetCoordinates();
Expand Down
18 changes: 9 additions & 9 deletions src/depict/asciipainter.cpp
Expand Up @@ -51,24 +51,24 @@ namespace OpenBabel
return true;
}

void ASCIIPainter::SetFontSize(int pointSize)
void ASCIIPainter::SetFontSize(int /*pointSize*/)
{
}

void ASCIIPainter::SetFillColor(const OBColor &color)
void ASCIIPainter::SetFillColor(const OBColor &/*color*/)
{
}

void ASCIIPainter::SetFillRadial(const OBColor &start, const OBColor &end)
void ASCIIPainter::SetFillRadial(const OBColor &/*start*/, const OBColor &/*end*/)
{
}


void ASCIIPainter::SetPenColor(const OBColor &color)
void ASCIIPainter::SetPenColor(const OBColor &/*color*/)
{
}

void ASCIIPainter::SetPenWidth(double width)
void ASCIIPainter::SetPenWidth(double /*width*/)
{
}

Expand All @@ -77,7 +77,7 @@ namespace OpenBabel
return 0.0;
}

void ASCIIPainter::DrawLine(double x1, double y1, double x2, double y2, const std::vector<double> & dashes)
void ASCIIPainter::DrawLine(double x1, double y1, double x2, double y2, const std::vector<double> & /*dashes*/)
{
vector<pair<int, int> > coords;
vector<pair<int, int> >::iterator vp_it;
Expand All @@ -103,11 +103,11 @@ namespace OpenBabel
DrawLine(vp_it->first, vp_it->second, points.begin()->first, points.begin()->second);
}

void ASCIIPainter::DrawCircle(double x, double y, double r)
void ASCIIPainter::DrawCircle(double /*x*/, double /*y*/, double /*r*/)
{
}

void ASCIIPainter::DrawBall(double x, double y, double r, double opacity)
void ASCIIPainter::DrawBall(double /*x*/, double /*y*/, double /*r*/, double /*opacity*/)
{
}

Expand All @@ -121,7 +121,7 @@ namespace OpenBabel
}
}

OBFontMetrics ASCIIPainter::GetFontMetrics(const std::string &text)
OBFontMetrics ASCIIPainter::GetFontMetrics(const std::string & /*text*/)
{
OBFontMetrics metrics;
// The following line tries to workaround the fact that fontSize is an int
Expand Down
4 changes: 2 additions & 2 deletions src/depict/cairopainter.cpp
Expand Up @@ -99,7 +99,7 @@ namespace OpenBabel
cairo_set_source_rgb(m_cairo, color.red, color.green, color.blue);
}

void CairoPainter::SetFillRadial(const OBColor &start, const OBColor &end)
void CairoPainter::SetFillRadial(const OBColor & /*start*/, const OBColor &end)
{
cairo_set_source_rgb(m_cairo, end.red, end.green, end.blue);
}
Expand Down Expand Up @@ -183,7 +183,7 @@ namespace OpenBabel
return CAIRO_STATUS_SUCCESS;
}

void CairoPainter::DrawBall(double x, double y, double r, double opacity)
void CairoPainter::DrawBall(double /*x*/, double /*y*/, double /*r*/, double /*opacity*/)
{

}
Expand Down
4 changes: 2 additions & 2 deletions src/depict/commandpainter.cpp
Expand Up @@ -112,7 +112,7 @@ namespace OpenBabel
m_ofs << "DrawCircle " << x << " " << y << " radius " << r << endl;
}

void CommandPainter::DrawBall(double x, double y, double r, double opacity)
void CommandPainter::DrawBall(double x, double y, double r, double /*opacity*/)
{
m_ofs << "DrawBall " << x << " " << y << " radius " << r << endl;
}
Expand All @@ -122,7 +122,7 @@ namespace OpenBabel
m_ofs << "DrawText " << x << " " << y << " \"" << text << "\"" << endl;
}

OBFontMetrics CommandPainter::GetFontMetrics(const std::string &text)
OBFontMetrics CommandPainter::GetFontMetrics(const std::string& /*text*/)
{
OBFontMetrics metrics;
metrics.fontSize = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/depict/depict.cpp
Expand Up @@ -893,7 +893,7 @@ namespace OpenBabel
end.x() + spacing.x() - offset.x(), end.y() + spacing.y() - offset.y());
}

void OBDepictPrivate::DrawAtom(OBAtom *atom)
void OBDepictPrivate::DrawAtom(OBAtom * /*atom*/)
{
}

Expand Down Expand Up @@ -1065,7 +1065,7 @@ namespace OpenBabel
}
}
void OBDepictPrivateBallAndStick::DrawSimpleBond(OBAtom* beginAtom,
OBAtom* endAtom, int order, bool crossed_bond)
OBAtom* endAtom, int order, bool /*crossed_bond*/)
{
const vector3 begin = beginAtom->GetVector();
const vector3 end = endAtom->GetVector();
Expand Down Expand Up @@ -1221,7 +1221,7 @@ OBBitVec& drawnBonds)
}
}

inline void OBDepictPrivateBallAndStick::DrawAromaticRingBond(OBAtom *prevAtom, OBAtom *beginAtom, OBAtom *endAtom, OBAtom *nextAtom, const vector3 &center, double dist)
inline void OBDepictPrivateBallAndStick::DrawAromaticRingBond(OBAtom *prevAtom, OBAtom *beginAtom, OBAtom *endAtom, OBAtom *nextAtom, const vector3 & /*center*/, double /*dist*/)
{
const vector3 prev = prevAtom->GetVector();
const vector3 begin = beginAtom->GetVector();
Expand Down

0 comments on commit 9926d92

Please sign in to comment.