Fixed build warnings

This commit is contained in:
Sam Lantinga 2024-02-03 11:23:16 -08:00
parent c02aaebccc
commit c3e3ad6140
4 changed files with 26 additions and 26 deletions

View file

@ -150,7 +150,7 @@ static int render_testPrimitives(void *arg)
checkFailCount2 = 0;
for (y = 0; y < 3; y++) {
for (x = y % 2; x < TESTRENDER_SCREEN_W; x += 2) {
ret = SDL_SetRenderDrawColor(renderer, x * y, x * y / 2, x * y / 3, SDL_ALPHA_OPAQUE);
ret = SDL_SetRenderDrawColor(renderer, (Uint8)(x * y), (Uint8)(x * y / 2), (Uint8)(x * y / 3), SDL_ALPHA_OPAQUE);
if (ret != 0) {
checkFailCount1++;
}
@ -247,7 +247,7 @@ static int render_testPrimitivesBlend(void *arg)
checkFailCount2 = 0;
checkFailCount3 = 0;
for (i = 0; i < TESTRENDER_SCREEN_W; i += 2) {
ret = SDL_SetRenderDrawColor(renderer, 60 + 2 * i, 240 - 2 * i, 50, 3 * i);
ret = SDL_SetRenderDrawColor(renderer, (Uint8)(60 + 2 * i), (Uint8)(240 - 2 * i), 50, (Uint8)(3 * i));
if (ret != 0) {
checkFailCount1++;
}
@ -271,7 +271,7 @@ static int render_testPrimitivesBlend(void *arg)
checkFailCount2 = 0;
checkFailCount3 = 0;
for (i = 0; i < TESTRENDER_SCREEN_H; i += 2) {
ret = SDL_SetRenderDrawColor(renderer, 60 + 2 * i, 240 - 2 * i, 50, 3 * i);
ret = SDL_SetRenderDrawColor(renderer, (Uint8)(60 + 2 * i), (Uint8)(240 - 2 * i), 50, (Uint8)(3 * i));
if (ret != 0) {
checkFailCount1++;
}
@ -297,7 +297,7 @@ static int render_testPrimitivesBlend(void *arg)
checkFailCount3 = 0;
for (j = 0; j < TESTRENDER_SCREEN_H; j += 3) {
for (i = 0; i < TESTRENDER_SCREEN_W; i += 3) {
ret = SDL_SetRenderDrawColor(renderer, j * 4, i * 3, j * 4, i * 3);
ret = SDL_SetRenderDrawColor(renderer, (Uint8)(j * 4), (Uint8)(i * 3), (Uint8)(j * 4), (Uint8)(i * 3));
if (ret != 0) {
checkFailCount1++;
}
@ -485,7 +485,7 @@ static int render_testBlitColor(void *arg)
for (j = 0; j <= nj; j += 4) {
for (i = 0; i <= ni; i += 4) {
/* Set color mod. */
ret = SDL_SetTextureColorMod(tface, (255 / nj) * j, (255 / ni) * i, (255 / nj) * j);
ret = SDL_SetTextureColorMod(tface, (Uint8)((255 / nj) * j), (Uint8)((255 / ni) * i), (Uint8)((255 / nj) * j));
if (ret != 0) {
checkFailCount1++;
}
@ -562,7 +562,7 @@ static int render_testBlitAlpha(void *arg)
for (j = 0; j <= nj; j += 4) {
for (i = 0; i <= ni; i += 4) {
/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod(tface, (255 / ni) * i);
ret = SDL_SetTextureAlphaMod(tface, (Uint8)((255 / ni) * i));
if (ret != 0) {
checkFailCount1++;
}
@ -745,13 +745,13 @@ static int render_testBlitBlend(void *arg)
for (i = 0; i <= ni; i += 4) {
/* Set color mod. */
ret = SDL_SetTextureColorMod(tface, (255 / nj) * j, (255 / ni) * i, (255 / nj) * j);
ret = SDL_SetTextureColorMod(tface, (Uint8)((255 / nj) * j), (Uint8)((255 / ni) * i), (Uint8)((255 / nj) * j));
if (ret != 0) {
checkFailCount1++;
}
/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod(tface, (100 / ni) * i);
ret = SDL_SetTextureAlphaMod(tface, (Uint8)((100 / ni) * i));
if (ret != 0) {
checkFailCount2++;
}