Mercurial > octave
changeset 32735:902b85a227c6
maint: use constexpr in sparse-qr.cc to create compile-time constants.
* sparse-qr.cc (octave_suitesparse_ptr_size_mismatch,
suitesparse_integer_long_mismatch): Change static declarations to use constexpr
so they can be calculated at compile-time rather than run-time.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 11 Jan 2024 16:38:16 -0800 |
parents | 6bfe60a31f73 |
children | 4214da1916cd |
files | liboctave/numeric/sparse-qr.cc |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/numeric/sparse-qr.cc Thu Jan 11 14:43:05 2024 -0500 +++ b/liboctave/numeric/sparse-qr.cc Thu Jan 11 16:38:16 2024 -0800 @@ -45,10 +45,10 @@ #if (defined (HAVE_SPQR) && defined (HAVE_CHOLMOD)) // Decide once at runtime whether Octave must workaround SuiteSparse library. -static const bool octave_suitesparse_ptr_size_mismatch +static constexpr bool octave_suitesparse_ptr_size_mismatch = (sizeof (octave_idx_type) != sizeof (SuiteSparse_long)); -static const bool suitesparse_integer_long_mismatch +static constexpr bool suitesparse_integer_long_mismatch = (sizeof (suitesparse_integer) != sizeof (SuiteSparse_long)); #endif