diff --git a/src/rcore.c b/src/rcore.c index b229589f7..d133070b8 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -852,7 +852,7 @@ void EndDrawing(void) #ifndef GIF_RECORD_FRAMERATE #define GIF_RECORD_FRAMERATE 10 #endif - gifFrameCounter += GetFrameTime()*1000; + gifFrameCounter += (unsigned int)(GetFrameTime()*1000); // NOTE: We record one gif frame depending on the desired gif framerate if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE) diff --git a/src/rlgl.h b/src/rlgl.h index 9477558c8..fcd712251 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3945,7 +3945,7 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma // Additional types (depends on OpenGL version or extensions): // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, // - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV - glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset); + glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)((size_t)offset)); #endif } diff --git a/src/rmodels.c b/src/rmodels.c index 5efc32283..6bc9a84c1 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5165,7 +5165,7 @@ static Model LoadGLTF(const char *fileName) else TRACELOG(LOG_WARNING, "MODEL: [%s] Texcoords attribute data format not supported", fileName); } else TRACELOG(LOG_WARNING, "MODEL: [%s] Texcoords attribute data format not supported, use vec2 float", fileName); - + int index = data->meshes[i].primitives[p].attributes[j].index; if (index == 0) model.meshes[meshIndex].texcoords = texcoordPtr; else if (index == 1) model.meshes[meshIndex].texcoords2 = texcoordPtr; @@ -5549,7 +5549,7 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_ } } - float duration = fmax((tend - tstart), EPSILON); + float duration = fmaxf((tend - tstart), EPSILON); float t = (time - tstart)/duration; t = (t < 0.0f)? 0.0f : t; t = (t > 1.0f)? 1.0f : t; diff --git a/src/rshapes.c b/src/rshapes.c index f13f4b019..8ce614239 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -815,17 +815,17 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(posX, posY); - rlVertex2f(posX + width, posY + 1); + rlVertex2f((float)posX, (float)posY); + rlVertex2f((float)(posX + width), (float)(posY + 1)); - rlVertex2f(posX + width, posY + 1); - rlVertex2f(posX + width, posY + height); + rlVertex2f((float)(posX + width), (float)(posY + 1)); + rlVertex2f((float)(posX + width), (float)(posY + height)); - rlVertex2f(posX + width, posY + height); - rlVertex2f(posX + 1, posY + height); + rlVertex2f((float)(posX + width), (float)(posY + height)); + rlVertex2f((float)(posX + 1), (float)(posY + height)); - rlVertex2f(posX + 1, posY + height); - rlVertex2f(posX + 1, posY + 1); + rlVertex2f((float)(posX + 1), (float)(posY + height)); + rlVertex2f((float)(posX + 1), (float)(posY + 1)); rlEnd(); } diff --git a/src/rtext.c b/src/rtext.c index 3544ff8da..67fd36d82 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1166,7 +1166,7 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f if (codepoint == '\n') { // NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup - textOffsetY += (fontSize + textLineSpacing); + textOffsetY += (int)(fontSize + textLineSpacing); textOffsetX = 0.0f; } else @@ -1237,7 +1237,7 @@ void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Ve if (codepoints[i] == '\n') { // NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup - textOffsetY += (fontSize + textLineSpacing); + textOffsetY += (int)(fontSize + textLineSpacing); textOffsetX = 0.0f; } else diff --git a/src/rtextures.c b/src/rtextures.c index 0658a6807..c11499f09 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -311,15 +311,15 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int int dataSize = 0; unsigned char *fileData = LoadFileData(fileName, &dataSize); - if (fileData != NULL) + if (fileData != NULL && dataSize > 0) { unsigned char *dataPtr = fileData; unsigned int size = GetPixelDataSize(width, height, format); - if (size <= dataSize) // Security check + if (size <= (unsigned int)dataSize) // Security check { // Offset file data to expected raw image by header size - if ((headerSize > 0) && ((headerSize + size) <= dataSize)) dataPtr += headerSize; + if ((headerSize > 0) && ((headerSize + size) <= (unsigned int)dataSize)) dataPtr += headerSize; image.data = RL_MALLOC(size); // Allocate required memory in bytes memcpy(image.data, dataPtr, size); // Copy required data to image @@ -697,8 +697,8 @@ Image LoadImageFromScreen(void) Vector2 scale = GetWindowScaleDPI(); Image image = { 0 }; - image.width = GetScreenWidth()*scale.x; - image.height = GetScreenHeight()*scale.y; + image.width = (int)(GetScreenWidth()*scale.x); + image.height = (int)(GetScreenHeight()*scale.y); image.mipmaps = 1; image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.data = rlReadScreenPixels(image.width, image.height);