1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-15 16:26:35 +00:00
openmw/components
elsid ec0c76d2f3
Ignore false positive warning
cellSize > 1 so the result of the division cannot be undefined.

/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:18:35: error: The result of the '/' expression is undefined [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors]
   18 |         std::size_t cell = global / (cellSize - 1);
      |                                   ^
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:244:13: note: Assuming 'lodLevel' is >= 0
  244 |         if (lodLevel < 0 || 63 < lodLevel)
      |             ^~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:244:13: note: Left side of '||' is false
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:244:29: note: Assuming 'lodLevel' is <= 63
  244 |         if (lodLevel < 0 || 63 < lodLevel)
      |                             ^~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:244:9: note: Taking false branch
  244 |         if (lodLevel < 0 || 63 < lodLevel)
      |         ^
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:247:13: note: Assuming 'size' is > 0
  247 |         if (size <= 0)
      |             ^~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:247:9: note: Taking false branch
  247 |         if (size <= 0)
      |         ^
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:272:13: note: Assuming the condition is false
  272 |         if (land != nullptr)
      |             ^~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:272:9: note: Taking false branch
  272 |         if (land != nullptr)
      |         ^
/home/elsid/dev/openmw/components/esmterrain/storage.cpp:363:9: note: Calling 'sampleCellGrid<const (lambda at /home/elsid/dev/openmw/components/esmterrain/storage.cpp:280:35) &>'
  363 |         sampleCellGrid(cellSize, sampleSize, beginX, beginY, distance, handleSample);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:72:13: note: Assuming 'cellSize' is >= 2
   72 |         if (cellSize < 2 || !Misc::isPowerOfTwo(cellSize - 1))
      |             ^~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:72:13: note: Left side of '||' is false
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:72:9: note: Taking false branch
   72 |         if (cellSize < 2 || !Misc::isPowerOfTwo(cellSize - 1))
      |         ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:75:13: note: Assuming 'sampleSize' is not equal to 0
   75 |         if (sampleSize == 0 || !Misc::isPowerOfTwo(sampleSize))
      |             ^~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:75:13: note: Left side of '||' is false
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:75:9: note: Taking false branch
   75 |         if (sampleSize == 0 || !Misc::isPowerOfTwo(sampleSize))
      |         ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:78:13: note: Assuming 'distance' is >= 2
   78 |         if (distance < 2 || !Misc::isPowerOfTwo(distance - 1))
      |             ^~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:78:13: note: Left side of '||' is false
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:78:9: note: Taking false branch
   78 |         if (distance < 2 || !Misc::isPowerOfTwo(distance - 1))
      |         ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:84:13: note: Assuming 'distance' is >= 'cellSize'
   84 |         if (distance < cellSize || sampleSize > cellSize - 1)
      |             ^~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:84:13: note: Left side of '||' is false
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:84:36: note: Assuming the condition is true
   84 |         if (distance < cellSize || sampleSize > cellSize - 1)
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:84:9: note: Taking true branch
   84 |         if (distance < cellSize || sampleSize > cellSize - 1)
      |         ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:85:20: note: Calling 'sampleCellGridSimple<const (lambda at /home/elsid/dev/openmw/components/esmterrain/storage.cpp:280:35) &>'
   85 |             return sampleCellGridSimple(cellSize, sampleSize, beginX, beginY, endX, endY, f);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:56:16: note: 'cellSize' is > 1
   56 |         assert(cellSize > 1);
      |                ^
/usr/include/assert.h💯27: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:56:9: note: '?' condition is true
   56 |         assert(cellSize > 1);
      |         ^
/usr/include/assert.h💯7: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |       ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:57:9: note: '?' condition is true
   57 |         assert(Misc::isPowerOfTwo(cellSize - 1));
      |         ^
/usr/include/assert.h💯7: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |       ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:58:16: note: 'sampleSize' is not equal to 0
   58 |         assert(sampleSize != 0);
      |                ^
/usr/include/assert.h💯27: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:58:9: note: '?' condition is true
   58 |         assert(sampleSize != 0);
      |         ^
