Skip to content

Commit 2a73450

Browse files
committed
Avoid compiler warning when building for targets with 32-bit pointer size.
* liboctave/numeric/sparse-qr.cc (ors2crs, ocs2ccs): Use constexpr-if to avoid compiler warning about cast between incompatible pointer types on platforms where the size or alignment of SuiteSparse_long differs from the size or alignment of octave_idx_type.
1 parent 636f738 commit 2a73450

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

liboctave/numeric/sparse-qr.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ ors2crs (const SparseMatrix& a)
259259
A.dtype = CHOLMOD_DOUBLE;
260260
A.nz = nullptr;
261261
A.z = nullptr;
262-
if (! octave_suitesparse_ptr_size_mismatch)
262+
if constexpr (! octave_suitesparse_ptr_size_mismatch)
263263
{
264264
A.p = reinterpret_cast<SuiteSparse_long *> (a.cidx ());
265265
A.i = reinterpret_cast<SuiteSparse_long *> (a.ridx ());
@@ -303,7 +303,7 @@ ocs2ccs (const SparseComplexMatrix& a)
303303
A.dtype = CHOLMOD_DOUBLE;
304304
A.nz = nullptr;
305305
A.z = nullptr;
306-
if (! octave_suitesparse_ptr_size_mismatch)
306+
if constexpr (! octave_suitesparse_ptr_size_mismatch)
307307
{
308308
A.p = reinterpret_cast<SuiteSparse_long *> (a.cidx ());
309309
A.i = reinterpret_cast<SuiteSparse_long *> (a.ridx ());

0 commit comments

Comments
 (0)