forked from len0rd/rockbox
Player: Fix setting integer values to their min/max values.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12980 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
54ea2e435e
commit
81625742c9
1 changed files with 3 additions and 3 deletions
|
@ -1218,6 +1218,7 @@ bool set_int_ex(const unsigned char* string,
|
||||||
void (*formatter)(char*, int, int, const char*),
|
void (*formatter)(char*, int, int, const char*),
|
||||||
long (*get_talk_id)(int))
|
long (*get_talk_id)(int))
|
||||||
{
|
{
|
||||||
|
int count = (max-min)/step + 1;
|
||||||
#if CONFIG_KEYPAD != PLAYER_PAD
|
#if CONFIG_KEYPAD != PLAYER_PAD
|
||||||
struct value_setting_data data = {
|
struct value_setting_data data = {
|
||||||
INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL };
|
INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL };
|
||||||
|
@ -1225,10 +1226,9 @@ bool set_int_ex(const unsigned char* string,
|
||||||
data.unit = unit_strings[voice_unit];
|
data.unit = unit_strings[voice_unit];
|
||||||
else
|
else
|
||||||
data.unit = str(voice_unit);
|
data.unit = str(voice_unit);
|
||||||
return do_set_setting(string,variable,(max-min)/step + 1,
|
return do_set_setting(string,variable,count,
|
||||||
(max-*variable)/step, &data,function);
|
(max-*variable)/step, &data,function);
|
||||||
#else
|
#else
|
||||||
int count = (max-min)/step + 1;
|
|
||||||
struct value_setting_data data = {
|
struct value_setting_data data = {
|
||||||
INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL };
|
INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL };
|
||||||
if (voice_unit < UNIT_LAST)
|
if (voice_unit < UNIT_LAST)
|
||||||
|
@ -1236,7 +1236,7 @@ bool set_int_ex(const unsigned char* string,
|
||||||
else
|
else
|
||||||
data.unit = str(voice_unit);
|
data.unit = str(voice_unit);
|
||||||
return do_set_setting(string,variable,count,
|
return do_set_setting(string,variable,count,
|
||||||
count - ((max-*variable)/step), &data,function);
|
(*variable-min)/step, &data,function);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
bool set_int(const unsigned char* string,
|
bool set_int(const unsigned char* string,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue