Skip to content

Commit eb3bf80

Browse files
committed
Fixed compiler warnings using Visual Studio 2019
1 parent ce11caa commit eb3bf80

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

src/render/opengl/SDL_render_gl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
14591459
}
14601460

14611461
{
1462-
int j;
1462+
size_t j;
14631463
float currentColor[4];
14641464
data->glGetFloatv(GL_CURRENT_COLOR, currentColor);
14651465
data->glBegin(GL_TRIANGLES);

test/testsprite2.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,22 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
188188
color.b = 0xFF;
189189
color.a = 0xFF;
190190

191-
verts[0].position.x = temp.x;
192-
verts[0].position.y = temp.y;
191+
verts[0].position.x = (float)temp.x;
192+
verts[0].position.y = (float)temp.y;
193193
verts[0].color = color;
194194

195-
verts[1].position.x = temp.x + temp.w;
196-
verts[1].position.y = temp.y;
195+
verts[1].position.x = (float)temp.x + temp.w;
196+
verts[1].position.y = (float)temp.y;
197197
verts[1].color = color;
198198

199-
verts[2].position.x = temp.x + temp.w;
200-
verts[2].position.y = temp.y + temp.h;
199+
verts[2].position.x = (float)temp.x + temp.w;
200+
verts[2].position.y = (float)temp.y + temp.h;
201201
verts[2].color = color;
202202

203203
SDL_RenderGeometry(renderer, NULL, verts, 3, NULL, 0);
204204

205-
verts[1].position.x = temp.x;
206-
verts[1].position.y = temp.y + temp.h;
205+
verts[1].position.x = (float)temp.x;
206+
verts[1].position.y = (float)temp.y + temp.h;
207207
verts[1].color = color;
208208

209209
SDL_RenderGeometry(renderer, NULL, verts, 3, NULL, 0);
@@ -289,43 +289,43 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
289289
for (i = 0; i < num_sprites; ++i) {
290290
position = &positions[i];
291291
/* 0 */
292-
verts->position.x = position->x;
293-
verts->position.y = position->y;
292+
verts->position.x = (float)position->x;
293+
verts->position.y = (float)position->y;
294294
verts->color = color;
295295
verts->tex_coord.x = 0.0f;
296296
verts->tex_coord.y = 0.0f;
297297
verts++;
298298
/* 1 */
299-
verts->position.x = position->x + position->w;
300-
verts->position.y = position->y;
299+
verts->position.x = (float)position->x + position->w;
300+
verts->position.y = (float)position->y;
301301
verts->color = color;
302302
verts->tex_coord.x = 1.0f;
303303
verts->tex_coord.y = 0.0f;
304304
verts++;
305305
/* 2 */
306-
verts->position.x = position->x + position->w;
307-
verts->position.y = position->y + position->h;
306+
verts->position.x = (float)position->x + position->w;
307+
verts->position.y = (float)position->y + position->h;
308308
verts->color = color;
309309
verts->tex_coord.x = 1.0f;
310310
verts->tex_coord.y = 1.0f;
311311
verts++;
312312
/* 0 */
313-
verts->position.x = position->x;
314-
verts->position.y = position->y;
313+
verts->position.x = (float)position->x;
314+
verts->position.y = (float)position->y;
315315
verts->color = color;
316316
verts->tex_coord.x = 0.0f;
317317
verts->tex_coord.y = 0.0f;
318318
verts++;
319319
/* 2 */
320-
verts->position.x = position->x + position->w;
321-
verts->position.y = position->y + position->h;
320+
verts->position.x = (float)position->x + position->w;
321+
verts->position.y = (float)position->y + position->h;
322322
verts->color = color;
323323
verts->tex_coord.x = 1.0f;
324324
verts->tex_coord.y = 1.0f;
325325
verts++;
326326
/* 3 */
327-
verts->position.x = position->x;
328-
verts->position.y = position->y + position->h;
327+
verts->position.x = (float)position->x;
328+
verts->position.y = (float)position->y + position->h;
329329
verts->color = color;
330330
verts->tex_coord.x = 0.0f;
331331
verts->tex_coord.y = 1.0f;
@@ -360,36 +360,36 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
360360
for (i = 0; i < num_sprites; ++i) {
361361
position = &positions[i];
362362
/* 0 */
363-
verts->position.x = position->x;
364-
verts->position.y = position->y;
363+
verts->position.x = (float)position->x;
364+
verts->position.y = (float)position->y;
365365
verts->color = color;
366366
verts->tex_coord.x = 0.0f;
367367
verts->tex_coord.y = 0.0f;
368368
verts++;
369369
/* 1 */
370-
verts->position.x = position->x + position->w;
371-
verts->position.y = position->y;
370+
verts->position.x = (float)position->x + position->w;
371+
verts->position.y = (float)position->y;
372372
verts->color = color;
373373
verts->tex_coord.x = 1.0f;
374374
verts->tex_coord.y = 0.0f;
375375
verts++;
376376
/* 2 */
377-
verts->position.x = position->x + position->w / 2.0f;
378-
verts->position.y = position->y + position->h / 2.0f;
377+
verts->position.x = (float)position->x + position->w / 2.0f;
378+
verts->position.y = (float)position->y + position->h / 2.0f;
379379
verts->color = color;
380380
verts->tex_coord.x = 0.5f;
381381
verts->tex_coord.y = 0.5f;
382382
verts++;
383383
/* 3 */
384-
verts->position.x = position->x;
385-
verts->position.y = position->y + position->h;
384+
verts->position.x = (float)position->x;
385+
verts->position.y = (float)position->y + position->h;
386386
verts->color = color;
387387
verts->tex_coord.x = 0.0f;
388388
verts->tex_coord.y = 1.0f;
389389
verts++;
390390
/* 4 */
391-
verts->position.x = position->x + position->w;
392-
verts->position.y = position->y + position->h;
391+
verts->position.x = (float)position->x + position->w;
392+
verts->position.y = (float)position->y + position->h;
393393
verts->color = color;
394394
verts->tex_coord.x = 1.0f;
395395
verts->tex_coord.y = 1.0f;

0 commit comments

Comments
 (0)