diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 6 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 2 | ||||
-rw-r--r-- | apps/menu.c | 8 | ||||
-rw-r--r-- | apps/menus/recording_menu.c | 20 | ||||
-rw-r--r-- | apps/plugin.c | 12 | ||||
-rw-r--r-- | apps/plugin.h | 18 | ||||
-rw-r--r-- | apps/plugins/lib/playback_control.c | 6 | ||||
-rw-r--r-- | apps/plugins/rockboy/menu.c | 2 | ||||
-rw-r--r-- | apps/plugins/xworld/sys.c | 2 | ||||
-rw-r--r-- | apps/settings.c | 31 | ||||
-rw-r--r-- | apps/settings.h | 4 | ||||
-rw-r--r-- | apps/settings_list.c | 6 | ||||
-rw-r--r-- | apps/shortcuts.c | 2 | ||||
-rw-r--r-- | apps/talk.c | 2 |
14 files changed, 55 insertions, 66 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 435bad9e1f..ad5fa48756 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -823,7 +823,7 @@ static int parse_setting_and_lang(struct skin_element *element, | |||
823 | else | 823 | else |
824 | { | 824 | { |
825 | #ifndef __PCTOOL__ | 825 | #ifndef __PCTOOL__ |
826 | const struct settings_list *setting = find_setting_by_cfgname(temp, NULL); | 826 | const struct settings_list *setting = find_setting_by_cfgname(temp); |
827 | if (!setting) | 827 | if (!setting) |
828 | return WPS_ERROR_INVALID_PARAM; | 828 | return WPS_ERROR_INVALID_PARAM; |
829 | 829 | ||
@@ -1158,7 +1158,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
1158 | param++; | 1158 | param++; |
1159 | text = SKINOFFSETTOPTR(skin_buffer, param->data.text); | 1159 | text = SKINOFFSETTOPTR(skin_buffer, param->data.text); |
1160 | #ifndef __PCTOOL__ | 1160 | #ifndef __PCTOOL__ |
1161 | pb->setting = find_setting_by_cfgname(text, NULL); | 1161 | pb->setting = find_setting_by_cfgname(text); |
1162 | if (!pb->setting) | 1162 | if (!pb->setting) |
1163 | return WPS_ERROR_INVALID_PARAM; | 1163 | return WPS_ERROR_INVALID_PARAM; |
1164 | #endif | 1164 | #endif |
@@ -1548,7 +1548,7 @@ static int touchregion_setup_setting(struct skin_element *element, int param_no, | |||
1548 | #ifndef __PCTOOL__ | 1548 | #ifndef __PCTOOL__ |
1549 | int p = param_no; | 1549 | int p = param_no; |
1550 | char *name = get_param_text(element, p++); | 1550 | char *name = get_param_text(element, p++); |
1551 | const struct settings_list *setting = find_setting_by_cfgname(name, NULL); | 1551 | const struct settings_list *setting = find_setting_by_cfgname(name); |
1552 | if (!setting) | 1552 | if (!setting) |
1553 | return WPS_ERROR_INVALID_PARAM; | 1553 | return WPS_ERROR_INVALID_PARAM; |
1554 | 1554 | ||
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index 27b82e6608..b952709562 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -300,7 +300,7 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) | |||
300 | case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */ | 300 | case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */ |
301 | { | 301 | { |
302 | const struct settings_list *rep_setting = | 302 | const struct settings_list *rep_setting = |
303 | find_setting(&global_settings.repeat_mode, NULL); | 303 | find_setting(&global_settings.repeat_mode); |
304 | option_select_next_val(rep_setting, false, true); | 304 | option_select_next_val(rep_setting, false, true); |
305 | audio_flush_and_reload_tracks(); | 305 | audio_flush_and_reload_tracks(); |
306 | returncode = ACTION_REDRAW; | 306 | returncode = ACTION_REDRAW; |
diff --git a/apps/menu.c b/apps/menu.c index f317f579a4..df2284be12 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -147,7 +147,7 @@ static const char* get_menu_item_name(int selected_item, | |||
147 | type = (menu->flags&MENU_TYPE_MASK); | 147 | type = (menu->flags&MENU_TYPE_MASK); |
148 | if ((type == MT_SETTING) || (type == MT_SETTING_W_TEXT)) | 148 | if ((type == MT_SETTING) || (type == MT_SETTING_W_TEXT)) |
149 | { | 149 | { |
150 | const struct settings_list *v = find_setting(menu->variable, NULL); | 150 | const struct settings_list *v = find_setting(menu->variable); |
151 | if (v) | 151 | if (v) |
152 | return str(v->lang_id); | 152 | return str(v->lang_id); |
153 | else return "Not Done yet!"; | 153 | else return "Not Done yet!"; |
@@ -356,14 +356,12 @@ void do_setting_from_menu(const struct menu_item_ex *temp, | |||
356 | struct viewport parent[NB_SCREENS]) | 356 | struct viewport parent[NB_SCREENS]) |
357 | { | 357 | { |
358 | char *title; | 358 | char *title; |
359 | int setting_id; | ||
360 | if (!temp) | 359 | if (!temp) |
361 | { | 360 | { |
362 | panicf("do_setting_from_menu, NULL pointer"); | 361 | panicf("do_setting_from_menu, NULL pointer"); |
363 | return; | 362 | return; |
364 | } | 363 | } |
365 | const struct settings_list *setting = | 364 | const struct settings_list *setting = find_setting(temp->variable); |
366 | find_setting(temp->variable, &setting_id); | ||
367 | 365 | ||
368 | if ((temp->flags&MENU_TYPE_MASK) == MT_SETTING_W_TEXT) | 366 | if ((temp->flags&MENU_TYPE_MASK) == MT_SETTING_W_TEXT) |
369 | title = temp->callback_and_desc->desc; | 367 | title = temp->callback_and_desc->desc; |
@@ -523,7 +521,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
523 | ID2P(LANG_RESET_SETTING)); | 521 | ID2P(LANG_RESET_SETTING)); |
524 | const struct menu_item_ex *context_menu; | 522 | const struct menu_item_ex *context_menu; |
525 | const struct settings_list *setting = | 523 | const struct settings_list *setting = |
526 | find_setting(temp->variable, NULL); | 524 | find_setting(temp->variable); |
527 | #ifdef HAVE_QUICKSCREEN | 525 | #ifdef HAVE_QUICKSCREEN |
528 | if (is_setting_quickscreenable(setting)) | 526 | if (is_setting_quickscreenable(setting)) |
529 | context_menu = &quickscreen_able_option; | 527 | context_menu = &quickscreen_able_option; |
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c index 5439c861f4..4d9f24d643 100644 --- a/apps/menus/recording_menu.c +++ b/apps/menus/recording_menu.c | |||
@@ -462,30 +462,30 @@ int rectrigger(void) | |||
462 | /* TODO: what to do if there is < 4 lines on the screen? */ | 462 | /* TODO: what to do if there is < 4 lines on the screen? */ |
463 | 463 | ||
464 | settings[TRIGGER_MODE] = | 464 | settings[TRIGGER_MODE] = |
465 | find_setting(&global_settings.rec_trigger_mode, NULL); | 465 | find_setting(&global_settings.rec_trigger_mode); |
466 | settings[TRIGGER_TYPE] = | 466 | settings[TRIGGER_TYPE] = |
467 | find_setting(&global_settings.rec_trigger_type, NULL); | 467 | find_setting(&global_settings.rec_trigger_type); |
468 | settings[PRERECORD_TIME] = | 468 | settings[PRERECORD_TIME] = |
469 | find_setting(&global_settings.rec_prerecord_time, NULL); | 469 | find_setting(&global_settings.rec_prerecord_time); |
470 | settings[START_DURATION] = | 470 | settings[START_DURATION] = |
471 | find_setting(&global_settings.rec_start_duration, NULL); | 471 | find_setting(&global_settings.rec_start_duration); |
472 | settings[STOP_POSTREC] = | 472 | settings[STOP_POSTREC] = |
473 | find_setting(&global_settings.rec_stop_postrec, NULL); | 473 | find_setting(&global_settings.rec_stop_postrec); |
474 | settings[STOP_GAP] = | 474 | settings[STOP_GAP] = |
475 | find_setting(&global_settings.rec_stop_gap, NULL); | 475 | find_setting(&global_settings.rec_stop_gap); |
476 | if (global_settings.peak_meter_dbfs) /* show the dB settings */ | 476 | if (global_settings.peak_meter_dbfs) /* show the dB settings */ |
477 | { | 477 | { |
478 | settings[START_THRESHOLD] = | 478 | settings[START_THRESHOLD] = |
479 | find_setting(&global_settings.rec_start_thres_db, NULL); | 479 | find_setting(&global_settings.rec_start_thres_db); |
480 | settings[STOP_THRESHOLD] = | 480 | settings[STOP_THRESHOLD] = |
481 | find_setting(&global_settings.rec_stop_thres_db, NULL); | 481 | find_setting(&global_settings.rec_stop_thres_db); |
482 | } | 482 | } |
483 | else | 483 | else |
484 | { | 484 | { |
485 | settings[START_THRESHOLD] = | 485 | settings[START_THRESHOLD] = |
486 | find_setting(&global_settings.rec_start_thres_linear, NULL); | 486 | find_setting(&global_settings.rec_start_thres_linear); |
487 | settings[STOP_THRESHOLD] = | 487 | settings[STOP_THRESHOLD] = |
488 | find_setting(&global_settings.rec_stop_thres_linear, NULL); | 488 | find_setting(&global_settings.rec_stop_thres_linear); |
489 | } | 489 | } |
490 | gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp); | 490 | gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp); |
491 | gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2); | 491 | gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2); |
diff --git a/apps/plugin.c b/apps/plugin.c index f0667b7e9d..feba0f2cfc 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -669,10 +669,13 @@ static const struct plugin_api rockbox_api = { | |||
669 | tagcache_retrieve, | 669 | tagcache_retrieve, |
670 | tagcache_search_finish, | 670 | tagcache_search_finish, |
671 | tagcache_get_numeric, | 671 | tagcache_get_numeric, |
672 | #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) | 672 | tagcache_get_stat, |
673 | #if defined(HAVE_TC_RAMCACHE) | ||
674 | tagcache_is_in_ram, | ||
675 | #if defined(HAVE_DIRCACHE) | ||
673 | tagcache_fill_tags, | 676 | tagcache_fill_tags, |
674 | #endif | 677 | #endif |
675 | tagcache_get_stat, | 678 | #endif |
676 | #endif /* HAVE_TAGCACHE */ | 679 | #endif /* HAVE_TAGCACHE */ |
677 | 680 | ||
678 | #ifdef HAVE_ALBUMART | 681 | #ifdef HAVE_ALBUMART |
@@ -820,11 +823,6 @@ static const struct plugin_api rockbox_api = { | |||
820 | 823 | ||
821 | /* new stuff at the end, sort into place next time | 824 | /* new stuff at the end, sort into place next time |
822 | the API gets incompatible */ | 825 | the API gets incompatible */ |
823 | #ifdef HAVE_TAGCACHE | ||
824 | #ifdef HAVE_TC_RAMCACHE | ||
825 | tagcache_is_in_ram, | ||
826 | #endif | ||
827 | #endif | ||
828 | }; | 826 | }; |
829 | 827 | ||
830 | static int plugin_buffer_handle; | 828 | static int plugin_buffer_handle; |
diff --git a/apps/plugin.h b/apps/plugin.h index e2a821bb57..62d8371e7d 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -157,12 +157,12 @@ int plugin_open(const char *plugin, const char *parameter); | |||
157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
158 | 158 | ||
159 | /* increase this every time the api struct changes */ | 159 | /* increase this every time the api struct changes */ |
160 | #define PLUGIN_API_VERSION 256 | 160 | #define PLUGIN_API_VERSION 257 |
161 | 161 | ||
162 | /* update this to latest version if a change to the api struct breaks | 162 | /* update this to latest version if a change to the api struct breaks |
163 | backwards compatibility (and please take the opportunity to sort in any | 163 | backwards compatibility (and please take the opportunity to sort in any |
164 | new function which are "waiting" at the end of the function table) */ | 164 | new function which are "waiting" at the end of the function table) */ |
165 | #define PLUGIN_MIN_API_VERSION 255 | 165 | #define PLUGIN_MIN_API_VERSION 257 |
166 | 166 | ||
167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ | 167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ |
168 | 168 | ||
@@ -766,10 +766,13 @@ struct plugin_api { | |||
766 | int tag, char *buf, long size); | 766 | int tag, char *buf, long size); |
767 | void (*tagcache_search_finish)(struct tagcache_search *tcs); | 767 | void (*tagcache_search_finish)(struct tagcache_search *tcs); |
768 | long (*tagcache_get_numeric)(const struct tagcache_search *tcs, int tag); | 768 | long (*tagcache_get_numeric)(const struct tagcache_search *tcs, int tag); |
769 | #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) | 769 | struct tagcache_stat* (*tagcache_get_stat)(void); |
770 | #if defined(HAVE_TC_RAMCACHE) | ||
771 | bool (*tagcache_is_in_ram)(void); | ||
772 | #if defined(HAVE_DIRCACHE) | ||
770 | bool (*tagcache_fill_tags)(struct mp3entry *id3, const char *filename); | 773 | bool (*tagcache_fill_tags)(struct mp3entry *id3, const char *filename); |
771 | #endif | 774 | #endif |
772 | struct tagcache_stat* (*tagcache_get_stat)(void); | 775 | #endif |
773 | #endif /* HAVE_TAGCACHE */ | 776 | #endif /* HAVE_TAGCACHE */ |
774 | 777 | ||
775 | #ifdef HAVE_ALBUMART | 778 | #ifdef HAVE_ALBUMART |
@@ -824,7 +827,7 @@ struct plugin_api { | |||
824 | 827 | ||
825 | /* options */ | 828 | /* options */ |
826 | const struct settings_list* (*get_settings_list)(int*count); | 829 | const struct settings_list* (*get_settings_list)(int*count); |
827 | const struct settings_list* (*find_setting)(const void* variable, int *id); | 830 | const struct settings_list* (*find_setting)(const void* variable); |
828 | int (*settings_save)(void); | 831 | int (*settings_save)(void); |
829 | bool (*option_screen)(const struct settings_list *setting, | 832 | bool (*option_screen)(const struct settings_list *setting, |
830 | struct viewport parent[NB_SCREENS], | 833 | struct viewport parent[NB_SCREENS], |
@@ -946,11 +949,6 @@ struct plugin_api { | |||
946 | #endif | 949 | #endif |
947 | /* new stuff at the end, sort into place next time | 950 | /* new stuff at the end, sort into place next time |
948 | the API gets incompatible */ | 951 | the API gets incompatible */ |
949 | #ifdef HAVE_TAGCACHE | ||
950 | #ifdef HAVE_TC_RAMCACHE | ||
951 | bool (*tagcache_is_in_ram)(void); | ||
952 | #endif | ||
953 | #endif | ||
954 | }; | 952 | }; |
955 | 953 | ||
956 | /* plugin header */ | 954 | /* plugin header */ |
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c index a7f5b8baff..3e97916400 100644 --- a/apps/plugins/lib/playback_control.c +++ b/apps/plugins/lib/playback_control.c | |||
@@ -65,21 +65,21 @@ static bool nexttrack(void) | |||
65 | static bool volume(void) | 65 | static bool volume(void) |
66 | { | 66 | { |
67 | const struct settings_list* vol = | 67 | const struct settings_list* vol = |
68 | rb->find_setting(&rb->global_settings->volume, NULL); | 68 | rb->find_setting(&rb->global_settings->volume); |
69 | return rb->option_screen((struct settings_list*)vol, parentvp, false, "Volume"); | 69 | return rb->option_screen((struct settings_list*)vol, parentvp, false, "Volume"); |
70 | } | 70 | } |
71 | 71 | ||
72 | static bool shuffle(void) | 72 | static bool shuffle(void) |
73 | { | 73 | { |
74 | const struct settings_list* shuffle = | 74 | const struct settings_list* shuffle = |
75 | rb->find_setting(&rb->global_settings->playlist_shuffle, NULL); | 75 | rb->find_setting(&rb->global_settings->playlist_shuffle); |
76 | return rb->option_screen((struct settings_list*)shuffle, parentvp, false, "Shuffle"); | 76 | return rb->option_screen((struct settings_list*)shuffle, parentvp, false, "Shuffle"); |
77 | } | 77 | } |
78 | 78 | ||
79 | static bool repeat_mode(void) | 79 | static bool repeat_mode(void) |
80 | { | 80 | { |
81 | const struct settings_list* repeat = | 81 | const struct settings_list* repeat = |
82 | rb->find_setting(&rb->global_settings->repeat_mode, NULL); | 82 | rb->find_setting(&rb->global_settings->repeat_mode); |
83 | int old_repeat = rb->global_settings->repeat_mode; | 83 | int old_repeat = rb->global_settings->repeat_mode; |
84 | 84 | ||
85 | rb->option_screen((struct settings_list*)repeat, parentvp, false, "Repeat"); | 85 | rb->option_screen((struct settings_list*)repeat, parentvp, false, "Repeat"); |
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index caa8d499cb..7fd7aabdc8 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c | |||
@@ -428,7 +428,7 @@ static void do_opt_menu(void) | |||
428 | options.dirty=1; /* Assume that the settings have been changed */ | 428 | options.dirty=1; /* Assume that the settings have been changed */ |
429 | 429 | ||
430 | struct viewport *parentvp = NULL; | 430 | struct viewport *parentvp = NULL; |
431 | const struct settings_list* vol = rb->find_setting(&rb->global_settings->volume, NULL); | 431 | const struct settings_list* vol = rb->find_setting(&rb->global_settings->volume); |
432 | 432 | ||
433 | while(!done) | 433 | while(!done) |
434 | { | 434 | { |
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index ece9d87b66..e20322258d 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c | |||
@@ -286,7 +286,7 @@ static void do_sound_settings(struct System* sys) | |||
286 | case 2: | 286 | case 2: |
287 | { | 287 | { |
288 | const struct settings_list* vol = | 288 | const struct settings_list* vol = |
289 | rb->find_setting(&rb->global_settings->volume, NULL); | 289 | rb->find_setting(&rb->global_settings->volume); |
290 | rb->option_screen((struct settings_list*)vol, NULL, false, "Volume"); | 290 | rb->option_screen((struct settings_list*)vol, NULL, false, "Volume"); |
291 | break; | 291 | break; |
292 | } | 292 | } |
diff --git a/apps/settings.c b/apps/settings.c index e60b1b5f1a..c19a0b9b65 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -335,7 +335,6 @@ bool settings_load_config(const char* file, bool apply) | |||
335 | { | 335 | { |
336 | logf("%s()\r\n", __func__); | 336 | logf("%s()\r\n", __func__); |
337 | const struct settings_list *setting; | 337 | const struct settings_list *setting; |
338 | int index; | ||
339 | int fd; | 338 | int fd; |
340 | char line[128]; | 339 | char line[128]; |
341 | char* name; | 340 | char* name; |
@@ -351,7 +350,7 @@ bool settings_load_config(const char* file, bool apply) | |||
351 | if (!settings_parseline(line, &name, &value)) | 350 | if (!settings_parseline(line, &name, &value)) |
352 | continue; | 351 | continue; |
353 | 352 | ||
354 | setting = find_setting_by_cfgname(name, &index); | 353 | setting = find_setting_by_cfgname(name); |
355 | if (!setting) | 354 | if (!setting) |
356 | continue; | 355 | continue; |
357 | 356 | ||
@@ -1158,36 +1157,32 @@ void settings_reset(void) | |||
1158 | } | 1157 | } |
1159 | 1158 | ||
1160 | /** Changing setting values **/ | 1159 | /** Changing setting values **/ |
1161 | const struct settings_list* find_setting(const void* variable, int *id) | 1160 | const struct settings_list* find_setting(const void* variable) |
1162 | { | 1161 | { |
1163 | int i; | 1162 | for(int i = 0; i < nb_settings; i++) |
1164 | for(i=0;i<nb_settings;i++) | ||
1165 | { | 1163 | { |
1166 | if (settings[i].setting == variable) | 1164 | const struct settings_list *setting = &settings[i]; |
1167 | { | 1165 | if (setting->setting == variable) |
1168 | if (id) | 1166 | return setting; |
1169 | *id = i; | ||
1170 | return &settings[i]; | ||
1171 | } | ||
1172 | } | 1167 | } |
1168 | |||
1173 | return NULL; | 1169 | return NULL; |
1174 | } | 1170 | } |
1175 | 1171 | ||
1176 | const struct settings_list* find_setting_by_cfgname(const char* name, int *id) | 1172 | const struct settings_list* find_setting_by_cfgname(const char* name) |
1177 | { | 1173 | { |
1178 | int i; | ||
1179 | logf("Searching for Setting: '%s'",name); | 1174 | logf("Searching for Setting: '%s'",name); |
1180 | for (i=0; i<nb_settings; i++) | 1175 | for(int i = 0; i < nb_settings; i++) |
1181 | { | 1176 | { |
1182 | if (settings[i].cfg_name && | 1177 | const struct settings_list *setting = &settings[i]; |
1183 | !strcasecmp(settings[i].cfg_name, name)) | 1178 | if (setting->cfg_name && !strcasecmp(setting->cfg_name, name)) |
1184 | { | 1179 | { |
1185 | logf("Found, flags: %s", debug_get_flags(settings[i].flags)); | 1180 | logf("Found, flags: %s", debug_get_flags(settings[i].flags)); |
1186 | if (id) *id = i; | 1181 | return setting; |
1187 | return &settings[i]; | ||
1188 | } | 1182 | } |
1189 | } | 1183 | } |
1190 | logf("Setting: '%s' Not Found!",name); | 1184 | logf("Setting: '%s' Not Found!",name); |
1185 | |||
1191 | return NULL; | 1186 | return NULL; |
1192 | } | 1187 | } |
1193 | 1188 | ||
diff --git a/apps/settings.h b/apps/settings.h index 1c298d8330..1ad1923c73 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -263,8 +263,8 @@ void settings_display(void); | |||
263 | 263 | ||
264 | enum optiontype { INT, BOOL }; | 264 | enum optiontype { INT, BOOL }; |
265 | 265 | ||
266 | const struct settings_list* find_setting(const void* variable, int *id); | 266 | const struct settings_list* find_setting(const void* variable); |
267 | const struct settings_list* find_setting_by_cfgname(const char* name, int *id); | 267 | const struct settings_list* find_setting_by_cfgname(const char* name); |
268 | bool cfg_int_to_string(const struct settings_list *setting, int val, char* buf, int buf_len); | 268 | bool cfg_int_to_string(const struct settings_list *setting, int val, char* buf, int buf_len); |
269 | bool cfg_string_to_int(const struct settings_list *setting, int* out, const char* str); | 269 | bool cfg_string_to_int(const struct settings_list *setting, int* out, const char* str); |
270 | void cfg_to_string(const struct settings_list *setting, char* buf, int buf_len); | 270 | void cfg_to_string(const struct settings_list *setting, char* buf, int buf_len); |
diff --git a/apps/settings_list.c b/apps/settings_list.c index 2ff4258c54..1bf8b4202f 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -600,7 +600,7 @@ static void qs_load_from_cfg(void *var, char *value) | |||
600 | if (*value == '-') | 600 | if (*value == '-') |
601 | *item = NULL; | 601 | *item = NULL; |
602 | else | 602 | else |
603 | *item = find_setting_by_cfgname(value, NULL); | 603 | *item = find_setting_by_cfgname(value); |
604 | } | 604 | } |
605 | 605 | ||
606 | static char* qs_write_to_cfg(void *var, char *buf, int buf_len) | 606 | static char* qs_write_to_cfg(void *var, char *buf, int buf_len) |
@@ -613,14 +613,14 @@ static char* qs_write_to_cfg(void *var, char *buf, int buf_len) | |||
613 | 613 | ||
614 | static bool qs_is_changed(void* var, void* defaultval) | 614 | static bool qs_is_changed(void* var, void* defaultval) |
615 | { | 615 | { |
616 | const struct settings_list *defaultsetting = find_setting(defaultval, NULL); | 616 | const struct settings_list *defaultsetting = find_setting(defaultval); |
617 | 617 | ||
618 | return var != defaultsetting; | 618 | return var != defaultsetting; |
619 | } | 619 | } |
620 | 620 | ||
621 | static void qs_set_default(void* var, void* defaultval) | 621 | static void qs_set_default(void* var, void* defaultval) |
622 | { | 622 | { |
623 | *(const struct settings_list **)var = find_setting(defaultval, NULL); | 623 | *(const struct settings_list **)var = find_setting(defaultval); |
624 | } | 624 | } |
625 | #endif | 625 | #endif |
626 | #ifdef HAVE_TOUCHSCREEN | 626 | #ifdef HAVE_TOUCHSCREEN |
diff --git a/apps/shortcuts.c b/apps/shortcuts.c index cf372ce023..82e4a359bf 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c | |||
@@ -342,7 +342,7 @@ static int readline_cb(int n, char *buf, void *parameters) | |||
342 | strmemccpy(sc->u.path, value, MAX_PATH); | 342 | strmemccpy(sc->u.path, value, MAX_PATH); |
343 | break; | 343 | break; |
344 | case SHORTCUT_SETTING: | 344 | case SHORTCUT_SETTING: |
345 | sc->u.setting = find_setting_by_cfgname(value, NULL); | 345 | sc->u.setting = find_setting_by_cfgname(value); |
346 | break; | 346 | break; |
347 | case SHORTCUT_TIME: | 347 | case SHORTCUT_TIME: |
348 | #if CONFIG_RTC | 348 | #if CONFIG_RTC |
diff --git a/apps/talk.c b/apps/talk.c index c3a1148df4..65368e973f 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -1488,7 +1488,7 @@ void talk_setting(const void *global_settings_variable) | |||
1488 | const struct settings_list *setting; | 1488 | const struct settings_list *setting; |
1489 | if (!global_settings.talk_menu) | 1489 | if (!global_settings.talk_menu) |
1490 | return; | 1490 | return; |
1491 | setting = find_setting(global_settings_variable, NULL); | 1491 | setting = find_setting(global_settings_variable); |
1492 | if (setting == NULL) | 1492 | if (setting == NULL) |
1493 | return; | 1493 | return; |
1494 | if (setting->lang_id) | 1494 | if (setting->lang_id) |