Commit 51abb00
Fix MSVC narrowing warnings (and a latent paso reordering bug)
Four MSVC 2022 warnings on the win-64 conda-forge build, all in escript
code:
* paso/src/Options.h: Options::reordering was declared `bool`, but it stores
a reordering *strategy code* (PASO_NO_REORDERING == 17,
PASO_DEFAULT_REORDERING == 30, ...): it is set from
mapEscriptOption(sb.getReordering()) and passed to MKL_solve(...,
index_t reordering, ...) which switch()es on it. Storing those codes in a
bool collapsed them all to 1, silently breaking MKL reordering selection
on every platform (gcc/clang just didn't warn). Declare it `index_t`,
which is what every consumer already expects. Fixes MSVC C4305.
* ripley/src/RipleyDomain.cpp and speckley/src/SpeckleyDomain.cpp:
pair<int,dim_t>(1, m_diracPoints.size()) narrowed the 64-bit size() to
dim_t. Cast explicitly. Fixes MSVC C4267.
* weipa/src/DataVar.cpp: std::copy from a double source into a float buffer.
Replace with an explicit static_cast<float> loop (the narrowing is
intended -- the VTK/SILO export buffer is single precision). Fixes C4244.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7711604 commit 51abb00
4 files changed
Lines changed: 7 additions & 5 deletions
File tree
- paso/src
- ripley/src
- speckley/src
- weipa/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
0 commit comments