diff options
| author | Ray <[email protected]> | 2024-02-13 15:58:02 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2024-02-13 15:58:02 +0100 |
| commit | 401c5a86380f0e06cf30f1b75cff102f460fc98d (patch) | |
| tree | e0d035232a05799faa921f402ca54da0ecdc672a /src | |
| parent | bb741f53a8678914b4194b998b6c1d8a923bcae5 (diff) | |
| download | raylib-401c5a86380f0e06cf30f1b75cff102f460fc98d.tar.gz raylib-401c5a86380f0e06cf30f1b75cff102f460fc98d.zip | |
Minor tweaks to avoid some CodeQL warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 2 | ||||
| -rw-r--r-- | src/rtext.c | 25 |
2 files changed, 8 insertions, 19 deletions
diff --git a/src/rcore.c b/src/rcore.c index 84e05e23..0cbe3c81 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -362,7 +362,7 @@ static int screenshotCounter = 0; // Screenshots counter #endif #if defined(SUPPORT_GIF_RECORDING) -int gifFrameCounter = 0; // GIF frames counter +unsigned int gifFrameCounter = 0; // GIF frames counter bool gifRecording = false; // GIF recording state MsfGifState gifState = { 0 }; // MSGIF context state #endif diff --git a/src/rtext.c b/src/rtext.c index 12be73e7..91f5570a 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2264,23 +2264,12 @@ static Font LoadBMFont(const char *fileName) #if defined(SUPPORT_FILEFORMAT_BDF) // Convert hexadecimal to decimal (single digit) -static char HexToInt(char hex) { - if (hex >= '0' && hex <= '9') - { - return hex - '0'; - } - else if (hex >= 'a' && hex <= 'f') - { - return hex - 'a' + 10; - } - else if (hex >= 'A' && hex <= 'F') - { - return hex - 'A' + 10; - } - else - { - return 0; - } +static unsigned char HexToInt(char hex) +{ + if (hex >= '0' && hex <= '9') return hex - '0'; + else if (hex >= 'a' && hex <= 'f') return hex - 'a' + 10; + else if (hex >= 'A' && hex <= 'F') return hex - 'A' + 10; + else return 0; } // Load font data for further use @@ -2365,7 +2354,7 @@ static GlyphInfo *LoadFontDataBDF(const unsigned char *fileData, int dataSize, i for (int x = 0; x < readBytes; x++) { - char byte = HexToInt(buffer[x]); + unsigned char byte = HexToInt(buffer[x]); for (int bitX = 0; bitX < 4; bitX++) { |
