Skip to content

Commit 72b2066

Browse files
authored
MSVC warnings (#5595)
1 parent 7a3cecc commit 72b2066

13 files changed

Lines changed: 43 additions & 43 deletions

examples/core/core_compute_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main(void)
6060
//----------------------------------------------------------------------------------
6161
if (btnComputeHashes)
6262
{
63-
int textInputLen = strlen(textInput);
63+
int textInputLen = (int)strlen(textInput);
6464

6565
// Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
6666
base64Text = EncodeDataBase64((unsigned char *)textInput, textInputLen, &base64TextSize);

examples/core/core_directory_files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(void)
7878

7979
GuiSetStyle(LISTVIEW, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
8080
GuiSetStyle(LISTVIEW, TEXT_PADDING, 40);
81-
GuiListViewEx((Rectangle){ 0, 50, GetScreenWidth(), GetScreenHeight() - 50 },
81+
GuiListViewEx((Rectangle){ 0, 50, (float)GetScreenWidth(), (float)GetScreenHeight() - 50 },
8282
files.paths, files.count, &listScrollIndex, &listItemActive, &listItemFocused);
8383

8484
EndDrawing();

examples/core/core_highdpi_testbed.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ int main(void)
8686

8787
// Draw mouse position
8888
DrawCircleV(GetMousePosition(), 20, MAROON);
89-
DrawRectangle(mousePos.x - 25, mousePos.y, 50, 2, BLACK);
90-
DrawRectangle(mousePos.x, mousePos.y - 25, 2, 50, BLACK);
89+
DrawRectangleRec((Rectangle) { mousePos.x - 25, mousePos.y, 50, 2 }, BLACK);
90+
DrawRectangleRec((Rectangle) { mousePos.x, mousePos.y - 25, 2, 50 }, BLACK);
9191
DrawText(TextFormat("[%i,%i]", GetMouseX(), GetMouseY()), mousePos.x - 44,
92-
(mousePos.y > GetScreenHeight() - 60)? mousePos.y - 46 : mousePos.y + 30, 20, BLACK);
92+
(mousePos.y > GetScreenHeight() - 60)? (int)mousePos.y - 46 : (int)mousePos.y + 30, 20, BLACK);
9393

9494
EndDrawing();
9595
//----------------------------------------------------------------------------------

examples/core/core_viewport_scaling.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ int main(void)
177177
DrawRectangleRec(increaseTypeButton, SKYBLUE);
178178
DrawRectangleRec(decreaseResolutionButton, SKYBLUE);
179179
DrawRectangleRec(increaseResolutionButton, SKYBLUE);
180-
DrawText("<", decreaseTypeButton.x + 3, decreaseTypeButton.y + 1, 10, BLACK);
181-
DrawText(">", increaseTypeButton.x + 3, increaseTypeButton.y + 1, 10, BLACK);
182-
DrawText("<", decreaseResolutionButton.x + 3, decreaseResolutionButton.y + 1, 10, BLACK);
183-
DrawText(">", increaseResolutionButton.x + 3, increaseResolutionButton.y + 1, 10, BLACK);
180+
DrawText("<", (int)decreaseTypeButton.x + 3, (int)decreaseTypeButton.y + 1, 10, BLACK);
181+
DrawText(">", (int)increaseTypeButton.x + 3, (int)increaseTypeButton.y + 1, 10, BLACK);
182+
DrawText("<", (int)decreaseResolutionButton.x + 3, (int)decreaseResolutionButton.y + 1, 10, BLACK);
183+
DrawText(">", (int)increaseResolutionButton.x + 3, (int)increaseResolutionButton.y + 1, 10, BLACK);
184184

185185
EndDrawing();
186186
//----------------------------------------------------------------------------------
@@ -308,7 +308,7 @@ static void ResizeRenderSize(ViewportType viewportType, int *screenWidth, int *s
308308
}
309309

310310
UnloadRenderTexture(*target);
311-
*target = LoadRenderTexture(sourceRect->width, -sourceRect->height);
311+
*target = LoadRenderTexture((int)sourceRect->width, -(int)sourceRect->height);
312312
}
313313

314314
// Example how to calculate position on RenderTexture

examples/models/models_animation_blending.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int main(void)
225225
NULL, TextFormat("x%.1f", animFrameSpeed0), &animFrameSpeed0, 0.1f, 2.0f);
226226
GuiEnable();
227227
if (dropdownEditMode1) GuiDisable();
228-
GuiSlider((Rectangle){ GetScreenWidth() - 170, 38, 160, 12 },
228+
GuiSlider((Rectangle){ GetScreenWidth() - 170.0f, 38, 160, 12 },
229229
TextFormat("%.1fx", animFrameSpeed1), NULL, &animFrameSpeed1, 0.1f, 2.0f);
230230
GuiEnable();
231231

@@ -241,23 +241,23 @@ int main(void)
241241
GuiProgressBar((Rectangle){ 180, 14, 440, 16 }, NULL, NULL, &animBlendProgress, 0.0f, 1.0f);
242242
GuiSetStyle(PROGRESSBAR, PROGRESS_SIDE, 0); // Reset to Left-->Right
243243

244-
if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170, 10, 160, 24 }, TextJoin(animNames, animCount, ";"),
244+
if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170.0f, 10, 160, 24 }, TextJoin(animNames, animCount, ";"),
245245
&animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1;
246246

