Get rid of basic warnings found with -Wextra
- Signed/unsigned compares - static not being before const
This commit is contained in:
parent
bf19ebc428
commit
30bb85a4ef
@ -26,7 +26,7 @@ inline char* strupper(const char* str) {
|
|||||||
const size_t string_len = strlen(str);
|
const size_t string_len = strlen(str);
|
||||||
char* buffer = (char*)malloc(string_len + 1);
|
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]);
|
buffer[i] = toupper((unsigned)str[i]);
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
@ -36,7 +36,7 @@ inline char* strlower(const char* str) {
|
|||||||
const size_t string_len = strlen(str);
|
const size_t string_len = strlen(str);
|
||||||
char* buffer = (char*)malloc(string_len + 1);
|
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]);
|
buffer[i] = tolower((unsigned)str[i]);
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
@ -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)
|
void DrawString(unsigned char *screen, const char *str, int x, int y, int color, int bgcolor)
|
||||||
{
|
{
|
||||||
int i;
|
const size_t string_len = strlen(str);
|
||||||
for (i = 0; i < strlen(str); i++)
|
|
||||||
|
for (size_t i = 0; i < string_len; i++)
|
||||||
DrawCharacter(screen, str[i], x + i * 8, y, color, bgcolor);
|
DrawCharacter(screen, str[i], x + i * 8, y, color, bgcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,20 +4,20 @@
|
|||||||
|
|
||||||
void NTR_CmdReset()
|
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);
|
NTR_SendCommand(reset_cmd, 0x2000, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int NTR_CmdGetCartId()
|
int NTR_CmdGetCartId()
|
||||||
{
|
{
|
||||||
int id;
|
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);
|
NTR_SendCommand(getid_cmd, 0x4, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), &id);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NTR_CmdEnter16ByteMode()
|
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);
|
NTR_SendCommand(enter16bytemode_cmd, 0x0, 0, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user