Skip to content

Commit

Permalink
Merge pull request #5849 from MFraters/fix_gwb_clang_warnings
Browse files Browse the repository at this point in the history
Backport fix gwb clang flags.
  • Loading branch information
tjhei authored Jun 14, 2024
2 parents 12ff283 + 5890bf6 commit 6b9c60b
Show file tree
Hide file tree
Showing 41 changed files with 389 additions and 352 deletions.
32 changes: 16 additions & 16 deletions contrib/world_builder/include/world_builder/bounding_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace WorldBuilder
*
* @note The majority of this class is copied from the deal.II library.
*/
template <int spacedim>
template <unsigned int spacedim>
class BoundingBox
{
public:
Expand Down Expand Up @@ -270,7 +270,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline BoundingBox<spacedim>::BoundingBox(
const std::pair<Point<spacedim>, Point<spacedim>>
&boundary_points_)
Expand All @@ -286,7 +286,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
template <class Container>
inline BoundingBox<spacedim>::BoundingBox(const Container &points)
{
Expand Down Expand Up @@ -314,23 +314,23 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline std::pair<Point<spacedim>, Point<spacedim>> &BoundingBox<spacedim>::get_boundary_points()
{
return this->boundary_points;
}



template <int spacedim>
template <unsigned int spacedim>
inline const std::pair<Point<spacedim>, Point<spacedim>> &BoundingBox<spacedim>::get_boundary_points() const
{
return this->boundary_points;
}



template <int spacedim>
template <unsigned int spacedim>
inline bool
BoundingBox<spacedim>::
operator==(const BoundingBox<spacedim> &box) const
Expand All @@ -340,7 +340,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline bool
BoundingBox<spacedim>::
operator!=(const BoundingBox<spacedim> &box) const
Expand All @@ -350,7 +350,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline void
BoundingBox<spacedim>::extend(const double amount)
{
Expand All @@ -365,7 +365,7 @@ namespace WorldBuilder
}


template <int spacedim>
template <unsigned int spacedim>
inline
bool
BoundingBox<spacedim>::point_inside(const Point<spacedim> &point,
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace WorldBuilder

}

template <int spacedim>
template <unsigned int spacedim>
inline
bool
BoundingBox<spacedim>::point_inside_implementation(const Point<spacedim> &p,
Expand Down Expand Up @@ -426,7 +426,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
void
BoundingBox<spacedim>::merge_with(
Expand All @@ -445,7 +445,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
double
BoundingBox<spacedim>::volume() const
{
Expand All @@ -457,7 +457,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::lower_bound(const unsigned int direction) const
Expand All @@ -469,7 +469,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::upper_bound(const unsigned int direction) const
Expand All @@ -481,7 +481,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
Point<spacedim>
BoundingBox<spacedim>::center() const
{
Expand All @@ -494,7 +494,7 @@ namespace WorldBuilder



template <int spacedim>
template <unsigned int spacedim>
inline
double
BoundingBox<spacedim>::side_length(const unsigned int direction) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WorldBuilder
{
class World;
class Parameters;
template <int dim> class Point;
template <unsigned int dim> class Point;

/**
* This class is an interface for the specific plate tectonic feature classes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace WorldBuilder
ReferenceModelName reference_model_name;
const int plate_model_summation_number = 100; // for the plate model
bool apply_spline;
int spline_n_points;
unsigned int spline_n_points;
};
} // namespace Temperature
} // namespace SubductingPlateModels
Expand Down
3 changes: 2 additions & 1 deletion contrib/world_builder/include/world_builder/kd_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ namespace WorldBuilder
const double &operator[](const bool y_axis) const
{
WBAssert(std::fabs((y_axis ? y : x) - *(&x+y_axis)) < std::numeric_limits<double>::epsilon(),
"Internal error: y_axis=" << y_axis << ", x=" << x << ", y=" << y <<", *(&x+y_axis)=" << *(&x+y_axis) << ", ((bool)y_axis ? x : y) - *(&x+y_axis)=" << abs(((bool)y_axis ? x : y) - *(&x+y_axis)));
"Internal error: y_axis=" << y_axis << ", x=" << x << ", y=" << y <<", *(&x+y_axis)=" << *(&x+y_axis)
<< ", ((bool)y_axis ? x : y) - *(&x+y_axis)=" << fabs((y_axis ? x : y) - *(&x+y_axis)));
return *(&x+y_axis);
}
};
Expand Down
2 changes: 1 addition & 1 deletion contrib/world_builder/include/world_builder/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace WorldBuilder
namespace Types
{
class Interface;
template<int dim>
template<unsigned int dim>
class Point;
class Double;
class String;
Expand Down
4 changes: 2 additions & 2 deletions contrib/world_builder/include/world_builder/point.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace WorldBuilder
* implements several operations such as the computation of the l2 norm and the
* dot product.
*/
template<int dim>
template<unsigned int dim>
class Point
{
public:
Expand Down Expand Up @@ -463,7 +463,7 @@ namespace WorldBuilder
return (point[0] * point[0]) + (point[1] * point[1]) + (point[2] * point[2]);
}

template<int dim>
template<unsigned int dim>
inline
Point<dim> operator*(const double scalar, const Point<dim> &point)
{
Expand Down
4 changes: 2 additions & 2 deletions contrib/world_builder/include/world_builder/types/int.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ namespace WorldBuilder
const std::string &name,
const std::string &documentation) const override final;

unsigned int value {0};
unsigned int default_value;
int value {0};
int default_value;

protected:
/**
Expand Down
4 changes: 2 additions & 2 deletions contrib/world_builder/include/world_builder/types/point.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace WorldBuilder
* the returned temperature or composition of the temperature and composition
* functions of this class will be.
*/
template <int dim>
template <unsigned int dim>
class Point final: public Interface
{
public:
Expand Down Expand Up @@ -124,7 +124,7 @@ namespace WorldBuilder

};

template<int dim>
template<unsigned int dim>
WorldBuilder::Point<dim> operator*(const double scalar, const Point<dim> &point);
} // namespace Types
} // namespace WorldBuilder
Expand Down
Loading

0 comments on commit 6b9c60b

Please sign in to comment.