diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/calendar.c | 2 | ||||
-rw-r--r-- | apps/plugins/chessbox/chessbox_pgn.c | 8 | ||||
-rw-r--r-- | apps/plugins/disktidy.c | 4 | ||||
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 8 | ||||
-rw-r--r-- | apps/plugins/goban/goban.c | 20 | ||||
-rw-r--r-- | apps/plugins/goban/types.h | 2 | ||||
-rw-r--r-- | apps/plugins/goban/util.c | 2 | ||||
-rw-r--r-- | apps/plugins/keybox.c | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_settings.c | 13 | ||||
-rw-r--r-- | apps/plugins/properties.c | 6 | ||||
-rw-r--r-- | apps/plugins/random_folder_advance_config.c | 4 | ||||
-rw-r--r-- | apps/plugins/rockboy/menu.c | 6 | ||||
-rw-r--r-- | apps/plugins/rockpaint.c | 10 | ||||
-rw-r--r-- | apps/plugins/shortcuts/shortcuts_view.c | 8 | ||||
-rw-r--r-- | apps/plugins/superdom.c | 4 | ||||
-rw-r--r-- | apps/plugins/text_editor.c | 4 |
16 files changed, 55 insertions, 50 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index cfb92909bf..20b7fa9226 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c | |||
@@ -669,7 +669,7 @@ static bool edit_memo(int change, struct shown *shown) | |||
669 | return false; | 669 | return false; |
670 | } | 670 | } |
671 | 671 | ||
672 | static char * get_event_text(int selected, void *data, | 672 | static const char* get_event_text(int selected, void *data, |
673 | char *buffer, size_t buffer_len) | 673 | char *buffer, size_t buffer_len) |
674 | { | 674 | { |
675 | struct shown *shown = (struct shown *) data; | 675 | struct shown *shown = (struct shown *) data; |
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index cd163a5e1c..512fb0ca15 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c | |||
@@ -528,11 +528,10 @@ void coords_to_pgn(struct pgn_ply_node* ply){ | |||
528 | } | 528 | } |
529 | } | 529 | } |
530 | 530 | ||
531 | char * get_game_text(int selected_item, void *data, | 531 | static const char* get_game_text(int selected_item, void *data, |
532 | char *buffer, size_t buffer_len){ | 532 | char *buffer, size_t buffer_len){ |
533 | int i; | 533 | int i; |
534 | struct pgn_game_node *temp_node = (struct pgn_game_node *)data; | 534 | struct pgn_game_node *temp_node = (struct pgn_game_node *)data; |
535 | char text_buffer[50]; | ||
536 | 535 | ||
537 | for (i=0;i<selected_item && temp_node != NULL;i++){ | 536 | for (i=0;i<selected_item && temp_node != NULL;i++){ |
538 | temp_node = temp_node->next_node; | 537 | temp_node = temp_node->next_node; |
@@ -540,10 +539,9 @@ char * get_game_text(int selected_item, void *data, | |||
540 | if (temp_node == NULL){ | 539 | if (temp_node == NULL){ |
541 | return NULL; | 540 | return NULL; |
542 | } | 541 | } |
543 | rb->snprintf(text_buffer, 50,"%s vs. %s (%s)", temp_node->white_player, | 542 | rb->snprintf(buffer, buffer_len,"%s vs. %s (%s)", temp_node->white_player, |
544 | temp_node->black_player, temp_node->game_date); | 543 | temp_node->black_player, temp_node->game_date); |
545 | 544 | ||
546 | rb->strlcpy(buffer, text_buffer, buffer_len); | ||
547 | return buffer; | 545 | return buffer; |
548 | } | 546 | } |
549 | 547 | ||
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index b7b9aa1770..84cc220891 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c | |||
@@ -380,8 +380,8 @@ enum themable_icons get_icon(int item, void * data) | |||
380 | return Icon_NOICON; | 380 | return Icon_NOICON; |
381 | } | 381 | } |
382 | 382 | ||
383 | char * get_name(int selected_item, void * data, | 383 | static const char* get_name(int selected_item, void * data, |
384 | char * buffer, size_t buffer_len) | 384 | char * buffer, size_t buffer_len) |
385 | { | 385 | { |
386 | (void)data; | 386 | (void)data; |
387 | if (tidy_types[selected_item].directory) | 387 | if (tidy_types[selected_item].directory) |
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index ca08ec1665..1d065cc981 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -550,14 +550,15 @@ static bool Doptions() | |||
550 | return (1); | 550 | return (1); |
551 | } | 551 | } |
552 | 552 | ||
553 | char* choice_get_name(int selected_item, void * data, | 553 | static const char* choice_get_name(int selected_item, void * data, |
554 | char * buffer, size_t buffer_len) | 554 | char * buffer, size_t buffer_len) |
555 | { | 555 | { |
556 | char **names = (char **) data; | 556 | const char **names = (const char **) data; |
557 | (void) buffer; | 557 | (void) buffer; |
558 | (void) buffer_len; | 558 | (void) buffer_len; |
559 | return names[selected_item]; | 559 | return names[selected_item]; |
560 | } | 560 | } |
561 | |||
561 | int list_action_callback(int action, struct gui_synclist *lists) | 562 | int list_action_callback(int action, struct gui_synclist *lists) |
562 | { | 563 | { |
563 | (void) lists; | 564 | (void) lists; |
@@ -565,6 +566,7 @@ int list_action_callback(int action, struct gui_synclist *lists) | |||
565 | return ACTION_STD_CANCEL; | 566 | return ACTION_STD_CANCEL; |
566 | return action; | 567 | return action; |
567 | } | 568 | } |
569 | |||
568 | bool menuchoice(char **names, int count, int *selected) | 570 | bool menuchoice(char **names, int count, int *selected) |
569 | { | 571 | { |
570 | struct simplelist_info info; | 572 | struct simplelist_info info; |
diff --git a/apps/plugins/goban/goban.c b/apps/plugins/goban/goban.c index 65a03f6953..4e20e71a37 100644 --- a/apps/plugins/goban/goban.c +++ b/apps/plugins/goban/goban.c | |||
@@ -114,37 +114,39 @@ set_defaults (void) | |||
114 | autosave_time = 7; | 114 | autosave_time = 7; |
115 | } | 115 | } |
116 | 116 | ||
117 | static void | 117 | static const char* |
118 | komi_formatter (char *dest, size_t size, int menu_item, const char *unknown) | 118 | komi_formatter (char *dest, size_t size, int menu_item, const char *unknown) |
119 | { | 119 | { |
120 | (void) unknown; | 120 | (void) unknown; |
121 | snprint_fixed (dest, size, menu_item); | 121 | snprint_fixed (dest, size, menu_item); |
122 | return dest; | ||
122 | } | 123 | } |
123 | 124 | ||
124 | static void | 125 | static const char* |
125 | ruleset_formatter (char *dest, size_t size, int menu_item, const char *unknown) | 126 | ruleset_formatter (char *dest, size_t size, int menu_item, const char *unknown) |
126 | { | 127 | { |
127 | (void) unknown; | 128 | (void)dest, (void)size, (void)unknown; |
128 | rb->snprintf (dest, size, "%s", ruleset_names[menu_item]); | 129 | return ruleset_names[menu_item]; |
129 | } | 130 | } |
130 | 131 | ||
131 | static void | 132 | static const char* |
132 | autosave_formatter (char *dest, size_t size, int menu_item, const char * | 133 | autosave_formatter (char *dest, size_t size, int menu_item, const char * |
133 | unknown) | 134 | unknown) |
134 | { | 135 | { |
135 | (void) unknown; | 136 | (void) unknown; |
136 | if (menu_item == 0) | 137 | if (menu_item == 0) |
137 | { | 138 | { |
138 | rb->snprintf (dest, size, "Off"); | 139 | return "Off"; |
139 | } | 140 | } |
140 | else | 141 | else |
141 | { | 142 | { |
142 | rb->snprintf (dest, size, "%d minute%s", menu_item, | 143 | rb->snprintf (dest, size, "%d minute%s", menu_item, |
143 | menu_item == 1 ? "" : "s"); | 144 | menu_item == 1 ? "" : "s"); |
145 | return dest; | ||
144 | } | 146 | } |
145 | } | 147 | } |
146 | 148 | ||
147 | static void | 149 | static const char* |
148 | time_formatter (char *dest, size_t size, int menu_item, const char *unknown) | 150 | time_formatter (char *dest, size_t size, int menu_item, const char *unknown) |
149 | { | 151 | { |
150 | int time_values[4]; /* days hours minutes seconds */ | 152 | int time_values[4]; /* days hours minutes seconds */ |
@@ -183,8 +185,7 @@ time_formatter (char *dest, size_t size, int menu_item, const char *unknown) | |||
183 | 185 | ||
184 | if (max_set == -1) | 186 | if (max_set == -1) |
185 | { | 187 | { |
186 | rb->snprintf (dest, size, "0"); | 188 | return "0"; |
187 | return; | ||
188 | } | 189 | } |
189 | 190 | ||
190 | for (i = min_set; i <= 3; ++i) | 191 | for (i = min_set; i <= 3; ++i) |
@@ -236,6 +237,7 @@ time_formatter (char *dest, size_t size, int menu_item, const char *unknown) | |||
236 | dest += temp; | 237 | dest += temp; |
237 | size -= temp; | 238 | size -= temp; |
238 | } | 239 | } |
240 | return dest; | ||
239 | } | 241 | } |
240 | 242 | ||
241 | enum plugin_status | 243 | enum plugin_status |
diff --git a/apps/plugins/goban/types.h b/apps/plugins/goban/types.h index 216d41bc21..a7c2b9b0ae 100644 --- a/apps/plugins/goban/types.h +++ b/apps/plugins/goban/types.h | |||
@@ -218,7 +218,7 @@ struct prop_t | |||
218 | 218 | ||
219 | 219 | ||
220 | /* The names of the rulesets, ex. "AGA", "Japanese", etc. */ | 220 | /* The names of the rulesets, ex. "AGA", "Japanese", etc. */ |
221 | extern char *ruleset_names[]; | 221 | extern const char *ruleset_names[]; |
222 | 222 | ||
223 | /* IMPORTANT! keep in sync with ruleset_names!!! */ | 223 | /* IMPORTANT! keep in sync with ruleset_names!!! */ |
224 | enum ruleset_t | 224 | enum ruleset_t |
diff --git a/apps/plugins/goban/util.c b/apps/plugins/goban/util.c index e9966311ef..0e83173f40 100644 --- a/apps/plugins/goban/util.c +++ b/apps/plugins/goban/util.c | |||
@@ -210,7 +210,7 @@ char *prop_names[] = { | |||
210 | 210 | ||
211 | /* These seems to be specified by the SGF specification. You can do free | 211 | /* These seems to be specified by the SGF specification. You can do free |
212 | form ones as well, but I haven't implemented that (and don't plan to) */ | 212 | form ones as well, but I haven't implemented that (and don't plan to) */ |
213 | char *ruleset_names[] = { "AGA", "Japanese", "Chinese", "NZ", "GOE" }; | 213 | const char *ruleset_names[] = { "AGA", "Japanese", "Chinese", "NZ", "GOE" }; |
214 | 214 | ||
215 | 215 | ||
216 | 216 | ||
diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 733c6e95cd..d926105962 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c | |||
@@ -122,8 +122,8 @@ MENUITEM_STRINGLIST(context_m, "Context menu", context_item_cb, | |||
122 | "Delete entry", | 122 | "Delete entry", |
123 | "Playback Control"); | 123 | "Playback Control"); |
124 | 124 | ||
125 | static char * kb_list_cb(int selected_item, void *data, | 125 | static const char* kb_list_cb(int selected_item, void *data, |
126 | char *buffer, size_t buffer_len) | 126 | char *buffer, size_t buffer_len) |
127 | { | 127 | { |
128 | (void)data; | 128 | (void)data; |
129 | int i; | 129 | int i; |
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 62293d101f..3868d759f6 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c | |||
@@ -317,7 +317,7 @@ static bool mpeg_set_int(const char *string, const char *unit, | |||
317 | void (*function)(int), int step, | 317 | void (*function)(int), int step, |
318 | int min, | 318 | int min, |
319 | int max, | 319 | int max, |
320 | void (*formatter)(char*, size_t, int, const char*)) | 320 | const char* (*formatter)(char*, size_t, int, const char*)) |
321 | { | 321 | { |
322 | mpeg_menu_sysevent_clear(); | 322 | mpeg_menu_sysevent_clear(); |
323 | 323 | ||
@@ -350,15 +350,16 @@ static void backlight_brightness_function(int value) | |||
350 | mpeg_backlight_update_brightness(value); | 350 | mpeg_backlight_update_brightness(value); |
351 | } | 351 | } |
352 | 352 | ||
353 | static void backlight_brightness_formatter(char *buf, size_t length, | 353 | static const char* backlight_brightness_formatter(char *buf, size_t length, |
354 | int value, const char *input) | 354 | int value, const char *input) |
355 | { | 355 | { |
356 | (void)input; | ||
357 | |||
356 | if (value < 0) | 358 | if (value < 0) |
357 | rb->strlcpy(buf, BACKLIGHT_OPTION_DEFAULT, length); | 359 | return BACKLIGHT_OPTION_DEFAULT; |
358 | else | 360 | else |
359 | rb->snprintf(buf, length, "%d", value + MIN_BRIGHTNESS_SETTING); | 361 | rb->snprintf(buf, length, "%d", value + MIN_BRIGHTNESS_SETTING); |
360 | 362 | return buf; | |
361 | (void)input; | ||
362 | } | 363 | } |
363 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ | 364 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ |
364 | 365 | ||
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index c76a25b06a..7cd29c126f 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c | |||
@@ -228,7 +228,8 @@ static bool dir_properties(char* selected_file) | |||
228 | return true; | 228 | return true; |
229 | } | 229 | } |
230 | 230 | ||
231 | char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len) | 231 | static const char * get_props(int selected_item, void* data, |
232 | char *buffer, size_t buffer_len) | ||
232 | { | 233 | { |
233 | (void)data; | 234 | (void)data; |
234 | 235 | ||
@@ -263,8 +264,7 @@ char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len) | |||
263 | rb->strlcpy(buffer, its_a_dir ? "" : str_duration, buffer_len); | 264 | rb->strlcpy(buffer, its_a_dir ? "" : str_duration, buffer_len); |
264 | break; | 265 | break; |
265 | default: | 266 | default: |
266 | rb->strlcpy(buffer, "ERROR", buffer_len); | 267 | return "ERROR"; |
267 | break; | ||
268 | } | 268 | } |
269 | return buffer; | 269 | return buffer; |
270 | } | 270 | } |
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index c9ffaed319..ba3f0d3f7e 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c | |||
@@ -234,7 +234,9 @@ void generate(void) | |||
234 | rb->close(fd); | 234 | rb->close(fd); |
235 | rb->splash(HZ, "Done"); | 235 | rb->splash(HZ, "Done"); |
236 | } | 236 | } |
237 | char *list_get_name_cb(int selected_item, void* data, char* buf, size_t buf_len) | 237 | |
238 | static const char* list_get_name_cb(int selected_item, void* data, | ||
239 | char* buf, size_t buf_len) | ||
238 | { | 240 | { |
239 | (void)data; | 241 | (void)data; |
240 | rb->strlcpy(buf, list->folder[selected_item], buf_len); | 242 | rb->strlcpy(buf, list->folder[selected_item], buf_len); |
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 455c91b5b6..bd4088300c 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c | |||
@@ -270,10 +270,10 @@ static void slot_info(char *info_buf, size_t info_bufsiz, size_t slot_id) { | |||
270 | /* | 270 | /* |
271 | * slot_get_name | 271 | * slot_get_name |
272 | */ | 272 | */ |
273 | static char *slot_get_name(int selected_item, void * data, | 273 | static const char* slot_get_name(int selected_item, void * data, |
274 | char * buffer, size_t buffer_len) | 274 | char * buffer, size_t buffer_len) |
275 | { | 275 | { |
276 | char (*items)[20] = data; | 276 | const char (*items)[20] = data; |
277 | (void) buffer; | 277 | (void) buffer; |
278 | (void) buffer_len; | 278 | (void) buffer_len; |
279 | return items[selected_item]; | 279 | return items[selected_item]; |
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index a4084a2ca7..219f013ed8 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c | |||
@@ -600,8 +600,8 @@ char bbuf[MAX_PATH+1]; /* used by file and font browsers */ | |||
600 | char bbuf_s[MAX_PATH+1]; /* used by file and font browsers */ | 600 | char bbuf_s[MAX_PATH+1]; /* used by file and font browsers */ |
601 | struct tree_context *tree = NULL; | 601 | struct tree_context *tree = NULL; |
602 | 602 | ||
603 | static char * browse_get_name_cb( int selected_item, void *data, | 603 | static const char* browse_get_name_cb(int selected_item, void *data, |
604 | char *buffer, size_t buffer_len ) | 604 | char *buffer, size_t buffer_len) |
605 | { | 605 | { |
606 | int *indexes = (int *) data; | 606 | int *indexes = (int *) data; |
607 | struct entry* dc = tree->dircache; | 607 | struct entry* dc = tree->dircache; |
@@ -609,7 +609,7 @@ static char * browse_get_name_cb( int selected_item, void *data, | |||
609 | (void) buffer; | 609 | (void) buffer; |
610 | (void) buffer_len; | 610 | (void) buffer_len; |
611 | 611 | ||
612 | return (e->name); | 612 | return e->name; |
613 | } | 613 | } |
614 | 614 | ||
615 | static bool browse( char *dst, int dst_size, const char *start ) | 615 | static bool browse( char *dst, int dst_size, const char *start ) |
@@ -633,8 +633,8 @@ static bool browse( char *dst, int dst_size, const char *start ) | |||
633 | } | 633 | } |
634 | bbuf_s[0] = '\0'; | 634 | bbuf_s[0] = '\0'; |
635 | 635 | ||
636 | rb->gui_synclist_init( &browse_list, browse_get_name_cb, | 636 | rb->gui_synclist_init(&browse_list, browse_get_name_cb, |
637 | (void*) indexes, false, 1, NULL ); | 637 | (void*) indexes, false, 1, NULL); |
638 | 638 | ||
639 | tree = rb->tree_get_context(); | 639 | tree = rb->tree_get_context(); |
640 | backup = *tree; | 640 | backup = *tree; |
diff --git a/apps/plugins/shortcuts/shortcuts_view.c b/apps/plugins/shortcuts/shortcuts_view.c index f6a26a519d..b964968737 100644 --- a/apps/plugins/shortcuts/shortcuts_view.c +++ b/apps/plugins/shortcuts/shortcuts_view.c | |||
@@ -40,8 +40,8 @@ static bool usb_connected = false; | |||
40 | enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc); | 40 | enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc); |
41 | 41 | ||
42 | /* Will be passed sc_file* as data */ | 42 | /* Will be passed sc_file* as data */ |
43 | char* build_sc_list(int selected_item, void *data, | 43 | static const char* build_sc_list(int selected_item, void *data, |
44 | char *buffer, size_t buffer_len); | 44 | char *buffer, size_t buffer_len); |
45 | 45 | ||
46 | /* Returns true iff we should leave the main loop */ | 46 | /* Returns true iff we should leave the main loop */ |
47 | bool list_sc(void); | 47 | bool list_sc(void); |
@@ -89,8 +89,8 @@ enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | char* build_sc_list(int selected_item, void *data, | 92 | static const char* build_sc_list(int selected_item, void *data, |
93 | char *buffer, size_t buffer_len) | 93 | char *buffer, size_t buffer_len) |
94 | { | 94 | { |
95 | sc_file_t *file = (sc_file_t*)data; | 95 | sc_file_t *file = (sc_file_t*)data; |
96 | 96 | ||
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index d6b9621343..dc078170e9 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c | |||
@@ -1251,8 +1251,8 @@ int movement_menu(void) { | |||
1251 | return RET_VAL_OK; | 1251 | return RET_VAL_OK; |
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | static char * inventory_data(int selected_item, void * data, | 1254 | static const char* inventory_data(int selected_item, void * data, |
1255 | char * buffer, size_t buffer_len) { | 1255 | char * buffer, size_t buffer_len) { |
1256 | (void)data; | 1256 | (void)data; |
1257 | switch(selected_item) { | 1257 | switch(selected_item) { |
1258 | case 0: | 1258 | case 0: |
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index 473bb68ead..dc792046fa 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c | |||
@@ -121,8 +121,8 @@ int _do_action(int action, char* str, int line) | |||
121 | last_char_index = c; | 121 | last_char_index = c; |
122 | return 1; | 122 | return 1; |
123 | } | 123 | } |
124 | char *list_get_name_cb(int selected_item, void* data, | 124 | static const char* list_get_name_cb(int selected_item, void* data, |
125 | char* buf, size_t buf_len) | 125 | char* buf, size_t buf_len) |
126 | { | 126 | { |
127 | (void)data; | 127 | (void)data; |
128 | char *b = &buffer[do_action(ACTION_GET,0,selected_item)]; | 128 | char *b = &buffer[do_action(ACTION_GET,0,selected_item)]; |