diff options
| author | Nils Wallménius <nils@rockbox.org> | 2009-10-10 09:55:28 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2009-10-10 09:55:28 +0000 |
| commit | bb1549aad76ee096b00451ff3640748d74ab3a08 (patch) | |
| tree | c9c9dea67a234e41ced3316b66aa8913d5f0d8cb /apps/gui/option_select.c | |
| parent | 3c1e2c1777485909f29913d1ba6e60ac27fa3893 (diff) | |
| download | rockbox-bb1549aad76ee096b00451ff3640748d74ab3a08.zip rockbox-bb1549aad76ee096b00451ff3640748d74ab3a08.tar.gz rockbox-bb1549aad76ee096b00451ff3640748d74ab3a08.tar.bz2 rockbox-bb1549aad76ee096b00451ff3640748d74ab3a08.tar.xz | |
Don't cast away constness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23064 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/option_select.c')
| -rw-r--r-- | apps/gui/option_select.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 97c2b75..7d142b0 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); } |