summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-01-29 13:32:41 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-01-29 13:32:41 +0000
commit1382f78b7e82d52d2bd0e282a941131838f5c7d3 (patch)
tree08249f64e5897dac06679616ad277982c05544d4
parent41bd24e7dc595f8f3ffdc8a81567293010f88e75 (diff)
downloadrockbox-1382f78b7e82d52d2bd0e282a941131838f5c7d3.zip
rockbox-1382f78b7e82d52d2bd0e282a941131838f5c7d3.tar.gz
rockbox-1382f78b7e82d52d2bd0e282a941131838f5c7d3.tar.bz2
rockbox-1382f78b7e82d52d2bd0e282a941131838f5c7d3.tar.xz
fix build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12143 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/settings.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/apps/settings.c b/apps/settings.c
index b0f016e..748d427 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -227,7 +227,38 @@ void settings_load(int which)
settings_load_config(FIXEDSETTINGSFILE,false);
}
}
+#ifdef HAVE_LCD_COLOR
+/*
+ * 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 hex_to_rgb(const char* hex)
+{ int ok = 1;
+ int i;
+ int red, green, blue;
+ if (strlen(hex) == 6) {
+ for (i=0; i < 6; i++ ) {
+ if (!isxdigit(hex[i])) {
+ ok=0;
+ break;
+ }
+ }
+
+ if (ok) {
+ red = (hex2dec(hex[0]) << 4) | hex2dec(hex[1]);
+ green = (hex2dec(hex[2]) << 4) | hex2dec(hex[3]);
+ blue = (hex2dec(hex[4]) << 4) | hex2dec(hex[5]);
+ return LCD_RGBPACK(red,green,blue);
+ }
+ }
+
+ return 0;
+}
+#endif /* HAVE_LCD_COLOR */
static bool cfg_string_to_int(int setting_id, int* out, char* str)
{
@@ -345,38 +376,7 @@ bool settings_load_config(const char* file, bool apply)
}
/** Writing to a config file and saving settings **/
-#ifdef HAVE_LCD_COLOR
-/*
- * 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 hex_to_rgb(const char* hex)
-{ int ok = 1;
- int i;
- int red, green, blue;
- if (strlen(hex) == 6) {
- for (i=0; i < 6; i++ ) {
- if (!isxdigit(hex[i])) {
- ok=0;
- break;
- }
- }
-
- if (ok) {
- red = (hex2dec(hex[0]) << 4) | hex2dec(hex[1]);
- green = (hex2dec(hex[2]) << 4) | hex2dec(hex[3]);
- blue = (hex2dec(hex[4]) << 4) | hex2dec(hex[5]);
- return LCD_RGBPACK(red,green,blue);
- }
- }
-
- return 0;
-}
-#endif /* HAVE_LCD_COLOR */
static bool cfg_int_to_string(int setting_id, int val, char* buf)
{
const char* start = settings[setting_id].cfg_vals;