From: Nathael Pajani Date: Thu, 4 Dec 2014 02:15:33 +0000 (+0100) Subject: Remove warning on some gcc versions (thanks Alexandre) Add typedef for one of the... X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=f0d5e26d554d1cb7c70e293b860d007114bf910f;p=soft%2Flpc122x%2Fcore Remove warning on some gcc versions (thanks Alexandre) Add typedef for one of the very rare cases in which a typedef makes things somehow more readable, and this still can be discussed ... --- diff --git a/core/rom_helpers.c b/core/rom_helpers.c index bc3ad3d..263b157 100644 --- a/core/rom_helpers.c +++ b/core/rom_helpers.c @@ -108,7 +108,8 @@ enum iap_commands { IAP_CMD_ERASE_INFO_PAGE = 60, }; -void (*iap_entry)(unsigned int*, unsigned int*); +typedef void (*iap_entry_func)(uint32_t*, uint32_t*); +iap_entry_func iap_entry; static uint32_t params[5]; static uint32_t results[4]; @@ -187,6 +188,6 @@ uint32_t iap_read_part_id(void) void rom_helpers_init(void) { rom_div_helpers = *((struct lpc_rom_div_helpers**)LPC_122x_DIV_ROM_LOC); - iap_entry = *((void(*)(unsigned int*, unsigned int*))LPC_122x_IAP_ROM_LOC); + iap_entry = (iap_entry_func)LPC_122x_IAP_ROM_LOC; }