From bb1549aad76ee096b00451ff3640748d74ab3a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sat, 10 Oct 2009 09:55:28 +0000 Subject: [PATCH] Don't cast away constness git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23064 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/option_select.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 97c2b75d1b..7d142b0311 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -112,8 +112,8 @@ const char *option_get_valuestring(const struct settings_list *setting, } else if ((setting->flags & F_T_SOUND) == F_T_SOUND) { - char sign = ' ', *unit; - unit = (char*)sound_unit(setting->sound_setting->setting); + char sign = ' '; + const char *unit = sound_unit(setting->sound_setting->setting); if (sound_numdecimals(setting->sound_setting->setting)) { int integer, dec; @@ -124,7 +124,8 @@ const char *option_get_valuestring(const struct settings_list *setting, sign = '-'; val = abs(val); } - integer = val / 10; dec = val % 10; + integer = val / 10; + dec = val % 10; snprintf(buffer, buf_len, "%c%d.%d %s", sign, integer, dec, unit); } else @@ -148,7 +149,7 @@ const char *option_get_valuestring(const struct settings_list *setting, } else { - int value= (int)temp_var; + int value = (int)temp_var; char *val = P2STR(setting->choice_setting->desc[value]); strlcpy(buffer, val, buf_len); }