Skip to content

Commit 401a8ce

Browse files
committed
Fix -Wunused-parameter warnings with the DS port
1 parent 434235c commit 401a8ce

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

nds/ControlPane.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ void ControlPane_Error(bool fatal,const char *fmt,...)
150150
char msg[256];
151151
Window *w;
152152
va_list args;
153+
154+
UNUSED_VAR(fatal);
155+
153156
va_start(args,fmt);
154157

155158
ControlPane_Init(NULL);
@@ -392,6 +395,8 @@ static bool ControlPane_ClickWindow(ARMul_State *state, int px, int py)
392395
Window *w;
393396
size_t i;
394397

398+
UNUSED_VAR(state);
399+
395400
for (i = 0; i < sizeof(windows)/sizeof(*windows); i++) {
396401
w = &windows[i];
397402
/* Is the window open? */
@@ -424,6 +429,8 @@ static bool ControlPane_DragWindow(ARMul_State *state, int px, int py)
424429
Window *w = &windows[drag_mode - DRAG_WINDOW_1];
425430
vu16 *scrollXY = REG_BGOFFSETS_SUB + (w->layer * 2);
426431

432+
UNUSED_VAR(state);
433+
427434
xdiff = (px - old_px);
428435
ydiff = (py - old_py);
429436

nds/DispKbd.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@
1515
#include <nds.h>
1616

1717
ARMul_State nds_statestr DTCM_BSS;
18-
void *state_alloc(int s) { return &nds_statestr; }
19-
void state_free(void *p) {}
18+
19+
void *state_alloc(int s) {
20+
UNUSED_VAR(s);
21+
return &nds_statestr;
22+
}
23+
24+
void state_free(void *p) {
25+
UNUSED_VAR(p);
26+
}
2027

2128
static inline s32 calculate_scale(s32 width, s32 height) {
2229
const s32 screenAspect = intToFixed(SCREEN_WIDTH, 8) / SCREEN_HEIGHT;
@@ -75,22 +82,29 @@ static bool PDD_Name(Host_ChangeMode)(ARMul_State *state,int width,int height,in
7582

7683
static inline void PDD_Name(Host_SetPaletteEntry)(ARMul_State *state,int i,uint_fast16_t phys)
7784
{
85+
UNUSED_VAR(state);
7886
BG_PALETTE[i] = ConvertPhysToColour(phys);
7987
}
8088

8189
static inline void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i,uint_fast16_t phys)
8290
{
8391
// TODO: Implement this!
92+
UNUSED_VAR(state);
93+
UNUSED_VAR(i);
94+
UNUSED_VAR(phys);
8495
}
8596

8697
static inline void PDD_Name(Host_SetBorderColour)(ARMul_State *state,uint_fast16_t phys)
8798
{
8899
// TODO: Implement this!
100+
UNUSED_VAR(state);
101+
UNUSED_VAR(phys);
89102
}
90103

91104
static inline PDD_Row PDD_Name(Host_BeginRow)(ARMul_State *state,int row,int offset,int *alignment)
92105
{
93106
PDD_Row drow;
107+
UNUSED_VAR(state);
94108
drow.dst = ((uint8_t *)bgGetGfxPtr(background)) + (row * PDD_MonitorWidth) + offset;
95109
drow.src = RowBuffer;
96110
drow.count = 0;
@@ -100,11 +114,14 @@ static inline PDD_Row PDD_Name(Host_BeginRow)(ARMul_State *state,int row,int off
100114

101115
static inline void PDD_Name(Host_EndRow)(ARMul_State *state,PDD_Row *row)
102116
{
117+
UNUSED_VAR(state);
118+
UNUSED_VAR(row);
103119
while (dmaBusy(3));
104120
}
105121

106122
static inline ARMword *PDD_Name(Host_BeginUpdate)(ARMul_State *state,PDD_Row *row,unsigned int count,int *outoffset)
107123
{
124+
UNUSED_VAR(state);
108125
row->count = count;
109126
*outoffset = 0;
110127
return row->src;
@@ -114,6 +131,8 @@ static inline void PDD_Name(Host_EndUpdate)(ARMul_State *state,PDD_Row *row)
114131
{
115132
unsigned int count = row->count;
116133

134+
UNUSED_VAR(state);
135+
117136
DC_FlushRange(row->src, count>>3);
118137
while (dmaBusy(3));
119138
dmaCopyWordsAsynch(3, row->src, row->dst, count>>3);
@@ -123,13 +142,15 @@ static inline void PDD_Name(Host_EndUpdate)(ARMul_State *state,PDD_Row *row)
123142

124143
static inline void PDD_Name(Host_TransferUpdate)(ARMul_State *state,PDD_Row *row,unsigned int count,const ARMword *src)
125144
{
145+
UNUSED_VAR(state);
126146
DC_FlushRange(src, count>>3);
127147
while (dmaBusy(3));
128148
dmaCopyWordsAsynch(3, src, row->dst, count>>3);
129149
}
130150

131151
static inline void PDD_Name(Host_AdvanceRow)(ARMul_State *state,PDD_Row *row,unsigned int count)
132152
{
153+
UNUSED_VAR(state);
133154
row->dst += count>>3;
134155
}
135156

@@ -144,6 +165,11 @@ static inline void PDD_Name(Host_PollDisplay)(ARMul_State *state)
144165
static inline void PDD_Name(Host_DrawBorderRect)(ARMul_State *state,int x,int y,int width,int height)
145166
{
146167
// TODO: Implement this!
168+
UNUSED_VAR(state);
169+
UNUSED_VAR(x);
170+
UNUSED_VAR(y);
171+
UNUSED_VAR(width);
172+
UNUSED_VAR(height);
147173
}
148174

149175
#include "../arch/paldisplaydev.c"
@@ -152,6 +178,8 @@ static bool PDD_Name(Host_ChangeMode)(ARMul_State *state,int width,int height,in
152178
{
153179
s32 xs, ys;
154180

181+
UNUSED_VAR(hz);
182+
155183
if((width > PDD_MonitorWidth) || (height > PDD_MonitorHeight))
156184
{
157185
ControlPane_Error(false,"Mode %dx%d too big\n",width,height);

nds/filecalls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
FILE *File_OpenAppData(const char *sName, const char *sMode)
2222
{
23+
UNUSED_VAR(sName);
24+
UNUSED_VAR(sMode);
2325
return NULL;
2426
}
2527

0 commit comments

Comments
 (0)