Skip to content

Commit

Permalink
Merge pull request #306 from ckormanyos/update_runners
Browse files Browse the repository at this point in the history
Fix #305 via update runners
  • Loading branch information
ckormanyos authored Oct 12, 2024
2 parents 77a19b4 + cafbbb4 commit fd77604
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 71 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Checks: >
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
User: john
CheckOptions:
Expand Down
4 changes: 2 additions & 2 deletions .gcov/make/make_gcov_01_generic.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2023.
# Copyright Christopher Kormanyos 2022 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -65,7 +65,7 @@ gcov: $(PATH_BIN)/wide_decimal.exe
@$(GNUECHO)
@$(GNUECHO) +++ running lcov
@$(LCOV) $(LCOV_BRANCH) -c --directory obj --output-file coverage_unfiltered.info
@$(LCOV) $(LCOV_BRANCH) --remove coverage_unfiltered.info --output-file coverage.info $(LCOV_REMOVES)
@$(LCOV) $(LCOV_BRANCH) --ignore-errors unused --remove coverage_unfiltered.info $(LCOV_REMOVES) --output-file coverage.info
@$(GNUECHO)
@$(GNUECHO) +++ running genhtml
@$(GENHTML) coverage.info $(LCOV_BRANCH) --demangle-cpp --output-directory $(PATH_BIN)/report
Expand Down
8 changes: 4 additions & 4 deletions .gcov/make/make_gcov_03_flags.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ endif

CXXFLAGS = -march=native \
-mtune=native \
-O1 \
-O2 \
-Wall \
-Wextra \
-Wconversion \
Expand Down Expand Up @@ -76,6 +76,6 @@ LCOV_BRANCH := --rc lcov_branch_coverage=1
endif

LCOV_REMOVES = '/usr/*' \
'*/boost/*' \
'*/mcal_lcd/*' \
'*/util/*'
'*boost/*' \
'*mcal_lcd/*' \
'*util/*'
6 changes: 3 additions & 3 deletions .github/workflows/wide_decimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ jobs:
echo "make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
echo
make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo "make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo "make tidy -f make_tidy_01_generic.gmk --jobs=12 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
make tidy -f make_tidy_01_generic.gmk --jobs=12 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo
echo "verify empty word count of ./tmp/all.tidy_txt"
wc ./tmp/all.tidy_txt | grep '0 0 0'
Expand Down Expand Up @@ -482,7 +482,7 @@ jobs:
git submodule update --init libs/multiprecision
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
toolset: 14.4
- name: bootstrap-boost
working-directory: ${{ runner.workspace }}/boost-root
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wide_decimal_codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ jobs:
echo
make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo
echo "make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
echo "make gcov -f make_gcov_01_generic.gmk --jobs=12 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
echo
make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
make gcov -f make_gcov_01_generic.gmk --jobs=12 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo
echo "return to wide-decimal root directory"
cd ../..
Expand Down
16 changes: 14 additions & 2 deletions .tidy/make/make_tidy_03_flags.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2023.
# Copyright Christopher Kormanyos 2022 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -41,8 +41,20 @@ C_INCLUDES :=$(addprefix -I,$(C_INCLUDES))


TIDY_CHECKS = "*, \
-portability-simd-*, \
-cert-dcl58-cpp, \
-cppcoreguidelines-rvalue-reference-param-not-moved, \
-cppcoreguidelines-avoid-do-while, \
-modernize-type-traits, \
-modernize-use-constraints, \
-misc-header-include-cycle, \
-misc-include-cleaner, \
-misc-const-correctness, \
-performance-avoid-endl, \
-cppcoreguidelines-avoid-magic-numbers, \
-readability-avoid-nested-conditional-operator, \
-readability-identifier-length, \
-readability-redundant-casting, \
-readability-redundant-inline-specifier, \
-altera-struct-pack-align, \
-altera-unroll-loops, \
-fuchsia-*, \
Expand Down
2 changes: 1 addition & 1 deletion examples/example007_catalan_series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace example007_catalan
template<typename FloatingPointType>
auto pi() -> FloatingPointType
{
return static_cast<FloatingPointType>(3.1415926535897932384626433832795029L); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
return static_cast<FloatingPointType>(3.1415926535897932384626433832795029L); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,modernize-use-std-numbers)
}

template<>
Expand Down
2 changes: 1 addition & 1 deletion examples/example008_bernoulli_tgamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace example008_bernoulli
template<typename FloatingPointType>
auto pi() -> FloatingPointType
{
return static_cast<FloatingPointType>(3.1415926535897932384626433832795029L); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
return static_cast<FloatingPointType>(3.1415926535897932384626433832795029L); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,modernize-use-std-numbers)
}

template<>
Expand Down
2 changes: 1 addition & 1 deletion examples/example010_hypergeometric_2f1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace example010_hypergeometric
B[2U] = my_one + ((ABZ2 / CT1) * (my_one + ABZ1 / ((-T(6U)) + (CT1 * 3U)))); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
A[2U] = B[2U] - ((ABZ / CP) * (my_one + ((ABZ2 - ABZ1) / CT1)));