247247
// Draw playing timeline with keyframes for anim0[]
248-
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60, GetScreenWidth() - 180, 20 }, "ANIM 0",
248+
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 0",
249249
TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount),
250250
&animFrameProgress0, 0.0f, (float)anims[animIndex0].keyframeCount);
251251
for (int i = 0; i < anims[animIndex0].keyframeCount; i++)
252-
DrawRectangle(60 + ((float)(GetScreenWidth() - 180)/(float)anims[animIndex0].keyframeCount)*(float)i,
252+
DrawRectangle(60 + (int)(((float)(GetScreenWidth() - 180)/(float)anims[animIndex0].keyframeCount)*(float)i),
253253
GetScreenHeight() - 60, 1, 20, BLUE);
254254

255255
// Draw playing timeline with keyframes for anim1[]
256-
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 30, GetScreenWidth() - 180, 20 }, "ANIM 1",
256+
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 30.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 1",
257257
TextFormat("FRAME: %.2f / %i", animFrameProgress1, anims[animIndex1].keyframeCount),
258258
&animFrameProgress1, 0.0f, (float)anims[animIndex1].keyframeCount);
259259
for (int i = 0; i < anims[animIndex1].keyframeCount; i++)
260-
DrawRectangle(60 + ((float)(GetScreenWidth() - 180)/(float)anims[animIndex1].keyframeCount)*(float)i,
260+
DrawRectangle(60 + (int)(((float)(GetScreenWidth() - 180)/(float)anims[animIndex1].keyframeCount)*(float)i),
261261
GetScreenHeight() - 30, 1, 20, BLUE);
262262
//---------------------------------------------------------------------------------------------
263263

examples/models/models_animation_timing.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ int main(void)
108108
&animFrameSpeed, 0.1f, 2.0f);
109109

