Skip to content

Commit 4a4997c

Browse files
fix unnecessary warnings in some files (#5152)
1 parent 7103703 commit 4a4997c

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

examples/core/core_random_sequence.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, i
175175
int spaceSize = MeasureText(" ", fontSize);
176176
int pressSize = MeasureText("Press", fontSize);
177177
int keySize = MeasureText(key, fontSize);
178-
int textSize = MeasureText(text, fontSize);
179178
int textSizeCurrent = 0;
180179

181180
DrawText("Press", posX, posY, fontSize, color);
@@ -184,4 +183,4 @@ static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, i
184183
DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED);
185184
textSizeCurrent += keySize + 2*spaceSize;
186185
DrawText(text, posX + textSizeCurrent, posY, fontSize, color);
187-
}
186+
}

examples/models/models_mesh_picking.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "raylib.h"
1919
#include "raymath.h"
2020

21+
#undef FLT_MAX
2122
#define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111
2223

2324
//------------------------------------------------------------------------------------
@@ -245,4 +246,4 @@ int main(void)
245246
//--------------------------------------------------------------------------------------
246247

247248
return 0;
248-
}
249+
}

examples/models/models_point_rendering.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ static Mesh GenMeshPoints(int numPoints)
161161
// https://en.wikipedia.org/wiki/Spherical_coordinate_system
162162
for (int i = 0; i < numPoints; i++)
163163
{
164-
float theta = ((float)PI*rand())/RAND_MAX;
165-
float phi = (2.0f*PI*rand())/RAND_MAX;
166-
float r = (10.0f*rand())/RAND_MAX;
164+
float theta = ((float)PI*rand())/((float)RAND_MAX);
165+
float phi = (2.0f*PI*rand())/((float)RAND_MAX);
166+
float r = (10.0f*rand())/((float)RAND_MAX);
167167

168168
mesh.vertices[i*3 + 0] = r*sinf(theta)*cosf(phi);
169169
mesh.vertices[i*3 + 1] = r*sinf(theta)*sinf(phi);

src/rlgl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,6 +3243,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
32433243
int mipWidth = width;
32443244
int mipHeight = height;
32453245
int mipOffset = 0; // Mipmap data offset, only used for tracelog
3246+
(void)mipOffset; // Used to avoid gcc warnings about unused variable
32463247

32473248
// NOTE: Added pointer math separately from function to avoid UBSAN complaining
32483249
unsigned char *dataPtr = NULL;

0 commit comments

Comments
 (0)