SABZ /= 4U;
SABZ /= 4U; // LCOV_EXCL_LINE

const T Z2(Z / 2U); // NOLINT(readability-identifier-naming)

Expand Down
59 changes: 34 additions & 25 deletions math/wide_decimal/decwide_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
// In particular, support for NaN is already being
// partially used through the specialization of limits.
// When starting, maybe begin with FP-class NaN.
enum class fpclass_type
enum class fpclass_type // NOLINT(performance-enum-size)
{
decwide_t_finite
};
Expand Down Expand Up @@ -993,7 +993,7 @@
else
{
std::copy(my_data.cbegin(),
my_data.cend() - static_cast<std::ptrdiff_t>(-ofs),
my_data.cend() - static_cast<std::ptrdiff_t>(-ofs), // LCOV_EXCL_LINE
my_n_data_for_add_sub.begin() + static_cast<std::ptrdiff_t>(-ofs));

// LCOV_EXCL_START
Expand Down Expand Up @@ -2700,7 +2700,7 @@
&& (i < static_cast<std::uint_fast32_t>(std::tuple_size<local_tmp_array_type>::value))
)
{
tmp[static_cast<std::size_t>(i)] =
tmp[static_cast<std::size_t>(i)] = // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
static_cast<limb_type>(uu % static_cast<unsigned long long>(decwide_t_elem_mask)); // NOLINT(google-runtime-int)

uu = static_cast<unsigned long long>(uu / static_cast<unsigned long long>(decwide_t_elem_mask)); // NOLINT(google-runtime-int)
Expand Down Expand Up @@ -3376,7 +3376,7 @@

// Get a possible +/- sign and remove it.

if((pos = str.find('-')) != std::string::npos)
if((pos = str.find('-')) != std::string::npos) // NOLINT(bugprone-assignment-in-if-condition)
{
my_neg = true;

Expand All @@ -3387,7 +3387,7 @@
my_neg = false;
}

if((pos = str.find('+')) != std::string::npos)
if((pos = str.find('+')) != std::string::npos) // NOLINT(bugprone-assignment-in-if-condition)
{
str.erase(pos, static_cast<std::uint_fast32_t>(UINT8_C(1)));
}
Expand Down Expand Up @@ -4382,9 +4382,10 @@
using local_flags_type = std::ios::fmtflags;

// Assess the format flags.
// Obtain the showpos flag.
const auto my_showpos = (static_cast<local_flags_type>(ostrm_flags & std::ios::showpos) != static_cast<local_flags_type>(UINT8_C(0)));
const auto my_uppercase = (static_cast<local_flags_type>(ostrm_flags & std::ios::uppercase) != static_cast<local_flags_type>(UINT8_C(0)));

// Obtain the showpos and uppercase flags.
const bool my_showpos { static_cast<local_flags_type>(ostrm_flags & std::ios::showpos) == static_cast<local_flags_type>(std::ios::showpos) };
const bool my_uppercase { static_cast<local_flags_type>(ostrm_flags & std::ios::uppercase) == static_cast<local_flags_type>(std::ios::uppercase) };

using std::ilogb;

Expand All @@ -4394,26 +4395,29 @@
// Determine the kind of output format requested (scientific, fixed, none).
detail::os_float_field_type my_float_field { };

if ((ostrm_flags & std::ios::scientific) != static_cast<local_flags_type>(UINT8_C(0))) { my_float_field = detail::os_float_field_type::scientific; }
else if((ostrm_flags & std::ios::fixed) != static_cast<local_flags_type>(UINT8_C(0))) { my_float_field = detail::os_float_field_type::fixed; }
else { my_float_field = detail::os_float_field_type::none; }
if (static_cast<local_flags_type>(ostrm_flags & std::ios::scientific) == static_cast<local_flags_type>(std::ios::scientific)) { my_float_field = detail::os_float_field_type::scientific; }
else if(static_cast<local_flags_type>(ostrm_flags & std::ios::fixed) == static_cast<local_flags_type>(std::ios::fixed)) { my_float_field = detail::os_float_field_type::fixed; }
else { my_float_field = detail::os_float_field_type::none; }

// Get the output stream's precision and limit it to max_digits10.
// Erroneous negative precision (theoretically impossible) will be
// set to ostream's default precision. Zero precision will be left
// at zero.
const auto prec_default = static_cast<std::streamsize>(INT8_C(6));

auto os_precision =
static_cast<std::uint_fast32_t>
(
((ostrm_precision <= static_cast<std::streamsize>(0))
? ((my_float_field != detail::os_float_field_type::scientific) ? static_cast<std::uint_fast32_t>(prec_default) : static_cast<std::uint_fast32_t>(UINT8_C(0)))
: static_cast<std::uint_fast32_t>(ostrm_precision))
);
std::uint_fast32_t
os_precision
{
static_cast<std::uint_fast32_t>
(
((ostrm_precision <= static_cast<std::streamsize>(0))
? ((my_float_field != detail::os_float_field_type::scientific) ? static_cast<std::uint_fast32_t>(prec_default) : static_cast<std::uint_fast32_t>(UINT8_C(0)))
: static_cast<std::uint_fast32_t>(ostrm_precision))
)
};

auto use_scientific = false;
auto use_fixed = false;
bool use_scientific { false };
bool use_fixed { false };

if (my_float_field == detail::os_float_field_type::scientific) { use_scientific = true; }
else if(my_float_field == detail::os_float_field_type::fixed) { use_fixed = true; }
Expand Down Expand Up @@ -4500,7 +4504,11 @@
get_output_string(x, str, the_exp, number_of_digits10_i_want);

// Obtain additional format information.
const auto my_showpoint = ((ostrm_flags & std::ios::showpoint) != static_cast<local_flags_type>(UINT8_C(0)));
const bool
my_showpoint
{
static_cast<local_flags_type>(ostrm_flags & std::ios::showpoint) == static_cast<local_flags_type>(std::ios::showpoint)
};

// Write the output string in the desired format.
if (my_float_field == detail::os_float_field_type::scientific) { wr_string_scientific(str, the_exp, os_precision, my_showpoint, my_uppercase); }
Expand Down Expand Up @@ -4529,10 +4537,11 @@
const auto n_fill = static_cast<std::uint_fast32_t>(my_width - str.length());

// Left-justify is the exception, std::right and std::internal justify right.
const auto my_left =
(
static_cast<local_flags_type>(ostrm_flags & std::ios::left) != static_cast<local_flags_type>(static_cast<unsigned>(UINT8_C(0)))
);
const bool
my_left
{
static_cast<local_flags_type>(ostrm_flags & std::ios::left) == static_cast<local_flags_type>(std::ios::left)
};

// Justify left or right and insert the fill characters.
str.insert((my_left ? str.end() : str.begin()), static_cast<std::size_t>(n_fill), ostrm_fill);
Expand Down
12 changes: 6 additions & 6 deletions math/wide_decimal/decwide_t_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@

private:
template<const std::int32_t ParamDigitsBaseTen,
typename LimbType,
typename AllocatorType,
typename LimbType,
typename AllocatorType,
typename OtherFloatingPointType,
typename ExponentType,
typename FftFloatType>
typename ExponentType,
typename FftFloatType>
#if defined(WIDE_DECIMAL_NAMESPACE)
friend class WIDE_DECIMAL_NAMESPACE::math::wide_decimal::decwide_t;
#else
Expand Down Expand Up @@ -404,7 +404,7 @@
using local_size_type = typename local_array_type::size_type;

return ((n < static_cast<std::uint32_t>(std::tuple_size<local_array_type>::value))
? local_p10_table[static_cast<local_size_type>(n)]
? local_p10_table[static_cast<local_size_type>(n)] // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)
: local_p10_table.back()); // LCOV_EXCL_LINE
}
}
Expand Down Expand Up @@ -630,7 +630,7 @@
auto operator[](const size_type i) const -> typename base_class_type::const_reference { return base_class_type::operator[](static_cast<typename base_class_type::size_type>(i)); }
};

