From 6ee34cb53b487da8167821e01975a77be3a42f9e Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 15 Mar 2008 11:12:16 +0000 Subject: [PATCH] Small bin-size optimisation - convert a macro used six times to a function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16675 a1c6a512-1295-4272-9138-f99709370657 --- apps/misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/misc.c b/apps/misc.c index 9b8c9a7364..daf9471def 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -1081,8 +1081,11 @@ void setvol(void) * Helper function to convert a string of 6 hex digits to a native colour */ -#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \ - (toupper(c)) - 'A' + 10) +static int hex2dec(int c) +{ + return (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : + (toupper(c)) - 'A' + 10); +} int hex_to_rgb(const char* hex) { int ok = 1;