From f0d5e26d554d1cb7c70e293b860d007114bf910f Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Thu, 4 Dec 2014 03:15:33 +0100 Subject: [PATCH] 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 ... --- core/rom_helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.43.0