fixed build rwops (#6818)

* Fixed build
This commit is contained in:
Sylvain Becker
2022-12-15 10:06:15 +01:00
committed by GitHub
parent c637031294
commit 1e6d4649c0
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -440,7 +440,7 @@ int rwops_testCompareRWFromMemWithRWFromFile(void)
/* Read/seek from memory */ /* Read/seek from memory */
rwops_mem = SDL_RWFromMem((void *)RWopsAlphabetString, slen); rwops_mem = SDL_RWFromMem((void *)RWopsAlphabetString, slen);
SDLTest_AssertPass("Call to SDL_RWFromMem()"); SDLTest_AssertPass("Call to SDL_RWFromMem()");
rv_mem = SDL_RWread(rwops_mem, buffer_mem, size * 6); rv_mem = (size_t)SDL_RWread(rwops_mem, buffer_mem, size * 6);
SDLTest_AssertPass("Call to SDL_RWread(mem, size=%d)", size * 6); SDLTest_AssertPass("Call to SDL_RWread(mem, size=%d)", size * 6);
sv_mem = SDL_RWseek(rwops_mem, 0, SEEK_END); sv_mem = SDL_RWseek(rwops_mem, 0, SEEK_END);
SDLTest_AssertPass("Call to SDL_RWseek(mem,SEEK_END)"); SDLTest_AssertPass("Call to SDL_RWseek(mem,SEEK_END)");
@@ -451,7 +451,7 @@ int rwops_testCompareRWFromMemWithRWFromFile(void)
/* Read/see from file */ /* Read/see from file */
rwops_file = SDL_RWFromFile(RWopsAlphabetFilename, "r"); rwops_file = SDL_RWFromFile(RWopsAlphabetFilename, "r");
SDLTest_AssertPass("Call to SDL_RWFromFile()"); SDLTest_AssertPass("Call to SDL_RWFromFile()");
rv_file = SDL_RWread(rwops_file, buffer_file, size * 6); rv_file = (size_t)SDL_RWread(rwops_file, buffer_file, size * 6);
SDLTest_AssertPass("Call to SDL_RWread(file, size=%d)", size * 6); SDLTest_AssertPass("Call to SDL_RWread(file, size=%d)", size * 6);
sv_file = SDL_RWseek(rwops_file, 0, SEEK_END); sv_file = SDL_RWseek(rwops_file, 0, SEEK_END);
SDLTest_AssertPass("Call to SDL_RWseek(file,SEEK_END)"); SDLTest_AssertPass("Call to SDL_RWseek(file,SEEK_END)");
+3 -3
View File
@@ -145,7 +145,7 @@ static int unifont_init(const char *fontname)
Uint8 glyphWidth; Uint8 glyphWidth;
Uint32 codepoint; Uint32 codepoint;
bytesRead = SDL_RWread(hexFile, hexBuffer, 9); bytesRead = (size_t)SDL_RWread(hexFile, hexBuffer, 9);
if (numGlyphs > 0 && bytesRead == 0) { if (numGlyphs > 0 && bytesRead == 0) {
break; /* EOF */ break; /* EOF */
} }
@@ -181,7 +181,7 @@ static int unifont_init(const char *fontname)
if (codepointHexSize < 8) { if (codepointHexSize < 8) {
SDL_memmove(hexBuffer, hexBuffer + codepointHexSize + 1, bytesOverread); SDL_memmove(hexBuffer, hexBuffer + codepointHexSize + 1, bytesOverread);
} }
bytesRead = SDL_RWread(hexFile, hexBuffer + bytesOverread, 33 - bytesOverread); bytesRead = (size_t)SDL_RWread(hexFile, hexBuffer + bytesOverread, 33 - bytesOverread);
if (bytesRead < (33 - bytesOverread)) { if (bytesRead < (33 - bytesOverread)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n");
return -1; return -1;
@@ -190,7 +190,7 @@ static int unifont_init(const char *fontname)
glyphWidth = 8; glyphWidth = 8;
} else { } else {
glyphWidth = 16; glyphWidth = 16;
bytesRead = SDL_RWread(hexFile, hexBuffer + 33, 32); bytesRead = (size_t)SDL_RWread(hexFile, hexBuffer + 33, 32);
if (bytesRead < 32) { if (bytesRead < 32) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n");
return -1; return -1;