110110
// Draw playing timeline with keyframes
111-
GuiLabel((Rectangle){ 10, GetScreenHeight() - 64, GetScreenWidth() - 20, 24 },
111+
GuiLabel((Rectangle){ 10, GetScreenHeight() - 64.0f, GetScreenWidth() - 20.0f, 24 },
112112
TextFormat("CURRENT FRAME: %.2f / %i", animFrameProgress, anims[animIndex].keyframeCount));
113-
GuiProgressBar((Rectangle){ 10, GetScreenHeight() - 40, GetScreenWidth() - 20, 24 }, NULL, NULL,
113+
GuiProgressBar((Rectangle){ 10, GetScreenHeight() - 40.0f, GetScreenWidth() - 20.0f, 24 }, NULL, NULL,
114114
&animFrameProgress, 0.0f, (float)anims[animIndex].keyframeCount);
115115
for (int i = 0; i < anims[animIndex].keyframeCount; i++)
116-
DrawRectangle(10 + ((float)(GetScreenWidth() - 20)/(float)anims[animIndex].keyframeCount)*(float)i,
116+
DrawRectangle(10 + (int)(((float)(GetScreenWidth() - 20)/(float)anims[animIndex].keyframeCount)*(float)i),
117117
GetScreenHeight() - 40, 1, 24, BLUE);
118118

119119
EndDrawing();

examples/models/models_bone_socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ int main(void)
116116
// Update model animation
117117
ModelAnimation anim = modelAnimations[animIndex];
118118
animCurrentFrame = (animCurrentFrame + 1)%anim.keyframeCount;
119-
UpdateModelAnimation(characterModel, anim, animCurrentFrame);
119+
UpdateModelAnimation(characterModel, anim, (float)animCurrentFrame);
120120
//----------------------------------------------------------------------------------
121121

122122
// Draw
@@ -129,7 +129,7 @@ int main(void)
129129
// Draw character
130130
Quaternion characterRotate = QuaternionFromAxisAngle((Vector3){ 0.0f, 1.0f, 0.0f }, angle*DEG2RAD);
131131
characterModel.transform = MatrixMultiply(QuaternionToMatrix(characterRotate), MatrixTranslate(position.x, position.y, position.z));
132-
UpdateModelAnimation(characterModel, anim, animCurrentFrame);
132+
UpdateModelAnimation(characterModel, anim, (float)animCurrentFrame);
133133
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
134134

135135
// Draw equipments (hat, sword, shield)

examples/shaders/shaders_shadowmap_rendering.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int main(void)
117117

118118
frameCounter++;
119119
frameCounter %= (anims[0].keyframeCount);
120-
UpdateModelAnimation(robot, anims[0], frameCounter);
120+
UpdateModelAnimation(robot, anims[0], (float)frameCounter);
121121

122122
// Move light with arrow keys
123123
const float cameraSpeed = 0.05f;

examples/shapes/shapes_math_sine_cosine.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int main(void)
8989

9090
// Cotangent (orange)
9191
DrawLineEx((Vector2){ center.x , limitMin.y }, (Vector2){ cotangentPoint.x, limitMin.y }, 2.0f, ORANGE);
92-
DrawLineDashed(center, cotangentPoint, 10.0f, 4.0f, ORANGE);
92+
DrawLineDashed(center, cotangentPoint, 10, 4, ORANGE);
9393

9494
// Side background
9595
DrawLine(580, 0, 580, GetScreenHeight(), (Color){ 218, 218, 218, 255 });
@@ -106,48 +106,48 @@ int main(void)
106106
DrawLineEx((Vector2){ start.x, start.y + start.height/2 }, (Vector2){ start.x + start.width, start.y + start.height/2 }, 2.0f, GRAY);
107107

108108
// Wave graph axis labels
109-
DrawText("1", start.x - 8, start.y, 6, GRAY);
110-
DrawText("0", start.x - 8, start.y + start.height/2 - 6, 6, GRAY);
111-
DrawText("-1", start.x - 12, start.y + start.height - 8, 6, GRAY);
112-
DrawText("0", start.x - 2, start.y + start.height + 4, 6, GRAY);
113-
DrawText("360", start.x + start.width - 8, start.y + start.height + 4, 6, GRAY);
109+
DrawText("1", (int)start.x - 8, (int)start.y, 6, GRAY);
110+
DrawText("0", (int)start.x - 8, (int)start.y + (int)start.height/2 - 6, 6, GRAY);
111+
DrawText("-1", (int)start.x - 12, (int)start.y + (int)start.height - 8, 6, GRAY);
112+
DrawText("0", (int)start.x - 2, (int)start.y + (int)start.height + 4, 6, GRAY);
113+
DrawText("360", (int)start.x + (int)start.width - 8, (int)start.y + (int)start.height + 4, 6, GRAY);
114114

115115
// Sine (red - vertical)
116116
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ center.x, point.y }, 2.0f, RED);
117-
DrawLineDashed((Vector2){ point.x, center.y }, (Vector2){ point.x, point.y }, 10.0f, 4.0f, RED);
117+
DrawLineDashed((Vector2){ point.x, center.y }, (Vector2){ point.x, point.y }, 10, 4, RED);
118118
DrawText(TextFormat("Sine %.2f", sinRad), 640, 190, 6, RED);
119119
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-sinRad + 1)*start.height/2.0f) }, 4.0f, RED);
120120
DrawSplineLinear(sinePoints, WAVE_POINTS, 1.0f, RED);
121121

