Get rid of basic warnings found with -Wextra

- Signed/unsigned compares
- static not being before const
This commit is contained in:
Lioncash 2015-05-11 10:33:33 -04:00
parent bf19ebc428
commit 30bb85a4ef
3 changed files with 9 additions and 8 deletions

View File

@ -26,7 +26,7 @@ inline char* strupper(const char* str) {
const size_t string_len = strlen(str);
char* buffer = (char*)malloc(string_len + 1);
for (int i = 0; i < string_len; ++i)
for (size_t i = 0; i < string_len; ++i)
buffer[i] = toupper((unsigned)str[i]);
return buffer;
@ -36,7 +36,7 @@ inline char* strlower(const char* str) {
const size_t string_len = strlen(str);
char* buffer = (char*)malloc(string_len + 1);
for (int i = 0; i < string_len; ++i)
for (size_t i = 0; i < string_len; ++i)
buffer[i] = tolower((unsigned)str[i]);
return buffer;

View File

@ -45,8 +45,9 @@ void DrawCharacter(unsigned char *screen, int character, int x, int y, int color
void DrawString(unsigned char *screen, const char *str, int x, int y, int color, int bgcolor)
{
int i;
for (i = 0; i < strlen(str); i++)
const size_t string_len = strlen(str);
for (size_t i = 0; i < string_len; i++)
DrawCharacter(screen, str[i], x + i * 8, y, color, bgcolor);
}

View File

@ -4,20 +4,20 @@
void NTR_CmdReset()
{
const static u32 reset_cmd[2] = { 0x9F000000, 0x00000000 };
static const u32 reset_cmd[2] = { 0x9F000000, 0x00000000 };
NTR_SendCommand(reset_cmd, 0x2000, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), NULL);
}
int NTR_CmdGetCartId()
{
int id;
const static u32 getid_cmd[2] = { 0x90000000, 0x00000000 };
static const u32 getid_cmd[2] = { 0x90000000, 0x00000000 };
NTR_SendCommand(getid_cmd, 0x4, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), &id);
return id;
}
void NTR_CmdEnter16ByteMode()
{
const static u32 enter16bytemode_cmd[2] = { 0x3E000000, 0x00000000 };
static const u32 enter16bytemode_cmd[2] = { 0x3E000000, 0x00000000 };
NTR_SendCommand(enter16bytemode_cmd, 0x0, 0, NULL);
}