Skip to content

Commit e15e351

Browse files
committed
Fix compiler warnings with the DS port
1 parent b482544 commit e15e351

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

nds/ControlPane.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,16 @@ void ControlPane_Error(bool fatal,const char *fmt,...)
200200

201201
/*----------------------------------------------------------------------------*/
202202

203+
#if 0
203204
static void ControlPane_TextDrawChar(Window *window, u16 c, int x, int y)
204205
{
205206
x += window->bx;
206207
y += window->by;
207208
window->map[x + y * 32] = (1 << 12) | c;
208209
}
210+
#endif
209211

210-
static void ControlPane_TextDrawString(Window *window, const char *c, int x, int y, int w, bool centred)
212+
static void ControlPane_TextDrawString(Window *window, const char *c, int x, int y, unsigned int w, bool centred)
211213
{
212214
u16 *ptr, *last;
213215
size_t len = strlen(c);
@@ -266,7 +268,7 @@ static void ControlPane_TextDrawLineV(Window *window, u16 c, int x, int y, int h
266268
}
267269
}
268270

269-
static Window *ControlPane_CreateWindow(int layer, int w, int h, const char *title, bool scroll)
271+
static Window *ControlPane_CreateWindow(int layer, unsigned int w, unsigned int h, const char *title, bool scroll)
270272
{
271273
static const u16 TL[1*3] = {
272274
CORNERTL,
@@ -299,7 +301,8 @@ static Window *ControlPane_CreateWindow(int layer, int w, int h, const char *tit
299301
};
300302
vu16 *scrollXY = REG_BGOFFSETS_SUB + (layer * 2);
301303
Window *window;
302-
int i, mapbase;
304+
int mapbase;
305+
size_t i;
303306

304307
mapbase = 6 + (layer * 4);
305308
BGCTRL_SUB[layer] = BG_TILE_BASE(0) | BG_MAP_BASE(mapbase) | BG_COLOR_16 | BG_64x64;
@@ -372,7 +375,7 @@ static void ControlPane_CloseWindow(Window *window)
372375

373376
static void ControlPane_InitWindows(void)
374377
{
375-
int i;
378+
size_t i;
376379

377380
decompress(font_gfx, (void *)CHAR_BASE_BLOCK_SUB(0), LZ77Vram);
378381
dmaCopy(font_pal, BG_PALETTE_SUB + 16, font_pal_size);
@@ -387,7 +390,7 @@ static void ControlPane_InitWindows(void)
387390
static bool ControlPane_ClickWindow(ARMul_State *state, int px, int py)
388391
{
389392
Window *w;
390-
int i;
393+
size_t i;
391394

392395
for (i = 0; i < sizeof(windows)/sizeof(*windows); i++) {
393396
w = &windows[i];
@@ -417,7 +420,7 @@ static bool ControlPane_ClickWindow(ARMul_State *state, int px, int py)
417420

418421
static bool ControlPane_DragWindow(ARMul_State *state, int px, int py)
419422
{
420-
int newMouseX, newMouseY, xdiff, ydiff;
423+
int xdiff, ydiff;
421424
Window *w = &windows[drag_mode - DRAG_WINDOW_1];
422425
vu16 *scrollXY = REG_BGOFFSETS_SUB + (w->layer * 2);
423426

@@ -507,7 +510,6 @@ static void ControlPane_InitKeyboard(ARMul_State *state)
507510
0x5FBD,0x6F7B,0x7FFF,0x5EF7,0x5EF7,0x4E73,0x39CE,0x0000,
508511
0x6F7B,0x0000,0x0000,0x0320,0x5FBD,0x022A,0x02FF,0x7EE0
509512
};
510-
int i;
511513

512514
/* We manage sprite VRAM manually here instead of using oamAllocateGfx() */
513515
decompress(keys_gfx, SPRITE_GFX_SUB, LZ77Vram);
@@ -524,7 +526,7 @@ static void ControlPane_UpdateKeyboardLEDs(uint8_t leds)
524526
keys_caps = (leds & KBD_LED_CAPSLOCK);
525527
}
526528

527-
static bool ControlPane_ClickKeyboard(ARMul_State *state, int px, int py)
529+
static bool ControlPane_ClickKeyboard(ARMul_State *state, unsigned int px, unsigned int py)
528530
{
529531
const dvk_to_vkeybd *ktvk;
530532

@@ -547,7 +549,7 @@ static bool ControlPane_ClickKeyboard(ARMul_State *state, int px, int py)
547549

548550
static void ControlPane_ReleaseKeyboard(ARMul_State *state)
549551
{
550-
if (key_pressed != -1) {
552+
if (key_pressed != (arch_key_id)-1) {
551553
if (state)
552554
keyboard_key_changed(&KBD, key_pressed, 1);
553555
key_pressed = -1;
@@ -617,7 +619,7 @@ static bool ControlPane_ClickTouchpad(ARMul_State *state, int px, int py)
617619

618620
static bool ControlPane_DragTouchpad(ARMul_State *state, int px, int py)
619621
{
620-
int newMouseX, newMouseY, xdiff, ydiff;
622+
int xdiff, ydiff;
621623

622624
xdiff = (px - old_px) << 2;
623625
ydiff = (py - old_py) << 2;
@@ -690,7 +692,7 @@ bool ControlPane_ProcessTouchReleased(ARMul_State *state)
690692
retval = true;
691693
}
692694

693-
return false;
695+
return retval;
694696
}
695697

696698
void ControlPane_Redraw(void)

nds/DispKbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static void RefreshMouse(ARMul_State *state) {
267267

268268
oamSet(&oamMain, 0, HorizPos, VertPos, 0, 0, SpriteSize_32x64, SpriteColorFormat_16Color,
269269
cursorData, -1, false, false, false, false, false);
270-
}; /* RefreshMouse */
270+
} /* RefreshMouse */
271271

272272
/*-----------------------------------------------------------------------------*/
273273
bool
@@ -318,7 +318,7 @@ static void ProcessButtons(ARMul_State *state, int pressed, int released) {
318318
if ((released & btak->sym) && btak->kid != 0)
319319
keyboard_key_changed(&KBD, btak->kid, 1);
320320
}
321-
}; /* ProcessButtons */
321+
} /* ProcessButtons */
322322

323323
/*-----------------------------------------------------------------------------*/
324324
int

nds/KeyTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
typedef struct {
44
arch_key_id kid;
55
unsigned short sprite;
6-
short x;
7-
short y;
6+
unsigned short x;
7+
unsigned short y;
88
} dvk_to_vkeybd;
99

1010
enum {

0 commit comments

Comments
 (0)