122122
// Cosine (blue - horizontal)
123123
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ point.x, center.y }, 2.0f, BLUE);
124-
DrawLineDashed((Vector2){ center.x , point.y }, (Vector2){ point.x, point.y }, 10.0f, 4.0f, BLUE);
124+
DrawLineDashed((Vector2){ center.x , point.y }, (Vector2){ point.x, point.y }, 10, 4, BLUE);
125125
DrawText(TextFormat("Cosine %.2f", cosRad), 640, 210, 6, BLUE);
126126
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-cosRad + 1)*start.height/2.0f) }, 4.0f, BLUE);
127127
DrawSplineLinear(cosPoints, WAVE_POINTS, 1.0f, BLUE);
128128

129129
// Tangent (purple)
130130
DrawLineEx((Vector2){ limitMax.x , center.y }, (Vector2){ limitMax.x, tangentPoint.y }, 2.0f, PURPLE);
131-
DrawLineDashed(center, tangentPoint, 10.0f, 4.0f, PURPLE);
131+
DrawLineDashed(center, tangentPoint, 10, 4, PURPLE);
132132
DrawText(TextFormat("Tangent %.2f", tangent), 640, 230, 6, PURPLE);
133133

134134
// Cotangent (orange)
135135
DrawText(TextFormat("Cotangent %.2f", cotangent), 640, 250, 6, ORANGE);
136136

137137
// Complementary angle (beige)
138-
DrawCircleSectorLines(center, radius*0.6f , -angle, -90.0f , 36.0f, BEIGE);
138+
DrawCircleSectorLines(center, radius*0.6f , -angle, -90.0f , 36, BEIGE);
139139
DrawText(TextFormat("Complementary %0.f°",complementary), 640, 150, 6, BEIGE);
140140

141141
// Supplementary angle (darkblue)
142-
DrawCircleSectorLines(center, radius*0.5f , -angle, -180.0f , 36.0f, DARKBLUE);
142+
DrawCircleSectorLines(center, radius*0.5f , -angle, -180.0f , 36, DARKBLUE);
143143
DrawText(TextFormat("Supplementary %0.f°",supplementary), 640, 130, 6, DARKBLUE);
144144

145145
// Explementary angle (pink)
146-
DrawCircleSectorLines(center, radius*0.4f , -angle, -360.0f , 36.0f, PINK);
146+
DrawCircleSectorLines(center, radius*0.4f , -angle, -360.0f , 36, PINK);
147147
DrawText(TextFormat("Explementary %0.f°",explementary), 640, 170, 6, PINK);
148148

149149
// Current angle - arc (lime), radius (black), endpoint (black)
150-
DrawCircleSectorLines(center, radius*0.7f , -angle, 0.0f, 36.0f, LIME);
150+
DrawCircleSectorLines(center, radius*0.7f , -angle, 0.0f, 36, LIME);
151151
DrawLineEx((Vector2){ center.x , center.y }, point, 2.0f, BLACK);
152152
DrawCircleV(point, 4.0f, BLACK);
153153

examples/shapes/shapes_penrose_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//----------------------------------------------------------------------------------
3131
typedef struct TurtleState {
3232
Vector2 origin;
33-
double angle;
33+
float angle;
3434
} TurtleState;
3535

3636
typedef struct PenroseLSystem {

0 commit comments

Comments
 (0)