Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP TEST] Astyle 3.1 #421

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int main(int argc, char **argv)
}

// set properties
std::vector<std::array<unsigned ,3>> properties;
std::vector<std::array<unsigned,3>> properties;
properties.push_back({{1,0,0}}); // temperature

for (size_t c = 0; c < compositions; ++c)
Expand Down
26 changes: 13 additions & 13 deletions include/doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ namespace doctest
String &operator+=(const String &other);

String(String &&other);
String &operator=(String&& other);
String &operator=(String &&other);

char operator[](unsigned i) const;
char &operator[](unsigned i);
Expand Down Expand Up @@ -878,7 +878,7 @@ namespace doctest
{
typedef T type;
};
template<class T> struct remove_reference<T&&>
template<class T> struct remove_reference<T &&>
{
typedef T type;
};
Expand All @@ -902,7 +902,7 @@ namespace doctest
{
const static bool value=false;
};
template<class T> struct is_rvalue_reference<T&&>
template<class T> struct is_rvalue_reference<T &&>
{
const static bool value=true;
};
Expand All @@ -917,7 +917,7 @@ namespace doctest
inline T &&forward(typename remove_reference<T>::type &&t) DOCTEST_NOEXCEPT
{
static_assert(!is_lvalue_reference<T>::value,
"Can not forward an rvalue as an lvalue.");
"Can not forward an rvalue as an lvalue.");
return static_cast<T&&>(t);
}

Expand Down Expand Up @@ -947,7 +947,7 @@ namespace doctest

template <typename T>
struct deferred_false
// cppcheck-suppress unusedStructMember
// cppcheck-suppress unusedStructMember
{
static const bool value = false;
};
Expand Down Expand Up @@ -3904,14 +3904,14 @@ namespace doctest
return *this;
}

String::String(String&& other)
String::String(String &&other)
{
memcpy(buf, other.buf, len);
other.buf[0] = '\0';
other.setLast();
}

String &String::operator=(String&& other)
String &String::operator=(String &&other)
{
if (this != &other)
{
Expand Down Expand Up @@ -5607,8 +5607,8 @@ namespace doctest
public:
ScopedElement( XmlWriter *writer );

ScopedElement( ScopedElement&& other ) DOCTEST_NOEXCEPT;
ScopedElement &operator=( ScopedElement&& other ) DOCTEST_NOEXCEPT;
ScopedElement( ScopedElement &&other ) DOCTEST_NOEXCEPT;
ScopedElement &operator=( ScopedElement &&other ) DOCTEST_NOEXCEPT;

~ScopedElement();

Expand Down Expand Up @@ -5852,13 +5852,13 @@ namespace doctest
: m_writer( writer )
{}

XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) DOCTEST_NOEXCEPT
XmlWriter::ScopedElement::ScopedElement( ScopedElement &&other ) DOCTEST_NOEXCEPT
:
m_writer( other.m_writer )
{
other.m_writer = nullptr;
}
XmlWriter::ScopedElement &XmlWriter::ScopedElement::operator=( ScopedElement&& other ) DOCTEST_NOEXCEPT
XmlWriter::ScopedElement &XmlWriter::ScopedElement::operator=( ScopedElement &&other ) DOCTEST_NOEXCEPT
{
if ( m_writer )
{
Expand Down Expand Up @@ -7379,14 +7379,14 @@ namespace doctest
parseFlag(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname)) \
p->var = true; \
else if(withDefaults) \
p->var = default
p->var = default

#define DOCTEST_PARSE_INT_OPTION(name, sname, var, default) \
if(parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name "=", option_int, intRes) || \
parseIntOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX sname "=", option_int, intRes)) \
p->var = intRes; \
else if(withDefaults) \
p->var = default
p->var = default

#define DOCTEST_PARSE_STR_OPTION(name, sname, var, default) \
if(parseOption(argc, argv, DOCTEST_CONFIG_OPTIONS_PREFIX name "=", &strRes, default) || \
Expand Down
6 changes: 3 additions & 3 deletions include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ class GenericValue

//! Move assignment from a GenericDocument is not permitted.
template <typename StackAllocator>
GenericValue &operator=(GenericDocument<Encoding,Allocator,StackAllocator>&& rhs);
GenericValue &operator=(GenericDocument<Encoding,Allocator,StackAllocator> &&rhs);
#endif

public:
Expand Down Expand Up @@ -1164,7 +1164,7 @@ class GenericValue

#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
//! Move assignment in C++11
GenericValue &operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT
GenericValue &operator=(GenericValue &&rhs) RAPIDJSON_NOEXCEPT
{
return *this = rhs.Move();
}
Expand Down Expand Up @@ -2910,7 +2910,7 @@ class GenericDocument : public GenericValue<Encoding, Allocator>

#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
//! Move assignment in C++11
GenericDocument &operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT
GenericDocument &operator=(GenericDocument &&rhs) RAPIDJSON_NOEXCEPT
{
// The cast to ValueType is necessary here, because otherwise it would
// attempt to call GenericValue's templated assignment operator.
Expand Down
18 changes: 9 additions & 9 deletions include/rapidjson/internal/diyfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ namespace internal
static const int16_t kCachedPowers_E[] =
{
-1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,
-954, -927, -901, -874, -847, -821, -794, -768, -741, -715,
-688, -661, -635, -608, -582, -555, -529, -502, -475, -449,
-422, -396, -369, -343, -316, -289, -263, -236, -210, -183,
-157, -130, -103, -77, -50, -24, 3, 30, 56, 83,
109, 136, 162, 189, 216, 242, 269, 295, 322, 348,
375, 402, 428, 455, 481, 508, 534, 561, 588, 614,
641, 667, 694, 720, 747, 774, 800, 827, 853, 880,
907, 933, 960, 986, 1013, 1039, 1066
};
-954, -927, -901, -874, -847, -821, -794, -768, -741, -715,
-688, -661, -635, -608, -582, -555, -529, -502, -475, -449,
-422, -396, -369, -343, -316, -289, -263, -236, -210, -183,
-157, -130, -103, -77, -50, -24, 3, 30, 56, 83,
109, 136, 162, 189, 216, 242, 269, 295, 322, 348,
375, 402, 428, 455, 481, 508, 534, 561, 588, 614,
641, 667, 694, 720, 747, 774, 800, 827, 853, 880,
907, 933, 960, 986, 1013, 1039, 1066
};
RAPIDJSON_ASSERT(index < 87);
return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);
}
Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/internal/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace internal
}

#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
Stack &operator=(Stack&& rhs)
Stack &operator=(Stack &&rhs)
{
if (&rhs != this)
{
Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ class GenericSchemaValidator :
if (count > 0)
{
CurrentContext().objectPatternValidatorType = patternValidatorType;
ISchemaValidator ** &va = CurrentContext().patternPropertiesValidators;
ISchemaValidator** &va = CurrentContext().patternPropertiesValidators;
SizeType &validatorCount = CurrentContext().patternPropertiesValidatorCount;
va = static_cast<ISchemaValidator **>(MallocState(sizeof(ISchemaValidator *) * count));
for (SizeType i = 0; i < count; i++)
Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/stringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GenericStringBuffer

#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
GenericStringBuffer(GenericStringBuffer &&rhs) : stack_(std::move(rhs.stack_)) {}
GenericStringBuffer &operator=(GenericStringBuffer&& rhs)
GenericStringBuffer &operator=(GenericStringBuffer &&rhs)
{
if (&rhs != this)
stack_ = std::move(rhs.stack_);
Expand Down
28 changes: 14 additions & 14 deletions include/world_builder/bounding_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ namespace WorldBuilder
:
boundary_points ({{
-std::numeric_limits<double>::max(),
-std::numeric_limits<double>::max(),
cartesian
},
-std::numeric_limits<double>::max(),
cartesian
},
{
+std::numeric_limits<double>::max(),
+std::numeric_limits<double>::max(),
cartesian
}
+std::numeric_limits<double>::max(),
cartesian
}
})
{}

Expand All @@ -255,16 +255,16 @@ namespace WorldBuilder
:
boundary_points ({{
-std::numeric_limits<double>::max(),
-std::numeric_limits<double>::max(),
-std::numeric_limits<double>::max(),
cartesian
},
-std::numeric_limits<double>::max(),
-std::numeric_limits<double>::max(),
cartesian
},
{
+std::numeric_limits<double>::max(),
+std::numeric_limits<double>::max(),
+std::numeric_limits<double>::max(),
cartesian
}
+std::numeric_limits<double>::max(),
+std::numeric_limits<double>::max(),
cartesian
}
})
{}

Expand Down
4 changes: 2 additions & 2 deletions source/features/fault.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ namespace WorldBuilder

const double buffer_around_fault_spherical = 2 * const_pi * buffer_around_fault_cartesian * starting_radius_inv;

spherical_bounding_box.first = {(min_along_x - buffer_around_fault_spherical * min_lat_cos_inv) ,
spherical_bounding_box.first = {(min_along_x - buffer_around_fault_spherical * min_lat_cos_inv),
(min_along_y - buffer_around_fault_spherical), spherical
} ;

spherical_bounding_box.second = {(max_along_x + buffer_around_fault_spherical * max_lat_cos_inv) ,
spherical_bounding_box.second = {(max_along_x + buffer_around_fault_spherical * max_lat_cos_inv),
(max_along_y + buffer_around_fault_spherical), spherical
};
}
Expand Down
4 changes: 2 additions & 2 deletions source/features/subducting_plate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ namespace WorldBuilder

const double buffer_around_slab_spherical = 2 * const_pi * buffer_around_slab_cartesian * starting_radius_inv;

spherical_bounding_box.first = {(min_along_x - buffer_around_slab_spherical * min_lat_cos_inv) ,
spherical_bounding_box.first = {(min_along_x - buffer_around_slab_spherical * min_lat_cos_inv),
(min_along_y - buffer_around_slab_spherical), spherical
} ;

spherical_bounding_box.second = {(max_along_x + buffer_around_slab_spherical * max_lat_cos_inv) ,
spherical_bounding_box.second = {(max_along_x + buffer_around_slab_spherical * max_lat_cos_inv),
(max_along_y + buffer_around_slab_spherical), spherical
};
}
Expand Down
2 changes: 1 addition & 1 deletion source/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace WorldBuilder
// relaxing sytax by allowing comments () for now, maybe also allow trailing commas and (kParseTrailingCommasFlag) and nan's, inf etc (kParseNanAndInfFlag)?
//WBAssertThrow(!parameters.ParseStream<kParseCommentsFlag>(isw).HasParseError(), "Parsing erros world builder file");

WBAssertThrowExc(!(parameters.ParseStream<kParseCommentsFlag | kParseNanAndInfFlag>(isw).HasParseError()), std::ifstream json_input_stream_error(filename.c_str()); ,
WBAssertThrowExc(!(parameters.ParseStream<kParseCommentsFlag | kParseNanAndInfFlag>(isw).HasParseError()), std::ifstream json_input_stream_error(filename.c_str());,
"Parsing errors world builder file: Error(offset " << static_cast<unsigned>(parameters.GetErrorOffset())
<< "): " << GetParseError_En(parameters.GetParseError()) << std::endl << std::endl
<< " Showing 50 chars before and after: "
Expand Down
2 changes: 1 addition & 1 deletion source/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ namespace WorldBuilder


WBAssert(std::fabs((end_segment-center_circle).norm() - std::fabs(radius_angle_circle))
< 1e-8 * std::fabs((end_segment-center_circle).norm() + std::fabs(radius_angle_circle)) ,
< 1e-8 * std::fabs((end_segment-center_circle).norm() + std::fabs(radius_angle_circle)),
"Internal error: The center of the circle is not a radius away from the end point. " << std::endl
<< "The center is located at " << center_circle[0] << ':' << center_circle[1] << std::endl
<< "The end point is located at " << end_segment[0] << ':' << end_segment[1] << std::endl
Expand Down
20 changes: 10 additions & 10 deletions tests/unit_tests/unit_test_world_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1273,13 +1273,13 @@ TEST_CASE("WorldBuilder Features: Continental Plate")


std::vector<std::string> approvals;
for (auto&& value : approval_tests)
for (auto &&value : approval_tests)
{
std::stringstream s;
s << value;
approvals.emplace_back(s.str());
}
for (auto&& value : approval_tests_grains)
for (auto &&value : approval_tests_grains)
{
std::stringstream s;
s << value;
Expand Down Expand Up @@ -1518,13 +1518,13 @@ TEST_CASE("WorldBuilder Features: Mantle layer")
approval_tests.emplace_back(world1.composition(position, 260e3+350e3, 9));

std::vector<std::string> approvals;
for (auto&& value : approval_tests)
for (auto &&value : approval_tests)
{
std::stringstream s;
s << value;
approvals.emplace_back(s.str());
}
for (auto&& value : approval_tests_grains)
for (auto &&value : approval_tests_grains)
{
std::stringstream s;
s << value;
Expand Down Expand Up @@ -1905,13 +1905,13 @@ TEST_CASE("WorldBuilder Features: Oceanic Plate")
approval_tests.emplace_back(world2.temperature(position, 260e3));

std::vector<std::string> approvals;
for (auto&& value : approval_tests)
for (auto &&value : approval_tests)
{
std::stringstream s;
s << value;
approvals.emplace_back(s.str());
}
for (auto&& value : approval_tests_grains)
for (auto &&value : approval_tests_grains)
{
std::stringstream s;
s << value;
Expand Down Expand Up @@ -2333,13 +2333,13 @@ TEST_CASE("WorldBuilder Features: Subducting Plate")


std::vector<std::string> approvals;
for (auto&& value : approval_tests)
for (auto &&value : approval_tests)
{
std::stringstream s;
s << value;
approvals.emplace_back(s.str());
}
for (auto&& value : approval_tests_grains)
for (auto &&value : approval_tests_grains)
{
std::stringstream s;
s << value;
Expand Down Expand Up @@ -2943,13 +2943,13 @@ TEST_CASE("WorldBuilder Features: Fault")
approval_tests.emplace_back(world4.composition(position, 100e3, 0));

std::vector<std::string> approvals;
for (auto&& value : approval_tests)
for (auto &&value : approval_tests)
{
std::stringstream s;
s << value;
approvals.emplace_back(s.str());
}
for (auto&& value : approval_tests_grains)
for (auto &&value : approval_tests_grains)
{
std::stringstream s;
s << value << " ";
Expand Down
2 changes: 1 addition & 1 deletion visualization/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ int main(int argc, char **argv)
std::cout << "[5/6] Preparing to write the paraview file: stage 5 of 5, computing the properties \r";
std::cout.flush();

std::vector<std::array<unsigned ,3>> properties;
std::vector<std::array<unsigned,3>> properties;
properties.push_back({{1,0,0}}); // temperature

for (size_t c = 0; c < compositions; ++c)
Expand Down