Commit 4ede6d7a authored by gsell's avatar gsell
Browse files

cleanup: fix GCC 9.2 warnings and some cleanup

parent 269b7b0d
......@@ -46,7 +46,7 @@ add_definitions (-DNOCTAssert)
add_compile_options (-Wall)
add_compile_options (-Wunused)
add_compile_options (-Wextra)
#add_compile_options (-Werror)
add_compile_options (-Werror)
add_compile_options (-funroll-loops)
add_compile_options (-fstrict-aliasing)
......@@ -67,9 +67,7 @@ if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
endif ()
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options (-Wsign-compare)
add_compile_options (-Wunused-variable)
add_compile_options (-Warray-bounds)
add_compile_options (-Warray-bounds-pointer-arithmetic)
# Increase template depth for boost
add_compile_options (-ftemplate-depth=1024)
# get rid of linking warning with boost. Looks like that boost
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
* This program was prepared by PSI.
* All rights in the program are reserved by PSI.
* Neither PSI nor the author(s)
* makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software
*
* Visit www.amas.web.psi for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
//////////////////////////////////////////////////////////////////////
......@@ -113,7 +94,7 @@ TryCompressLHS(LField<T,Dim>& lf, A& rhs, Op op, const NDIndex<Dim>& domain)
// is for assignment.
if (c1 && c3 && c4)
{
T tmpval;
T tmpval = T(0);
PETE_apply(op, tmpval, for_each(rhs, EvalFunctor_0()));
if (*lf.begin() == tmpval)
{
......@@ -676,9 +657,10 @@ assign(const BareField<T1,Dim>& ca, RHS b, OP op, ExprTag<true>)
//INCIPPLSTAT(incBFEqualsExpression);
}
/***************************************************************************
* $RCSfile: Assign.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
* IPPL_VERSION_ID: $Id: Assign.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -2795,8 +2795,6 @@ void ExtrapolateFace<T,D,M,C>::apply( Field<T,D,M,C>& A )
}
//#pragma GCC push_options
//#pragma GCC optimize "no-tree-vrp"
template<class T, unsigned D, class M, class C>
inline void
ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src,
......@@ -2862,7 +2860,6 @@ ExtrapolateFaceBCApply2(const NDIndex<D> &dest, const NDIndex<D> &src,
(ef.getOffset(),ef.getSlope(),ef.getComponent())).apply();
}
}
//#pragma GCC pop_options
//-----------------------------------------------------------------------------
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
......@@ -9,18 +8,6 @@
* makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software
*
* Visit www.amas.web.psi for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
// include files
......@@ -54,12 +41,10 @@ public:
for (d=3; d<Dim; ++d)
{
Lhs.step(d);
// #pragma inline here
for_each(Rhs,StepFunctor(d),PETE_NullCombiner());
if ( ! Lhs.done(d) )
break;
Lhs.rewind(d);
// #pragma inline here
for_each(Rhs,RewindFunctor(d),PETE_NullCombiner());
}
} while (d<Dim);
......@@ -129,14 +114,13 @@ template<unsigned Dim, class LHS, class RHS, class OP>
void BrickExpression<Dim,LHS,RHS,OP>::apply()
{
// #pragma inline here
BrickExpLoop<LHS,RHS,OP,Dim>::apply(Lhs,Rhs,Op);
}
/***************************************************************************
* $RCSfile: BrickExpression.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
* IPPL_VERSION_ID: $Id: BrickExpression.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef FIELD_H
......@@ -67,6 +63,7 @@ public:
Field(Layout_t &,const GuardCellSizes<Dim>&,const BConds<T,Dim,M,C>&);
Field(Layout_t &,const BConds<T,Dim,M,C>&,const GuardCellSizes<Dim>&);
Field(FieldSpec<T,Dim,M,C>&);
constexpr Field(Field<T,Dim,M,C>&) = default;
// Constructors including a Mesh object as argument:
Field(Mesh_t&, Layout_t &);
......@@ -187,10 +184,12 @@ private:
#include "Field/Field.hpp"
#endif // FIELD_H
#endif
/***************************************************************************
* $RCSfile: Field.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
* IPPL_VERSION_ID: $Id: Field.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -31,7 +31,7 @@ public:
GuardCellSizes(unsigned *s);
GuardCellSizes(unsigned l, unsigned r);
GuardCellSizes(unsigned *l, unsigned *r);
constexpr GuardCellSizes<Dim>(const GuardCellSizes<Dim>&) = default;
GuardCellSizes<Dim>& operator=(const GuardCellSizes<Dim>& gc)
{
for (unsigned d=0; d<Dim; ++d) {
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef INDEXED_BARE_FIELD_H
......@@ -207,6 +203,7 @@ public:
enum { Dim_u = Dim };
typedef IndexedBareFieldIterator<T,Dim> iterator;
constexpr IndexedBareField (const IndexedBareField<T, Dim, Brackets>&) = default;
IndexedBareField<T,Dim,Brackets+1> operator[](const Index& idx)
{
CTAssert(Brackets<Dim);
......@@ -340,8 +337,10 @@ std::ostream& operator<<(std::ostream& out, const IndexedBareField<T,Dim,Bracket
#endif // INDEXED_BARE_FIELD_H
/***************************************************************************
* $RCSfile: IndexedBareField.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
* IPPL_VERSION_ID: $Id: IndexedBareField.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
set (_SRCS
FieldLayoutUser.cpp
VRB.cpp
)
......
......@@ -3,9 +3,6 @@
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef FIELD_LAYOUT_USER_H
......@@ -31,10 +28,10 @@ class FieldLayoutUser : public User {
public:
// constructor - the base class selects a unique ID value
FieldLayoutUser();
FieldLayoutUser() {};
// destructor, nothing to do here
virtual ~FieldLayoutUser();
virtual ~FieldLayoutUser() {};
//
// virtual functions for FieldLayoutUser's
......@@ -46,8 +43,10 @@ public:
#endif // FIELD_LAYOUT_USER_H
/***************************************************************************
* $RCSfile: FieldLayoutUser.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:27 $
* IPPL_VERSION_ID: $Id: FieldLayoutUser.h,v 1.1.1.1 2003/01/23 07:40:27 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef TAG_MAKER_H
......@@ -107,3 +103,11 @@ private:
};
#endif // TAG_MAKER_H
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -715,6 +715,9 @@ public:
T const * operator->() const { return getP(); }
ParticleAttribConstIterator<T>& operator=(const ParticleAttribConstIterator<T>&) = default;
ParticleAttribConstIterator<T>& operator++(void) {
++curr;
return *this;
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef SUB_BARE_FIELD_H
......@@ -71,6 +67,8 @@ public:
//# public enumerations
enum { Dim_u = Dim };
constexpr SubBareField(const SubBareField<T, Dim, S>&) = default;
// Return the beginning and end iterators for this class.
iterator begin() const;
iterator end() const;
......@@ -237,10 +235,12 @@ std::ostream& operator<<(std::ostream& o, const SubBareField<T,Dim,S>& s) {
#include "SubField/SubBareField.hpp"
#endif // SUB_BARE_FIELD_H
#endif
/***************************************************************************
* $RCSfile: SubBareField.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
* IPPL_VERSION_ID: $Id: SubBareField.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef SUB_FIELD_ASSIGN_H
......@@ -73,8 +69,10 @@ SUB_ASSIGNMENT_OPERATORS(maxeq,OpMaxAssign)
#endif // SUB_FIELD_ASSIGN_H
/***************************************************************************
* $RCSfile: SubFieldAssign.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
* IPPL_VERSION_ID: $Id: SubFieldAssign.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef PASSERT_H
......@@ -59,15 +55,9 @@ public:
assertion( const assertion& a );
~assertion() throw() { delete[] msg; }
assertion& operator=( const assertion& a );
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
const char* what() { return msg; }
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
using std::runtime_error::what;
virtual const char* what() { return msg; };
};
//---------------------------------------------------------------------------//
......@@ -143,8 +133,10 @@ void insist( const char *cond, const char *msg, const char *file, int line );
#endif // PASSERT_H
/***************************************************************************
* $RCSfile: PAssert.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
* IPPL_VERSION_ID: $Id: PAssert.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
***************************************************************************/
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
// -*- C++ -*-
/**************************************************************************************************************************************
/******************************************************************************
*
* The IPPL Framework
*
......@@ -14,7 +13,7 @@
* epsilon is the softening parameter, printSteps=10 prints every tenth step
*
*
*************************************************************************************************************************************/
******************************************************************************/
#include "Ippl.h"
#include <cassert>
#include <string>
......@@ -473,10 +472,6 @@ class ChargedParticles : public IpplParticleBase<PL> {
H5f_m = H5OpenFile(fn.c_str(), H5_O_WRONLY, props);
}
inline double getEFDMag(int x, int y, int z) {
return eg_m[x][y][z].get();
}
const Vector_t get_hr() { return hr_m; }
......@@ -784,3 +779,11 @@ int main(int argc, char *argv[]){
return 0;
}
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -23,7 +23,6 @@ int main(int argc, char *argv[]) {
const unsigned D=3U;
double hightail;
unsigned int d;
int tag = Ippl::Comm->next_tag(tag);
unsigned ngrid[D]; // grid sizes sizes
unsigned int iters = 100;
......
#ifndef OPAL_Expressions_HH
#define OPAL_Expressions_HH 1
// ------------------------------------------------------------------------
// $RCSfile: Expressions.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Namespace Expressions
// This namespace contains the representations for all OPAL expressions
......@@ -43,12 +33,16 @@
// Declared functions:
// A collection of functions implementing a recursive descent parser.
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:34 $
// $Author: Andreas Adelmann $
// Copyright (c) 2008-2020
// Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved.
//
// OPAL is licensed under GNU GPL version 3.
//
// ------------------------------------------------------------------------
#ifndef OPAL_Expressions_HH
#define OPAL_Expressions_HH 1
#include "MemoryManagement/OwnPtr.h"
#include "Parser/Token.h"
......@@ -64,8 +58,6 @@ class Statement;
class Table;
class TableRowRep;
// Begin namespace Expression.
// ========================================================================
/// Representation objects and parsers for attribute expressions.
......@@ -124,6 +116,7 @@ namespace Expressions {
PtrToScalar();
PtrToScalar(const PtrToScalar &rhs);
~PtrToScalar();
PtrToScalar& operator=(const PtrToScalar&) = default;
};
......@@ -194,6 +187,7 @@ namespace Expressions {
PtrToArray();
PtrToArray(const PtrToArray &rhs);
~PtrToArray();
PtrToArray& operator=(const PtrToArray<T>&) = default;
};
......@@ -399,3 +393,11 @@ namespace Expressions {
};
#endif // OPAL_Expressions_HH
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
// c-basic-offset: 4
// indent-tabs-mode: nil
// require-final-newline: nil
// End:
......@@ -230,7 +230,7 @@ bool odeint(
}
if((x + h - x2) * (x + h - x1) > 0.0)
h = x2 - x;
double hdid, hnext;
double hdid = 0.0, hnext = 0.0;
rkqs(y, dydx, nvar, x, h, eps, yscal, hdid, hnext, derivs);
if(hdid == h)
++nok;
......
......@@ -23,6 +23,7 @@ public:
void invert();
CoordinateSystemTrafo inverted() const;
CoordinateSystemTrafo& operator=(const CoordinateSystemTrafo& right) = default;
CoordinateSystemTrafo operator*(const CoordinateSystemTrafo &right) const;
void operator*=(const CoordinateSystemTrafo &right);
......
......@@ -18,6 +18,7 @@ public:
Quaternion operator*(const double &) const;
Quaternion operator*(const Quaternion &) const;
Quaternion& operator=(const Quaternion &) = default;
Quaternion& operator*=(const Quaternion &);
Quaternion operator/(const double &) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment