All: Reformat according to new standard

This commit is contained in:
pre-commit-ci[bot]
2025-11-11 13:49:01 +01:00
committed by Kacper Donat
parent ef997f2259
commit 9fe130cd73
2390 changed files with 154630 additions and 115818 deletions

View File

@@ -46,11 +46,11 @@
// suppress annoying warnings from generated source files
#ifdef _MSC_VER
#pragma warning(disable : 4003)
#pragma warning(disable : 4018)
#pragma warning(disable : 4065)
#pragma warning(disable : 4273)
#pragma warning(disable : 4335) // disable MAC file format warning on VC
# pragma warning(disable : 4003)
# pragma warning(disable : 4018)
# pragma warning(disable : 4065)
# pragma warning(disable : 4273)
# pragma warning(disable : 4335) // disable MAC file format warning on VC
#endif
using Base::Quantity;
@@ -130,7 +130,8 @@ bool Quantity::operator<(const Quantity& that) const
{
if (myUnit != that.myUnit) {
throw Base::UnitsMismatchError(
"Quantity::operator <(): quantities need to have same unit to compare");
"Quantity::operator <(): quantities need to have same unit to compare"
);
}
return (myValue < that.myValue);
@@ -140,7 +141,8 @@ bool Quantity::operator>(const Quantity& that) const
{
if (myUnit != that.myUnit) {
throw Base::UnitsMismatchError(
"Quantity::operator >(): quantities need to have same unit to compare");
"Quantity::operator >(): quantities need to have same unit to compare"
);
}
return (myValue > that.myValue);
@@ -150,7 +152,8 @@ bool Quantity::operator<=(const Quantity& that) const
{
if (myUnit != that.myUnit) {
throw Base::UnitsMismatchError(
"Quantity::operator <=(): quantities need to have same unit to compare");
"Quantity::operator <=(): quantities need to have same unit to compare"
);
}
return (myValue <= that.myValue);
@@ -160,7 +163,8 @@ bool Quantity::operator>=(const Quantity& that) const
{
if (myUnit != that.myUnit) {
throw Base::UnitsMismatchError(
"Quantity::operator >=(): quantities need to have same unit to compare");
"Quantity::operator >=(): quantities need to have same unit to compare"
);
}
return (myValue >= that.myValue);
@@ -192,8 +196,10 @@ Quantity Quantity::pow(const Quantity& other) const
throw Base::UnitsMismatchError("Quantity::pow(): exponent must not have a unit");
}
return Quantity(std::pow(myValue, other.myValue),
myUnit.pow(static_cast<signed char>(other.myValue)));
return Quantity(
std::pow(myValue, other.myValue),
myUnit.pow(static_cast<signed char>(other.myValue))
);
}
Quantity Quantity::pow(double exp) const
@@ -282,8 +288,7 @@ std::string Quantity::getUserString(double& factor, std::string& unitString) con
return Base::UnitsApi::schemaTranslate(*this, factor, unitString);
}
std::string
Quantity::getUserString(UnitsSchema* schema, double& factor, std::string& unitString) const
std::string Quantity::getUserString(UnitsSchema* schema, double& factor, std::string& unitString) const
{
return schema->translate(*this, factor, unitString);
}
@@ -512,8 +517,8 @@ double num_change(char* yytext, char dez_delim, char grp_delim)
// NOLINTEND
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wmissing-noreturn"
#endif
// error func
@@ -523,18 +528,18 @@ void Quantity_yyerror(const char* errorinfo)
}
#if defined(__clang__)
#pragma clang diagnostic pop
# pragma clang diagnostic pop
#endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-compare"
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-compare"
# pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsign-compare"
# pragma GCC diagnostic ignored "-Wfree-nonheap-object"
#endif
namespace QuantityParser
@@ -553,7 +558,7 @@ int QuantityLexer();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Scanner, defined in Quantity.l
// NOLINTNEXTLINE
#include "Quantity.lex.c"
# include "Quantity.lex.c"
#endif // DOXYGEN_SHOULD_SKIP_THIS
class StringBufferCleaner
@@ -580,16 +585,15 @@ private:
} // namespace QuantityParser
#if defined(__clang__)
#pragma clang diagnostic pop
# pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
# pragma GCC diagnostic pop
#endif
Quantity Quantity::parse(const std::string& string)
{
// parse from buffer
QuantityParser::YY_BUFFER_STATE my_string_buffer =
QuantityParser::yy_scan_string(string.c_str());
QuantityParser::YY_BUFFER_STATE my_string_buffer = QuantityParser::yy_scan_string(string.c_str());
QuantityParser::StringBufferCleaner cleaner(my_string_buffer);
// set the global return variables
QuantResult = Quantity(std::numeric_limits<double>::min());