Skip to content

Commit

Permalink
Enable more pedantic warnings, and fix the problems they find.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbacchus committed Nov 2, 2020
1 parent 4b69656 commit e0a2896
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion OscLib/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Extremely crude stop-gap makefile

CFLAGS := -std=c++17 -I.. -I${ROOT_INC} -I${EIGEN_INC} -I${BOOST_INC} -I${GSL_INC} -g -Wall -Werror
CFLAGS := -std=c++17 -I.. -I${ROOT_INC} -I${EIGEN_INC} -I${BOOST_INC} -I${GSL_INC} -g -Wall -Wpedantic -Wextra -Werror

CFLAGS += $(shell if [[ x${QUALIFIER} == *debug* ]]; then echo ''; else echo '-O3'; fi )

Expand Down
4 changes: 2 additions & 2 deletions OscLib/OscCalcAnalytic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ namespace osc::analytic
}

//---------------------------------------------------------------------------
template<class T> Eigenvalues<T> Hermitian<T>::GetEigenvalues(const T& E)
template<class T> Eigenvalues<T> Hermitian<T>::GetEigenvalues()
{
const auto& M = *this;

Expand Down Expand Up @@ -384,7 +384,7 @@ namespace osc::analytic

// Matrix exponent is based on https://www.wolframalpha.com/input/?i=matrixExp+%5B%5Br%2Cs%2Ct%5D%2C%5Bu%2Cv%2Cw%5D%2C%5Bx%2Cy%2Cz%5D%5D

const Eigenvalues<VT> es = M.GetEigenvalues(E);
const Eigenvalues<VT> es = M.GetEigenvalues();
const VT Aee = M.mm*M.tt - M.mt.norm();
const VT Amm = M.ee*M.tt - M.et.norm();
const cmplx<VT> Aem = M.et*M.mt.conj() - M.em*M.tt;
Expand Down
2 changes: 1 addition & 1 deletion OscLib/OscCalcAnalytic.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace osc::analytic
Hermitian() : em({}, {}), et({}, {}), mt({}, {}) {}

inline __attribute__((always_inline))
Eigenvalues<T> GetEigenvalues(const T& E);
Eigenvalues<T> GetEigenvalues();

T ee; cmplx<T> em; cmplx<T> et;
/*cmplx<T> me;*/ T mm; cmplx<T> mt;
Expand Down
1 change: 1 addition & 0 deletions OscLib/OscCalcDMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace osc

Array<T,Dynamic,Dynamic> P() {return this->fCache.probabilities;}
Array<T,Dynamic,1> P(int flavBefore, int flavAfter, const std::vector<double> &E) override;
using _IOscCalcAdjustable<T>::P;

void SetL (double L ) override {SaveLastParams(); this->fL = L;}
void SetRho (double rho ) override {SaveLastParams(); this->fRho = rho;}
Expand Down
15 changes: 7 additions & 8 deletions OscLib/OscCalcSterile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,42 +110,42 @@ namespace osc
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetDmsq21(const double& dmsq21)
void OscCalcSterile::SetDmsq21(const double&)
{
std::cerr << "Must use SetDm!" << std::endl;
assert(false);
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetDmsq32(const double& dms32)
void OscCalcSterile::SetDmsq32(const double&)
{
std::cerr << "Must use SetDm!" << std::endl;
assert(false);
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetTh12(const double& th12)
void OscCalcSterile::SetTh12(const double&)
{
std::cerr << "Must use SetAngle!" << std::endl;
assert(false);
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetTh13(const double& th13)
void OscCalcSterile::SetTh13(const double&)
{
std::cerr << "Must use SetAngle!" << std::endl;
assert(false);
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetTh23(const double& th23)
void OscCalcSterile::SetTh23(const double&)
{
std::cerr << "Must use SetAngle!" << std::endl;
assert(false);
}

//---------------------------------------------------------------------------
void OscCalcSterile::SetdCP(const double& dCP)
void OscCalcSterile::SetdCP(const double&)
{
std::cerr << "Must use SetDelta!" << std::endl;
assert(false);
Expand Down Expand Up @@ -218,8 +218,7 @@ namespace osc
}

//---------------------------------------------------------------------------
double OscCalcSterileTrivial::P(
int flavBefore, int flavAfter, double E)
double OscCalcSterileTrivial::P(int, int, double)
{
return 1;
}
Expand Down

0 comments on commit e0a2896

Please sign in to comment.