summaryrefslogtreecommitdiff
path: root/arm9/src/list_menu.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-05-22 19:10:56 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-05-22 19:10:56 -0400
commit0d0f5b70b03e271d05cd30ccacddd55d75c4e530 (patch)
tree7ab7010abde683379b2cb6e63ded0dbbf4ab4388 /arm9/src/list_menu.c
parent6d1fe6e7fdb5eae0dec5ec463ddf1fac0c1316e2 (diff)
Silence compiler warnings
Diffstat (limited to 'arm9/src/list_menu.c')
-rw-r--r--arm9/src/list_menu.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/arm9/src/list_menu.c b/arm9/src/list_menu.c
index c54677a9..033d06f9 100644
--- a/arm9/src/list_menu.c
+++ b/arm9/src/list_menu.c
@@ -86,23 +86,23 @@ THUMB_FUNC s32 ListMenu_ProcessInput(struct ListMenu * list)
rightButton = FALSE;
break;
case LIST_MULTIPLE_SCROLL_DPAD:
- leftButton = gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_LEFT_MASK;
- rightButton = gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_RIGHT_MASK;
+ leftButton = (u16)(gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_LEFT_MASK);
+ rightButton = (u16)(gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_RIGHT_MASK);
break;
case LIST_MULTIPLE_SCROLL_L_R:
- leftButton = gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_L_MASK;
- rightButton = gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_R_MASK;
+ leftButton = (u16)(gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_L_MASK);
+ rightButton = (u16)(gMain.newAndRepeatedKeys & REG_PAD_KEYINPUT_R_MASK);
break;
}
if (leftButton)
{
- if (!ListMenuChangeSelection(list, TRUE, list->template.maxShowed, FALSE))
+ if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, FALSE))
list->unk_33 = 3;
return LIST_NOTHING_CHOSEN;
}
else if (rightButton)
{
- if (!ListMenuChangeSelection(list, TRUE, list->template.maxShowed, TRUE))
+ if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, TRUE))
list->unk_33 = 4;
return LIST_NOTHING_CHOSEN;
}
@@ -142,11 +142,11 @@ THUMB_FUNC s32 ListMenuTestInputInternal(struct ListMenu * list, const struct Li
if (input == REG_PAD_KEYINPUT_UP_MASK)
{
- ListMenuChangeSelection(list, updateFlag, 1, FALSE);
+ ListMenuChangeSelection(list, (u8)updateFlag, 1, FALSE);
}
else if (input == REG_PAD_KEYINPUT_DOWN_MASK)
{
- ListMenuChangeSelection(list, updateFlag, 1, TRUE);
+ ListMenuChangeSelection(list, (u8)updateFlag, 1, TRUE);
}
if (newCursorPos != NULL)
{
@@ -174,7 +174,7 @@ THUMB_FUNC void ListMenuOverrideSetColors(struct ListMenu * list, u8 cursorPal,
THUMB_FUNC void ListMenuGetCurrentItemArrayId(struct ListMenu * list, u16 * index_p)
{
- *index_p = list->cursorPos + list->itemsAbove;
+ *index_p = (u16)(list->cursorPos + list->itemsAbove);
}
THUMB_FUNC void ListMenuGetScrollAndRow(struct ListMenu * list, u16 * cursorPos_p, u16 * itemsAbove_p)
@@ -218,7 +218,7 @@ THUMB_FUNC s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr)
case 8:
return (s32)list->template.upText_Y;
case 9:
- return GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding;
+ return GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding;
case 10:
return (s32)list->template.cursorPal;
case 11:
@@ -333,7 +333,7 @@ THUMB_FUNC void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16
{
s32 i;
u8 x, y;
- u8 yMultiplier = GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding;
+ u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding);
for (i = 0; i < count; i++)
{
@@ -341,7 +341,7 @@ THUMB_FUNC void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16
x = list->template.item_X;
else
x = list->template.header_X;
- y = (yOffset + i) * yMultiplier + list->template.upText_Y;
+ y = (u8)((yOffset + i) * yMultiplier + list->template.upText_Y);
if (list->template.itemPrintFunc != NULL)
list->template.itemPrintFunc(list, list->template.items[startIndex].value, y);
ListMenuPrint(list, list->template.items[startIndex].text, x, y);
@@ -351,9 +351,9 @@ THUMB_FUNC void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16
THUMB_FUNC void ListMenuDrawCursor(struct ListMenu * list)
{
- u8 yMultiplier = GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding;
+ u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding);
u8 x = list->template.cursor_X;
- u8 y = list->itemsAbove * yMultiplier + list->template.upText_Y;
+ u8 y = (u8)(list->itemsAbove * yMultiplier + list->template.upText_Y);
switch (list->template.cursorKind)
{
case 0:
@@ -371,13 +371,13 @@ THUMB_FUNC void ListMenuErasePrintedCursor(struct ListMenu * list, u16 itemsAbov
switch (list->template.cursorKind)
{
case 0:
- u8 yMultiplier = GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding;
+ u8 yMultiplier = (u8)(GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding);
u8 width = 8;
u8 height = 16;
FillWindowPixelRect(list->template.window,
list->template.fillValue,
list->template.cursor_X,
- itemsAbove * yMultiplier + list->template.upText_Y,
+ (u16)(itemsAbove * yMultiplier + list->template.upText_Y),
width,
height);
break;
@@ -402,7 +402,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
if (list->template.maxShowed == 1)
newRow = 0;
else
- newRow = list->template.maxShowed - ((list->template.maxShowed / 2) + (list->template.maxShowed % 2)) - 1;
+ newRow = (u16)(list->template.maxShowed - ((list->template.maxShowed / 2) + (list->template.maxShowed % 2)) - 1);
if (cursorPos == 0)
{
@@ -429,7 +429,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
}
}
list->itemsAbove = newRow;
- list->cursorPos = cursorPos - 1;
+ list->cursorPos = (u16)(cursorPos - 1);
}
}
else
@@ -437,7 +437,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
if (list->template.maxShowed == 1)
newRow = 0;
else
- newRow = ((list->template.maxShowed / 2) + (list->template.maxShowed % 2));
+ newRow = (u16)((list->template.maxShowed / 2) + (list->template.maxShowed % 2));
if (cursorPos == list->template.totalItems - list->template.maxShowed)
{
@@ -464,7 +464,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
}
}
list->itemsAbove = newRow;
- list->cursorPos = cursorPos + 1;
+ list->cursorPos = (u16)(cursorPos + 1);
}
}
return 2;
@@ -479,33 +479,33 @@ THUMB_FUNC void ListMenuScroll(struct ListMenu * list, u8 count, u8 movingDown)
}
else
{
- u8 yMultiplier = GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding;
+ u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding);
if (!movingDown)
{
u16 y, width, height;
- ScrollWindow(list->template.window, 1, count * yMultiplier, (list->template.fillValue << 4) | list->template.fillValue);
+ ScrollWindow(list->template.window, 1, (u8)(count * yMultiplier), (u8)((list->template.fillValue << 4) | list->template.fillValue));
ListMenuPrintEntries(list, list->cursorPos, 0, count);
- y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y;
+ y = (u16)((list->template.maxShowed * yMultiplier) + list->template.upText_Y);
width = GetWindowWidth(list->template.window);
height = GetWindowHeight(list->template.window);
FillWindowPixelRect(list->template.window,
list->template.fillValue,
- 0, y, width * 8, height * 8 - y);
+ 0, y, (u16)(width * 8), (u16)(height * 8 - y));
}
else
{
u32 width;
- ScrollWindow(list->template.window, 0, count * yMultiplier, (list->template.fillValue << 4) | list->template.fillValue);
- ListMenuPrintEntries(list, list->cursorPos + (list->template.maxShowed - count), list->template.maxShowed - count, count);
+ ScrollWindow(list->template.window, 0, (u8)(count * yMultiplier), (u8)((list->template.fillValue << 4) | list->template.fillValue));
+ ListMenuPrintEntries(list, (u16)(list->cursorPos + (list->template.maxShowed - count)), (u16)(list->template.maxShowed - count), count);
width = GetWindowWidth(list->template.window);
FillWindowPixelRect(list->template.window,
list->template.fillValue,
- 0, 0, width * 8, list->template.upText_Y);
+ 0, 0, (u16)(width * 8), list->template.upText_Y);
}
}
}