make code compatible with up-to-date build environment

These changes make it possible to compile open9x with old (avr-gcc 4.3.3, 
avr-libc 1.6.7) and up-to-date (avr-gcc 4.6.2, avr-libc 1.8.0) build
environments. See Issue 1 for more details.
This commit is contained in:
mihlit@mihlit.cz
2012-02-02 11:23:38 +00:00
parent 973b91cd3f
commit acd523e699
21 changed files with 418 additions and 400 deletions
+5 -5
View File
@@ -91,18 +91,18 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
extern uint8_t m_posVert;
extern uint8_t m_posHorz;
inline void minit(){m_posVert=m_posHorz=0;}
bool check(uint8_t event, uint8_t curr, MenuFuncP *menuTab, uint8_t menuTabSize, prog_uint8_t *subTab, uint8_t subTabMax, uint8_t maxrow);
bool check_simple(uint8_t event, uint8_t curr, MenuFuncP *menuTab, uint8_t menuTabSize, uint8_t maxrow);
bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *subTab, uint8_t subTabMax, uint8_t maxrow);
bool check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, uint8_t maxrow);
bool check_submenu_simple(uint8_t event, uint8_t maxrow);
typedef PROGMEM void (*MenuFuncP_PROGMEM)(uint8_t event);
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
#define TITLEP(pstr) lcd_putsAtt(0,0,pstr,INVERS)
#define TITLE(str) TITLEP(str)
#define MENU(title, tab, menu, lines_count, ...) \
TITLE(title); \
static prog_uint8_t APM mstate_tab[] = __VA_ARGS__; \
static const pm_uint8_t mstate_tab[] PROGMEM = __VA_ARGS__; \
if (!check(event,menu,tab,DIM(tab),mstate_tab,DIM(mstate_tab)-1,lines_count-1)) return;
#define SIMPLE_MENU_NOTITLE(tab, menu, lines_count) \
@@ -114,7 +114,7 @@ SIMPLE_MENU_NOTITLE(tab, menu, lines_count)
#define SUBMENU(title, lines_count, ...) \
TITLE(title); \
static prog_uint8_t APM mstate_tab[] = __VA_ARGS__; \
static const pm_uint8_t mstate_tab[] PROGMEM = __VA_ARGS__; \
if (!check(event,0,NULL,0,mstate_tab,DIM(mstate_tab)-1,lines_count-1)) return;
#define SIMPLE_SUBMENU_NOTITLE(lines_count) \