fix unnecessary warnings in some files (#5152)

This commit is contained in:
JohnnyCena123
2025-08-28 22:28:56 +02:00
committed by GitHub
parent 7103703313
commit 4a4997c615
4 changed files with 7 additions and 6 deletions

View File

@@ -175,7 +175,6 @@ static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, i
int spaceSize = MeasureText(" ", fontSize); int spaceSize = MeasureText(" ", fontSize);
int pressSize = MeasureText("Press", fontSize); int pressSize = MeasureText("Press", fontSize);
int keySize = MeasureText(key, fontSize); int keySize = MeasureText(key, fontSize);
int textSize = MeasureText(text, fontSize);
int textSizeCurrent = 0; int textSizeCurrent = 0;
DrawText("Press", posX, posY, fontSize, color); DrawText("Press", posX, posY, fontSize, color);

View File

@@ -18,6 +18,7 @@
#include "raylib.h" #include "raylib.h"
#include "raymath.h" #include "raymath.h"
#undef FLT_MAX
#define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111 #define FLT_MAX 340282346638528859811704183484516925440.0f // Maximum value of a float, from bit pattern 01111111011111111111111111111111
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------

View File

@@ -161,9 +161,9 @@ static Mesh GenMeshPoints(int numPoints)
// https://en.wikipedia.org/wiki/Spherical_coordinate_system // https://en.wikipedia.org/wiki/Spherical_coordinate_system
for (int i = 0; i < numPoints; i++) for (int i = 0; i < numPoints; i++)
{ {
float theta = ((float)PI*rand())/RAND_MAX; float theta = ((float)PI*rand())/((float)RAND_MAX);
float phi = (2.0f*PI*rand())/RAND_MAX; float phi = (2.0f*PI*rand())/((float)RAND_MAX);
float r = (10.0f*rand())/RAND_MAX; float r = (10.0f*rand())/((float)RAND_MAX);
mesh.vertices[i*3 + 0] = r*sinf(theta)*cosf(phi); mesh.vertices[i*3 + 0] = r*sinf(theta)*cosf(phi);
mesh.vertices[i*3 + 1] = r*sinf(theta)*sinf(phi); mesh.vertices[i*3 + 1] = r*sinf(theta)*sinf(phi);

View File

@@ -3243,6 +3243,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
int mipWidth = width; int mipWidth = width;
int mipHeight = height; int mipHeight = height;
int mipOffset = 0; // Mipmap data offset, only used for tracelog 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 // NOTE: Added pointer math separately from function to avoid UBSAN complaining
unsigned char *dataPtr = NULL; unsigned char *dataPtr = NULL;