1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Fix various XCode and PVS-Studio static analyzer warnings (#2309)

This commit is contained in:
omar 2019-01-27 15:27:49 +01:00
parent 20bc06af70
commit c3c2cd1e82
8 changed files with 35 additions and 25 deletions

View file

@ -1,3 +1,6 @@
// [ImGui] this is a slightly modified version of stb_truetype.h 1.19. Those changes would need to be pushed into nothings/stb
// grep for [ImGui] to find the changes.
// stb_truetype.h - v1.19 - public domain
// authored from 2009-2016 by Sean Barrett / RAD Game Tools
//
@ -2368,7 +2371,8 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
classDefTable = classDef1ValueArray + 2 * glyphCount;
// [ImGui: commented to fix static analyzer warning]
//classDefTable = classDef1ValueArray + 2 * glyphCount;
} break;
case 2: {
@ -2392,7 +2396,8 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
}
classDefTable = classRangeRecords + 6 * classRangeCount;
// [ImGui: commented to fix static analyzer warning]
//classDefTable = classRangeRecords + 6 * classRangeCount;
} break;
default: {
@ -3024,6 +3029,7 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
dx = -dx;
dy = -dy;
t = x0, x0 = xb, xb = t;
(void)dx; // [ImGui: fix static analyzer warning]
}
x1 = (int) x_top;
@ -4253,7 +4259,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
int winding = 0;
orig[0] = x;
orig[1] = y;
//orig[1] = y; // [ImGui] commmented double assignment without reading
// make sure y never passes through a vertex of the shape
y_frac = (float) STBTT_fmod(y, 1.0f);