/usr/include/assert.h💯7: note: expanded from macro 'assert'
  100 |      (static_cast <bool> (expr)                                         \
      |       ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:60:9: note: Calling 'sampleGrid<(lambda at /home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:61:13)>'
   60 |         sampleGrid(sampleSize, beginX, beginY, endX, endY,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 |             [&](std::size_t globalX, std::size_t globalY, std::size_t vertX, std::size_t vertY) {
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   62 |                 const auto [cellX, x] = toCellAndLocal(beginX, globalX, cellSize);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   63 |                 const auto [cellY, y] = toCellAndLocal(beginY, globalY, cellSize);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   64 |                 f(cellX, cellY, x, y, vertX, vertY);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   65 |             });
      |             ~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:33:38: note: Assuming 'y' is < 'endY'
   33 |         for (std::size_t y = beginY; y < endY; y += sampleSize)
      |                                      ^~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:33:9: note: Loop condition is true.  Entering loop body
   33 |         for (std::size_t y = beginY; y < endY; y += sampleSize)
      |         ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:36:42: note: Assuming 'x' is < 'endX'
   36 |             for (std::size_t x = beginX; x < endX; x += sampleSize)
      |                                          ^~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:36:13: note: Loop condition is true.  Entering loop body
   36 |             for (std::size_t x = beginX; x < endX; x += sampleSize)
      |             ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:36:42: note: Assuming 'x' is < 'endX'
   36 |             for (std::size_t x = beginX; x < endX; x += sampleSize)
      |                                          ^~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:36:13: note: Loop condition is true.  Entering loop body
   36 |             for (std::size_t x = beginX; x < endX; x += sampleSize)
      |             ^
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:37:17: note: Calling 'operator()'
   37 |                 f(x, y, vertX++, vertY);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:62:41: note: Calling 'toCellAndLocal'
   62 |                 const auto [cellX, x] = toCellAndLocal(beginX, globalX, cellSize);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/elsid/dev/openmw/components/esmterrain/gridsampling.hpp:18:35: note: The result of the '/' expression is undefined
   18 |         std::size_t cell = global / (cellSize - 1);
      |                            ~~~~~~~^~~~~~~~~~~~~~~~
2025-07-27 12:11:24 +02:00
..
bgsm
bsa Use zlib directly for BSA file decompression (#8569) 2025-07-17 22:25:18 +03:00
bullethelpers
compiler Implement FillJournal console command 2025-07-06 12:16:17 -06:00
config Optimize value deduping in Qt openmw.cfg parsing 2025-06-07 11:37:57 +03:00
contentselector Handle implicitly checked files more consistently (#8563) 2025-06-13 22:14:08 +03:00
crashcatcher Merge branch 'filenameexceptions' into 'master' 2025-07-01 20:45:33 +00:00
debug Merge branch 'filenameexceptions' into 'master' 2025-07-01 20:45:33 +00:00
detournavigator Reduce a chance to have a deadlock in the AsyncNavMeshUpdater 2025-03-23 23:33:40 +01:00
esm Initial support of ESM4 sounds; play opening sound of ESM4 doors. 2025-07-08 11:14:13 +02:00
esm3 FIX: Skip only the current subrecord when reading quest status 2025-07-10 17:08:47 +03:00
esm4 Merge branch 'filenameexceptions' into 'master' 2025-07-01 20:45:33 +00:00
esmloader Gets rid of most ESM::CellId 2023-04-03 14:16:05 +02:00
esmterrain Ignore false positive warning 2025-07-27 12:11:24 +02:00
fallback Fix and enforce namespace naming 2025-07-20 21:19:16 +02:00
files Use empty paths instead of optionals 2025-07-26 10:23:19 +02:00
fontloader Fix and enforce namespace naming 2025-07-20 21:19:16 +02:00
fx Fix and enforce namespace naming 2025-07-20 21:19:16 +02:00
interpreter Revert "Fix unneeded runtime errors" 2025-07-06 20:51:53 -06:00
l10n Fix and enforce namespace naming 2025-07-20 21:19:16 +02:00
loadinglistener
lua Typo fix 2025-07-24 00:37:28 +01:00
lua_ui Ensure class members are tied to the main Lua state 2025-03-03 19:37:07 +01:00
misc Initial support of ESM4 sounds; play opening sound of ESM4 doors. 2025-07-08 11:14:13 +02:00
myguiplatform Fix and enforce namespace naming 2025-07-20 21:19:16 +02:00
navmeshtool
nif Assume NIF controller data is already sorted (#8545) 2025-07-18 00:09:28 +03:00
nifbullet
nifosg Merge branch 'warn-baby-warn' into 'master' 2025-07-25 21:45:34 +03:00
platform Rename components/platform files to follow naming conventions 2025-02-22 23:47:11 +03:00
process Remove a line break that clang-format was fussing about 2025-06-19 00:27:08 +01:00
resource Merge branch 'document_object_cache' into 'master' 2025-07-18 21:51:16 +03:00
sceneutil Merge branch 'warn-baby-warn' into 'master' 2025-07-25 21:45:34 +03:00
sdlutil Bump libsdl to 2.0.20 2025-07-17 14:20:13 +00:00
serialization Add missing array include 2023-07-29 00:29:03 +02:00
settings Remove unused includes 2025-07-12 12:31:15 +02:00
shader Handle normalHeightMap as special case 2025-04-20 23:55:38 +01:00
sqlite3
std140
stereo Replace includes by forward declaration 2025-04-20 02:28:34 +02:00
terrain Merge branch 'warn-baby-warn' into 'master' 2025-07-25 21:45:34 +03:00
testing Fix path handling for files in BSAs 2025-07-03 08:46:23 +02:00
toutf8 Merge branch 'filenameexceptions' into 'master' 2025-07-01 20:45:33 +00:00
translation Rename components/to_utf8 directory and files to follow naming conventions 2025-02-23 00:18:07 +03:00
version
vfs Allow non-existent techniques to exist 2025-07-03 17:21:50 +02:00
widgets Improve topic and magic effect list padding accuracy 2025-03-10 05:48:54 +03:00
CMakeLists.txt FEAT(CS): Replace selection markers with a real one (#8139) 2025-07-14 23:18:45 +03:00
doc.hpp