Skip to content

Commit

Permalink
Removed 'void' arguments in function declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jobst Ziebell authored and Jobst Ziebell committed Sep 30, 2015
1 parent dedc5a6 commit 784f13a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions meta/GMuonMinus2.m
Expand Up @@ -78,11 +78,11 @@ If you add new kinds of vertices (e.g for new diagram types):
muonIndex = GetMuonIndex[];
muonFamily = GetMuonFamily[];

prototypes = ("static const unsigned int muonIndex( void );\n" <>
prototypes = ("static const unsigned int muonIndex();\n" <>
"static const double muonPhysicalMass( EvaluationContext &context );\n" <>
"static const double muonCharge( EvaluationContext &context );");

definitions = ("static const unsigned int muonIndex( void )\n" <>
definitions = ("static const unsigned int muonIndex()\n" <>
"{ unsigned int muonIndex" <>
If[muonIndex =!= Null, " = " <> ToString[muonIndex-1], ""] <>
"; return muonIndex; }\n" <>
Expand Down Expand Up @@ -188,8 +188,8 @@ If you add new kinds of vertices (e.g for new diagram types):
particles = Select[particles, (! TreeMasses`IsGhost[#] &)];

code = (StringJoin @
Riffle[("template<> double EvaluationContext::mass<" <> ToString[#] <> ">( " <>
If[TreeMasses`GetDimension[#] === 1, "void", "unsigned int index"] <> " ) const\n" <>
Riffle[("template<> double EvaluationContext::mass<" <> ToString[#] <> ">(" <>
If[TreeMasses`GetDimension[#] === 1, "", " unsigned int index "] <> ") const\n" <>
"{ return model.get_M" <> ParticleToCXXName[#] <>
If[TreeMasses`GetDimension[#] === 1, "()", "( index )"] <> "; }"
&) /@ particles, "\n\n"]);
Expand Down
30 changes: 15 additions & 15 deletions templates/g_muon_minus_2.cpp.in
Expand Up @@ -90,17 +90,17 @@ private:
std::memcpy(indices.data(), i, N * sizeof(unsigned int));
}
public:
const std::array<unsigned int, N> &operator*(void) const
const std::array<unsigned int, N> &operator*() const
{
return indices;
}

const std::array<unsigned int, N> *operator->( void ) const
const std::array<unsigned int, N> *operator->() const
{
return &indices;
}

IndexIterator &operator++(void)
IndexIterator &operator++()
{
for (unsigned int i = 0; i != N; i++) {
indices[i]++;
Expand Down Expand Up @@ -147,12 +147,12 @@ template<unsigned int N> struct IndexBounds {

typedef IndexIterator<N> const_iterator;

const_iterator begin(void) const
const_iterator begin() const
{
return const_iterator(*this, indexBegin);
}

const_iterator end(void) const
const_iterator end() const
{
return const_iterator(*this, indexEnd);
}
Expand All @@ -164,9 +164,9 @@ template<> struct IndexBounds<0> {

static const indices_type dummyIndex;

const_iterator begin(void) const
const_iterator begin() const
{ return &dummyIndex; }
const_iterator end(void) const
const_iterator end() const
{ return (begin()+1); }
};
IndexBounds<0>::indices_type IndexBounds<0>::dummyIndex = {};
Expand All @@ -188,11 +188,11 @@ struct EvaluationContext {
* @fn mass<P>
* @brief Returns the mass of a particle.
*/
template<class P> double mass(void) const;
template<class P> double mass() const;
template<class P> double mass(unsigned int) const;
};

template<class P> double EvaluationContext::mass(void) const
template<class P> double EvaluationContext::mass() const
{
return mass<typename anti<P>::type>();
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public:
* @fn value
* @brief Returns the value of the vertex.
*/
std::complex<double> value(void) const
std::complex<double> value() const
{
return val;
}
Expand All @@ -243,7 +243,7 @@ public:
* @fn isZero
* @brief Tests whether the value is numerically significant
*/
bool isZero(void) const
bool isZero() const
{
return (is_zero(val.real()) && is_zero(val.imag()));
}
Expand All @@ -265,7 +265,7 @@ public:
* @fn left
* @brief Returns the left component of the vertex.
*/
std::complex<double> left(void) const
std::complex<double> left() const
{
return value.first;
}
Expand All @@ -274,7 +274,7 @@ public:
* @fn right
* @brief Returns the left component of the vertex.
*/
std::complex<double> right(void) const
std::complex<double> right() const
{
return value.second;
}
Expand All @@ -283,7 +283,7 @@ public:
* @fn isZero
* @brief Tests whether the values are numerically significant
*/
bool isZero(void) const
bool isZero() const
{
return (is_zero(value.first.real()) && is_zero(value.first.imag()) &&
is_zero(value.second.real()) && is_zero(value.second.imag()));
Expand Down Expand Up @@ -323,7 +323,7 @@ public:
typedef typename index_bounds::indices_type indices_type;
typedef typename Base::vertex_type vertex_type;
public:
static const index_bounds &indexBounds(void)
static const index_bounds &indexBounds()
{
return indexB;
}
Expand Down

0 comments on commit 784f13a

Please sign in to comment.