\r
static unsigned int me_read_onoff(const menu_entry *ent)\r
{\r
- // guess var size based on mask to avoid reading too much\r
- if (ent->mask & 0xffff0000)\r
- return *(unsigned int *)ent->var & ent->mask;\r
- else if (ent->mask & 0xff00)\r
- return *(unsigned short *)ent->var & ent->mask;\r
- else\r
- return *(unsigned char *)ent->var & ent->mask;\r
+ return *(unsigned int *)ent->var & ent->mask;\r
}\r
\r
static void me_toggle_onoff(menu_entry *ent)\r
{\r
- // guess var size based on mask to avoid reading too much\r
- if (ent->mask & 0xffff0000)\r
- *(unsigned int *)ent->var ^= ent->mask;\r
- else if (ent->mask & 0xff00)\r
- *(unsigned short *)ent->var ^= ent->mask;\r
- else\r
- *(unsigned char *)ent->var ^= ent->mask;\r
+ *(unsigned int *)ent->var ^= ent->mask;\r
}\r
\r
static void me_draw(const menu_entry *entries, int sel, void (*draw_more)(void))\r
offs += (10 - len - 2) * me_mfont_w;\r
if (offs < leftname_end)\r
offs = leftname_end;\r
- if (i == *(unsigned char *)ent->var) {\r
+ if (i == *(int *)ent->var) {\r
text_out16(offs, y, "%s", names[i]);\r
break;\r
}\r
names = (const char **)entry->data;\r
for (c = 0; names[c] != NULL; c++)\r
;\r
- *(signed char *)entry->var += is_next ? 1 : -1;\r
- if (*(signed char *)entry->var < 0)\r
- *(signed char *)entry->var = 0;\r
- if (*(signed char *)entry->var >= c)\r
- *(signed char *)entry->var = c - 1;\r
+ *(int *)entry->var += is_next ? 1 : -1;\r
+ if (*(int *)entry->var < 0)\r
+ *(int *)entry->var = 0;\r
+ if (*(int *)entry->var >= c)\r
+ *(int *)entry->var = c - 1;\r
return 1;\r
default:\r
return 0;\r