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 Oct 24, 2023
1 parent f9efcc9 commit 31eeb26
Show file tree
Hide file tree
Showing 97 changed files with 170 additions and 188 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 @@ -912,56 +912,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:
OBGenericData* Clone(OBBase* parent) const override { return new OBRateData(*this); }
OBGenericData* Clone(OBBase* /*parent*/) const override { 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";}

OBGenericData* Clone(OBBase* parent) const override { return new OBNasaThermoData(*this); }
OBGenericData* Clone(OBBase* /*parent*/) const override { 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 @@ -426,7 +417,7 @@ namespace OpenBabel
///@{
/** @deprecated Has no effect. */
OB_DEPRECATED_MSG("Has no effect.")
void SetDelta(double UNUSED(d)) {}
void SetDelta(double) {}
/** @deprecated Has no effect. */
OB_DEPRECATED_MSG("Has no effect.")
double GetDelta() { return 10.0; }
Expand All @@ -450,7 +441,7 @@ namespace OpenBabel
std::vector<double> &GetResolution() { return _torsionAngles; }
/** @deprecated */
OB_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*) override;
//! \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
16 changes: 8 additions & 8 deletions src/GUI/OBGUI.cpp
Expand Up @@ -391,7 +391,7 @@ OBGUIFrame::OBGUIFrame(const wxString& title, wxPoint position, wxSize size)
//******************************************************
//********** Event handlers ****************************

void OBGUIFrame::OnClose(wxCloseEvent& event)
void OBGUIFrame::OnClose(wxCloseEvent& /*event*/)
{
//Save the window size, in and out formats, and various options, for use next time.
wxCommandEvent ev;
Expand All @@ -406,7 +406,7 @@ void OBGUIFrame::OnClose(wxCloseEvent& event)
this->Destroy();
}

void OBGUIFrame::OnSaveConfig(wxCommandEvent& event)
void OBGUIFrame::OnSaveConfig(wxCommandEvent& /*event*/)
{
//Save the window size, in and out formats, and various options, for use next time.
wxConfig config(_T("OpenBabelGUI"));
Expand Down Expand Up @@ -522,7 +522,7 @@ void OBGUIFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
wxMessageBox(msg, _T("About OpenBabelGUI"), wxOK | wxICON_INFORMATION | wxCENTER, this);
}

void OBGUIFrame::OnShowDataDir(wxCommandEvent& (event))
void OBGUIFrame::OnShowDataDir(wxCommandEvent& /*event*/)
{
wxString dir = wxGetenv(_T("BABEL_DATADIR"));
wxDirDialog dia(this, _T("BABEL_DATADIR = ")+ dir, dir,
Expand All @@ -533,7 +533,7 @@ void OBGUIFrame::OnShowDataDir(wxCommandEvent& (event))

///////////////////////////////////////////

void OBGUIFrame::OnSelectFormats(wxCommandEvent& event)
void OBGUIFrame::OnSelectFormats(wxCommandEvent& /*event*/)
{
if(m_ActiveFormats.SelectFormats())
{
Expand All @@ -542,11 +542,11 @@ void OBGUIFrame::OnSelectFormats(wxCommandEvent& event)
GetAvailableFormats();
}
}
void OBGUIFrame::OnRestrictFormats(wxCommandEvent& event)
void OBGUIFrame::OnRestrictFormats(wxCommandEvent& /*event*/)
{
GetAvailableFormats();
}
void OBGUIFrame::OnSetDisplayFile(wxCommandEvent& event)
void OBGUIFrame::OnSetDisplayFile(wxCommandEvent& /*event*/)
{
wxTextEntryDialog dialog(this, _T("Enter display command and temporary display file on separate lines"),
_T("Parameters for structure display"), m_DisplayCmd + _T('\n') + m_DisplayFile,
Expand All @@ -559,7 +559,7 @@ void OBGUIFrame::OnSetDisplayFile(wxCommandEvent& event)
}
}

void OBGUIFrame::OnSetMinSize(wxCommandEvent& event)
void OBGUIFrame::OnSetMinSize(wxCommandEvent& /*event*/)
{
SetSize(872, 249);
}
Expand Down Expand Up @@ -1057,7 +1057,7 @@ BEGIN_EVENT_TABLE(CFilenames,wxTextCtrl)
EVT_CHAR(CFilenames::OnKeyPress)
END_EVENT_TABLE()

void CFilenames::OnDblClick(wxMouseEvent& event)
void CFilenames::OnDblClick(wxMouseEvent& /*event*/)
{
//extract double-clicked filename
OBGUIFrame* frame = static_cast<OBGUIFrame*>(GetParent()->GetParent());
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

0 comments on commit 31eeb26

Please sign in to comment.