diff options
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/apps/settings.c b/apps/settings.c index 6e1aa3eaec..56d59f419f 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -114,7 +114,7 @@ long lasttime = 0; | |||
114 | #define NVRAM_FILE ROCKBOX_DIR "/nvram.bin" | 114 | #define NVRAM_FILE ROCKBOX_DIR "/nvram.bin" |
115 | static char nvram_buffer[NVRAM_BLOCK_SIZE]; | 115 | static char nvram_buffer[NVRAM_BLOCK_SIZE]; |
116 | 116 | ||
117 | static bool read_nvram_data(char* buf, const int max_len) | 117 | static bool read_nvram_data(char* buf, int max_len) |
118 | { | 118 | { |
119 | unsigned crc32 = 0xffffffff; | 119 | unsigned crc32 = 0xffffffff; |
120 | int var_count = 0, i = 0, buf_pos = 0; | 120 | int var_count = 0, i = 0, buf_pos = 0; |
@@ -164,7 +164,7 @@ static bool read_nvram_data(char* buf, const int max_len) | |||
164 | } | 164 | } |
165 | return true; | 165 | return true; |
166 | } | 166 | } |
167 | static bool write_nvram_data(char* buf, const int max_len) | 167 | static bool write_nvram_data(char* buf, int max_len) |
168 | { | 168 | { |
169 | unsigned crc32 = 0xffffffff; | 169 | unsigned crc32 = 0xffffffff; |
170 | int i = 0, buf_pos = 0; | 170 | int i = 0, buf_pos = 0; |
@@ -222,7 +222,7 @@ static bool write_nvram_data(char* buf, const int max_len) | |||
222 | /* | 222 | /* |
223 | * load settings from disk or RTC RAM | 223 | * load settings from disk or RTC RAM |
224 | */ | 224 | */ |
225 | void settings_load(const int which) | 225 | void settings_load(int which) |
226 | { | 226 | { |
227 | DEBUGF( "reload_all_settings()\n" ); | 227 | DEBUGF( "reload_all_settings()\n" ); |
228 | if (which&SETTINGS_RTC) | 228 | if (which&SETTINGS_RTC) |
@@ -234,7 +234,7 @@ void settings_load(const int which) | |||
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
237 | static bool cfg_string_to_int(const int setting_id, int* out, const char* str) | 237 | static bool cfg_string_to_int(int setting_id, int* out, const char* str) |
238 | { | 238 | { |
239 | const char* start = settings[setting_id].cfg_vals; | 239 | const char* start = settings[setting_id].cfg_vals; |
240 | char* end = NULL; | 240 | char* end = NULL; |
@@ -265,7 +265,7 @@ static bool cfg_string_to_int(const int setting_id, int* out, const char* str) | |||
265 | return false; | 265 | return false; |
266 | } | 266 | } |
267 | 267 | ||
268 | bool settings_load_config(const char* file, const bool apply) | 268 | bool settings_load_config(const char* file, bool apply) |
269 | { | 269 | { |
270 | int fd; | 270 | int fd; |
271 | char line[128]; | 271 | char line[128]; |
@@ -363,7 +363,7 @@ bool settings_load_config(const char* file, const bool apply) | |||
363 | 363 | ||
364 | /** Writing to a config file and saving settings **/ | 364 | /** Writing to a config file and saving settings **/ |
365 | 365 | ||
366 | bool cfg_int_to_string(const int setting_id, const int val, char* buf, const int buf_len) | 366 | bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len) |
367 | { | 367 | { |
368 | int flags = settings[setting_id].flags; | 368 | int flags = settings[setting_id].flags; |
369 | const char* start = settings[setting_id].cfg_vals; | 369 | const char* start = settings[setting_id].cfg_vals; |
@@ -420,7 +420,7 @@ bool cfg_int_to_string(const int setting_id, const int val, char* buf, const int | |||
420 | } | 420 | } |
421 | 421 | ||
422 | 422 | ||
423 | static bool is_changed(const int setting_id) | 423 | static bool is_changed(int setting_id) |
424 | { | 424 | { |
425 | const struct settings_list *setting = &settings[setting_id]; | 425 | const struct settings_list *setting = &settings[setting_id]; |
426 | switch (setting->flags&F_T_MASK) | 426 | switch (setting->flags&F_T_MASK) |
@@ -454,7 +454,7 @@ static bool is_changed(const int setting_id) | |||
454 | return true; | 454 | return true; |
455 | } | 455 | } |
456 | 456 | ||
457 | static bool settings_write_config(const char* filename, const int options) | 457 | static bool settings_write_config(const char* filename, int options) |
458 | { | 458 | { |
459 | int i; | 459 | int i; |
460 | int fd; | 460 | int fd; |
@@ -609,7 +609,7 @@ int settings_save(void) | |||
609 | return 0; | 609 | return 0; |
610 | } | 610 | } |
611 | 611 | ||
612 | bool settings_save_config(const int options) | 612 | bool settings_save_config(int options) |
613 | { | 613 | { |
614 | char filename[MAX_PATH]; | 614 | char filename[MAX_PATH]; |
615 | char *folder; | 615 | char *folder; |
@@ -719,7 +719,7 @@ void sound_settings_apply(void) | |||
719 | #endif | 719 | #endif |
720 | } | 720 | } |
721 | 721 | ||
722 | void settings_apply(const bool read_disk) | 722 | void settings_apply(bool read_disk) |
723 | { | 723 | { |
724 | char buf[64]; | 724 | char buf[64]; |
725 | #if CONFIG_CODEC == SWCODEC | 725 | #if CONFIG_CODEC == SWCODEC |
@@ -1009,8 +1009,8 @@ bool set_bool(const char* string, const bool* variable ) | |||
1009 | 1009 | ||
1010 | 1010 | ||
1011 | bool set_bool_options(const char* string, const bool* variable, | 1011 | bool set_bool_options(const char* string, const bool* variable, |
1012 | const char* yes_str, const int yes_voice, | 1012 | const char* yes_str, int yes_voice, |
1013 | const char* no_str, const int no_voice, | 1013 | const char* no_str, int no_voice, |
1014 | void (*function)(bool)) | 1014 | void (*function)(bool)) |
1015 | { | 1015 | { |
1016 | struct opt_items names[] = { | 1016 | struct opt_items names[] = { |
@@ -1026,12 +1026,12 @@ bool set_bool_options(const char* string, const bool* variable, | |||
1026 | 1026 | ||
1027 | bool set_int(const unsigned char* string, | 1027 | bool set_int(const unsigned char* string, |
1028 | const char* unit, | 1028 | const char* unit, |
1029 | const int voice_unit, | 1029 | int voice_unit, |
1030 | const int* variable, | 1030 | const int* variable, |
1031 | void (*function)(int), | 1031 | void (*function)(int), |
1032 | const int step, | 1032 | int step, |
1033 | const int min, | 1033 | int min, |
1034 | const int max, | 1034 | int max, |
1035 | void (*formatter)(char*, size_t, int, const char*) ) | 1035 | void (*formatter)(char*, size_t, int, const char*) ) |
1036 | { | 1036 | { |
1037 | return set_int_ex(string, unit, voice_unit, variable, function, | 1037 | return set_int_ex(string, unit, voice_unit, variable, function, |
@@ -1040,12 +1040,12 @@ bool set_int(const unsigned char* string, | |||
1040 | 1040 | ||
1041 | bool set_int_ex(const unsigned char* string, | 1041 | bool set_int_ex(const unsigned char* string, |
1042 | const char* unit, | 1042 | const char* unit, |
1043 | const int voice_unit, | 1043 | int voice_unit, |
1044 | const int* variable, | 1044 | const int* variable, |
1045 | void (*function)(int), | 1045 | void (*function)(int), |
1046 | const int step, | 1046 | int step, |
1047 | const int min, | 1047 | int min, |
1048 | const int max, | 1048 | int max, |
1049 | void (*formatter)(char*, size_t, int, const char*), | 1049 | void (*formatter)(char*, size_t, int, const char*), |
1050 | int32_t (*get_talk_id)(int, int)) | 1050 | int32_t (*get_talk_id)(int, int)) |
1051 | { | 1051 | { |
@@ -1076,9 +1076,9 @@ static int32_t set_option_get_talk_id(int value, int unit) | |||
1076 | (void)unit; | 1076 | (void)unit; |
1077 | return set_option_options[value].voice_id; | 1077 | return set_option_options[value].voice_id; |
1078 | } | 1078 | } |
1079 | bool set_option(const char* string, const void* variable, const enum optiontype type, | 1079 | bool set_option(const char* string, const void* variable, enum optiontype type, |
1080 | const struct opt_items* options, | 1080 | const struct opt_items* options, |
1081 | const int numoptions, void (*function)(int)) | 1081 | int numoptions, void (*function)(int)) |
1082 | { | 1082 | { |
1083 | int temp; | 1083 | int temp; |
1084 | struct settings_list item; | 1084 | struct settings_list item; |
@@ -1108,7 +1108,7 @@ bool set_option(const char* string, const void* variable, const enum optiontype | |||
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | 1110 | ||
1111 | void set_file(const char* filename, char* setting, const int maxlen) | 1111 | void set_file(const char* filename, char* setting, int maxlen) |
1112 | { | 1112 | { |
1113 | char* fptr = strrchr(filename,'/'); | 1113 | char* fptr = strrchr(filename,'/'); |
1114 | int len; | 1114 | int len; |