From 90ab77af2f8d7e5c67ed963cce4045ea1e6fccf4 Mon Sep 17 00:00:00 2001 From: Jonathan Hudson Date: Mon, 7 May 2018 21:15:27 +0100 Subject: [PATCH] gcc8: further tidy up obsolete casts and macros --- src/main/cms/cms.c | 2 +- src/main/cms/cms_menu_osd.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/cms/cms.c b/src/main/cms/cms.c index 911bf47a9..661587214 100644 --- a/src/main/cms/cms.c +++ b/src/main/cms/cms.c @@ -309,7 +309,7 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, const OSD_Entry *p, uint8_t if ((p->type == OME_Submenu) && p->func && (p->flags & OPTSTRING)) { // Special case of sub menu entry with optional value display. - char *str = ((CMSMenuOptFuncPtr)p->menufunc)(); + char *str = p->menufunc(); cnt = displayWrite(pDisplay, colPos, row, str); colPos += strlen(str); } diff --git a/src/main/cms/cms_menu_osd.c b/src/main/cms/cms_menu_osd.c index 925b98fa1..6f3df6dc6 100755 --- a/src/main/cms/cms_menu_osd.c +++ b/src/main/cms/cms_menu_osd.c @@ -36,7 +36,6 @@ #include "io/osd.h" #define OSD_ITEM_ENTRY(label, item_id) ((OSD_Entry){ label, OME_Submenu, {.itemId = item_id}, &cmsx_menuOsdElementActions, 0 }) -#define OSD_ITEM_GET_ID(entry) (entry->itemId) static int osdCurrentLayout = -1; static int osdCurrentItem = -1; @@ -126,7 +125,7 @@ static CMS_Menu cmsx_menuOsdElementActions = { static long osdElemActionsOnEnter(const OSD_Entry *from) { - osdCurrentItem = OSD_ITEM_GET_ID(from); + osdCurrentItem = from->itemId; uint16_t pos = osdConfig()->item_pos[osdCurrentLayout][osdCurrentItem]; osdCurrentElementColumn = OSD_X(pos); osdCurrentElementRow = OSD_Y(pos); -- 2.11.4.GIT