Fixed compiler warnings using Visual Studio 2019
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index d58ef1d..23a905d 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -1459,7 +1459,7 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
}
{
- int j;
+ size_t j;
float currentColor[4];
data->glGetFloatv(GL_CURRENT_COLOR, currentColor);
data->glBegin(GL_TRIANGLES);
diff --git a/test/testsprite2.c b/test/testsprite2.c
index dc48b1e..b6ad159 100644
--- a/test/testsprite2.c
+++ b/test/testsprite2.c
@@ -188,22 +188,22 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
color.b = 0xFF;
color.a = 0xFF;
- verts[0].position.x = temp.x;
- verts[0].position.y = temp.y;
+ verts[0].position.x = (float)temp.x;
+ verts[0].position.y = (float)temp.y;
verts[0].color = color;
- verts[1].position.x = temp.x + temp.w;
- verts[1].position.y = temp.y;
+ verts[1].position.x = (float)temp.x + temp.w;
+ verts[1].position.y = (float)temp.y;
verts[1].color = color;
- verts[2].position.x = temp.x + temp.w;
- verts[2].position.y = temp.y + temp.h;
+ verts[2].position.x = (float)temp.x + temp.w;
+ verts[2].position.y = (float)temp.y + temp.h;
verts[2].color = color;
SDL_RenderGeometry(renderer, NULL, verts, 3, NULL, 0);
- verts[1].position.x = temp.x;
- verts[1].position.y = temp.y + temp.h;
+ verts[1].position.x = (float)temp.x;
+ verts[1].position.y = (float)temp.y + temp.h;
verts[1].color = color;
SDL_RenderGeometry(renderer, NULL, verts, 3, NULL, 0);
@@ -289,43 +289,43 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
for (i = 0; i < num_sprites; ++i) {
position = &positions[i];
/* 0 */
- verts->position.x = position->x;
- verts->position.y = position->y;
+ verts->position.x = (float)position->x;
+ verts->position.y = (float)position->y;
verts->color = color;
verts->tex_coord.x = 0.0f;
verts->tex_coord.y = 0.0f;
verts++;
/* 1 */
- verts->position.x = position->x + position->w;
- verts->position.y = position->y;
+ verts->position.x = (float)position->x + position->w;
+ verts->position.y = (float)position->y;
verts->color = color;
verts->tex_coord.x = 1.0f;
verts->tex_coord.y = 0.0f;
verts++;
/* 2 */
- verts->position.x = position->x + position->w;
- verts->position.y = position->y + position->h;
+ verts->position.x = (float)position->x + position->w;
+ verts->position.y = (float)position->y + position->h;
verts->color = color;
verts->tex_coord.x = 1.0f;
verts->tex_coord.y = 1.0f;
verts++;
/* 0 */
- verts->position.x = position->x;
- verts->position.y = position->y;
+ verts->position.x = (float)position->x;
+ verts->position.y = (float)position->y;
verts->color = color;
verts->tex_coord.x = 0.0f;
verts->tex_coord.y = 0.0f;
verts++;
/* 2 */
- verts->position.x = position->x + position->w;
- verts->position.y = position->y + position->h;
+ verts->position.x = (float)position->x + position->w;
+ verts->position.y = (float)position->y + position->h;
verts->color = color;
verts->tex_coord.x = 1.0f;
verts->tex_coord.y = 1.0f;
verts++;
/* 3 */
- verts->position.x = position->x;
- verts->position.y = position->y + position->h;
+ verts->position.x = (float)position->x;
+ verts->position.y = (float)position->y + position->h;
verts->color = color;
verts->tex_coord.x = 0.0f;
verts->tex_coord.y = 1.0f;
@@ -360,36 +360,36 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
for (i = 0; i < num_sprites; ++i) {
position = &positions[i];
/* 0 */
- verts->position.x = position->x;
- verts->position.y = position->y;
+ verts->position.x = (float)position->x;
+ verts->position.y = (float)position->y;
verts->color = color;
verts->tex_coord.x = 0.0f;
verts->tex_coord.y = 0.0f;
verts++;
/* 1 */
- verts->position.x = position->x + position->w;
- verts->position.y = position->y;
+ verts->position.x = (float)position->x + position->w;
+ verts->position.y = (float)position->y;
verts->color = color;
verts->tex_coord.x = 1.0f;
verts->tex_coord.y = 0.0f;
verts++;
/* 2 */
- verts->position.x = position->x + position->w / 2.0f;
- verts->position.y = position->y + position->h / 2.0f;
+ verts->position.x = (float)position->x + position->w / 2.0f;
+ verts->position.y = (float)position->y + position->h / 2.0f;
verts->color = color;
verts->tex_coord.x = 0.5f;
verts->tex_coord.y = 0.5f;
verts++;
/* 3 */
- verts->position.x = position->x;
- verts->position.y = position->y + position->h;
+ verts->position.x = (float)position->x;
+ verts->position.y = (float)position->y + position->h;
verts->color = color;
verts->tex_coord.x = 0.0f;
verts->tex_coord.y = 1.0f;
verts++;
/* 4 */
- verts->position.x = position->x + position->w;
- verts->position.y = position->y + position->h;
+ verts->position.x = (float)position->x + position->w;
+ verts->position.y = (float)position->y + position->h;
verts->color = color;
verts->tex_coord.x = 1.0f;
verts->tex_coord.y = 1.0f;