mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-26 04:58:29 +00:00
Fixed all known static analysis bugs, with checker-279 on macOS.
This commit is contained in:
@@ -24,6 +24,8 @@ static const char rcsid[] =
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#include "SDL_assert.h"
|
||||
|
||||
libm_hidden_proto(fabs)
|
||||
|
||||
/*
|
||||
@@ -189,7 +191,12 @@ __ieee754_rem_pio2(x, y)
|
||||
}
|
||||
tx[2] = z;
|
||||
nx = 3;
|
||||
while (tx[nx - 1] == zero)
|
||||
|
||||
/* If this assertion ever fires, here's the static analysis that warned about it:
|
||||
http://buildbot.libsdl.org/sdl-static-analysis/sdl-macosx-static-analysis/sdl-macosx-static-analysis-1101/report-8c6ccb.html#EndPath */
|
||||
SDL_assert((tx[0] != zero) || (tx[1] != zero) || (tx[2] != zero));
|
||||
|
||||
while (nx && tx[nx - 1] == zero)
|
||||
nx--; /* skip zero term */
|
||||
n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi);
|
||||
if (hx < 0) {
|
||||
|
@@ -204,8 +204,13 @@ __kernel_rem_pio2(x, y, e0, nx, prec, ipio2)
|
||||
|
||||
/* compute q[0],q[1],...q[jk] */
|
||||
for (i = 0; i <= jk; i++) {
|
||||
for (j = 0, fw = 0.0; j <= jx; j++)
|
||||
fw += x[j] * f[jx + i - j];
|
||||
for (j = 0, fw = 0.0; j <= jx; j++) {
|
||||
const int32_t idx = jx + i - j;
|
||||
SDL_assert(idx >= 0);
|
||||
SDL_assert(idx < 20);
|
||||
SDL_assert(idx <= m);
|
||||
fw += x[j] * f[idx];
|
||||
}
|
||||
q[i] = fw;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user