enum class os_float_field_type
enum class os_float_field_type // NOLINT(performance-enum-size)
{
scientific,
fixed,
Expand Down
8 changes: 4 additions & 4 deletions math/wide_decimal/decwide_t_detail_fft.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2013 - 2023. //
// Copyright Christopher Kormanyos 2013 - 2024. //
// Distributed under the Boost Software License, //
// Version 1.0. (See accompanying file LICENSE_1_0.txt //
// or copy at http://www.boost.org/LICENSE_1_0.txt) //
Expand Down Expand Up @@ -34,13 +34,13 @@
constexpr auto template_half() -> float_type { return static_cast<float_type>(static_cast<float_type>(1) / 2); }

template<>
constexpr auto template_one<float>() -> float { return static_cast<float>(1.0F); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
constexpr auto template_one<float>() -> float { return static_cast<float>(1.0L); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)

template<>
constexpr auto template_one<double>() -> double { return static_cast<double>(1.0F); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
constexpr auto template_one<double>() -> double { return static_cast<double>(1.0L); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)

template<>
constexpr auto template_one<long double>() -> long double { return static_cast<long double>(1.0F); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
constexpr auto template_one<long double>() -> long double { return static_cast<long double>(1.0L); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)

template<>
constexpr auto template_half<float>() -> float { return static_cast<float>(0.5L); } // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
Expand Down
2 changes: 1 addition & 1 deletion math/wide_decimal/decwide_t_detail_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
}
}

#if 0
#if 0 // NOLINT(readability-avoid-unconditional-preprocessor-if)
template<typename InputLimbIteratorType,
typename OutputLimbIteratorType,
typename TempLimbIteratorType>
Expand Down
Loading

0 comments on commit fd77604

Please sign in to comment.