diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index b92eaba88..be63e2f9b 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -175,7 +175,6 @@ static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, i int spaceSize = MeasureText(" ", fontSize); int pressSize = MeasureText("Press", fontSize); int keySize = MeasureText(key, fontSize); - int textSize = MeasureText(text, fontSize); int textSizeCurrent = 0; DrawText("Press", posX, posY, fontSize, color); @@ -184,4 +183,4 @@ static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, i DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED); textSizeCurrent += keySize + 2*spaceSize; DrawText(text, posX + textSizeCurrent, posY, fontSize, color); -} \ No newline at end of file +} diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c index 628f3de3a..44f976a63 100644 --- a/examples/models/models_mesh_picking.c +++ b/examples/models/models_mesh_picking.c @@ -18,6 +18,7 @@ #include "raylib.h" #include "raymath.h" +#undef FLT_MAX #define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111 //------------------------------------------------------------------------------------ @@ -245,4 +246,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} diff --git a/examples/models/models_point_rendering.c b/examples/models/models_point_rendering.c index 4a42a83fb..5408002f5 100644 --- a/examples/models/models_point_rendering.c +++ b/examples/models/models_point_rendering.c @@ -161,9 +161,9 @@ static Mesh GenMeshPoints(int numPoints) // https://en.wikipedia.org/wiki/Spherical_coordinate_system for (int i = 0; i < numPoints; i++) { - float theta = ((float)PI*rand())/RAND_MAX; - float phi = (2.0f*PI*rand())/RAND_MAX; - float r = (10.0f*rand())/RAND_MAX; + float theta = ((float)PI*rand())/((float)RAND_MAX); + float phi = (2.0f*PI*rand())/((float)RAND_MAX); + float r = (10.0f*rand())/((float)RAND_MAX); mesh.vertices[i*3 + 0] = r*sinf(theta)*cosf(phi); mesh.vertices[i*3 + 1] = r*sinf(theta)*sinf(phi); diff --git a/src/rlgl.h b/src/rlgl.h index 17c854f10..324d8aac5 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3243,6 +3243,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipWidth = width; int mipHeight = height; int mipOffset = 0; // Mipmap data offset, only used for tracelog + (void)mipOffset; // Used to avoid gcc warnings about unused variable // NOTE: Added pointer math separately from function to avoid UBSAN complaining unsigned char *dataPtr = NULL;