diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/keybox.c | 2 | ||||
-rw-r--r-- | apps/plugins/lrcplayer.c | 4 | ||||
-rw-r--r-- | apps/plugins/main_menu_config.c | 2 | ||||
-rw-r--r-- | apps/plugins/random_folder_advance_config.c | 50 |
4 files changed, 29 insertions, 29 deletions
diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 1689321abe..a074ffc598 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c | |||
@@ -75,7 +75,7 @@ static void encrypt_buffer(char *buf, size_t size, uint32_t *key); | |||
75 | static void decrypt_buffer(char *buf, size_t size, uint32_t *key); | 75 | static void decrypt_buffer(char *buf, size_t size, uint32_t *key); |
76 | 76 | ||
77 | /* the following two functions are the reference TEA implementation by | 77 | /* the following two functions are the reference TEA implementation by |
78 | David Wheeler and Roger Needham taken from | 78 | David Wheeler and Roger Needham taken from |
79 | http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm */ | 79 | http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm */ |
80 | 80 | ||
81 | static void do_encrypt(uint32_t* v, uint32_t* k) | 81 | static void do_encrypt(uint32_t* v, uint32_t* k) |
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index 225f0c8689..f42b96b5b3 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c | |||
@@ -428,8 +428,8 @@ static struct lrc_brpos *calc_brpos(struct lrc_line *lrc_line, int i) | |||
428 | int nword; | 428 | int nword; |
429 | int word_count, word_width; | 429 | int word_count, word_width; |
430 | const unsigned char *str; | 430 | const unsigned char *str; |
431 | } | 431 | } |
432 | sp, | 432 | sp, |
433 | cr; | 433 | cr; |
434 | 434 | ||
435 | lrc_buffer_used = (lrc_buffer_used+3)&~3; /* 4 bytes aligned */ | 435 | lrc_buffer_used = (lrc_buffer_used+3)&~3; /* 4 bytes aligned */ |
diff --git a/apps/plugins/main_menu_config.c b/apps/plugins/main_menu_config.c index f66165e63d..9f651094b1 100644 --- a/apps/plugins/main_menu_config.c +++ b/apps/plugins/main_menu_config.c | |||
@@ -171,7 +171,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
171 | struct gui_synclist list; | 171 | struct gui_synclist list; |
172 | bool done = false; | 172 | bool done = false; |
173 | int action, cur_sel; | 173 | int action, cur_sel; |
174 | 174 | ||
175 | menu_table = rb->root_menu_get_options(&menu_item_count); | 175 | menu_table = rb->root_menu_get_options(&menu_item_count); |
176 | load_from_cfg(); | 176 | load_from_cfg(); |
177 | 177 | ||
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index ca0d5f397d..2c9fb411ac 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c | |||
@@ -211,7 +211,7 @@ static bool custom_dir(void) | |||
211 | rb->close(fd2); | 211 | rb->close(fd2); |
212 | if(errors) | 212 | if(errors) |
213 | /* Press button to continue */ | 213 | /* Press button to continue */ |
214 | rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK); | 214 | rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK); |
215 | } | 215 | } |
216 | else | 216 | else |
217 | return false; | 217 | return false; |
@@ -259,11 +259,11 @@ static int load_list(void) | |||
259 | { | 259 | { |
260 | return -2; | 260 | return -2; |
261 | } | 261 | } |
262 | 262 | ||
263 | rb->read(myfd,buffer,buffer_size); | 263 | rb->read(myfd,buffer,buffer_size); |
264 | rb->close(myfd); | 264 | rb->close(myfd); |
265 | list = (struct file_format *)buffer; | 265 | list = (struct file_format *)buffer; |
266 | 266 | ||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
@@ -288,7 +288,7 @@ static int save_list(void) | |||
288 | rb->lseek(myfd,0,SEEK_SET); | 288 | rb->lseek(myfd,0,SEEK_SET); |
289 | rb->write(myfd,&dirs_count,sizeof(int)); | 289 | rb->write(myfd,&dirs_count,sizeof(int)); |
290 | rb->close(myfd); | 290 | rb->close(myfd); |
291 | 291 | ||
292 | return 1; | 292 | return 1; |
293 | } | 293 | } |
294 | 294 | ||
@@ -298,22 +298,22 @@ static int edit_list(void) | |||
298 | bool exit = false; | 298 | bool exit = false; |
299 | int button,i; | 299 | int button,i; |
300 | int selection, ret = 0; | 300 | int selection, ret = 0; |
301 | 301 | ||
302 | /* load the dat file if not already done */ | 302 | /* load the dat file if not already done */ |
303 | if ((list == NULL || list->count == 0) && (i = load_list()) != 0) | 303 | if ((list == NULL || list->count == 0) && (i = load_list()) != 0) |
304 | { | 304 | { |
305 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); | 305 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); |
306 | return -1; | 306 | return -1; |
307 | } | 307 | } |
308 | 308 | ||
309 | dirs_count = list->count; | 309 | dirs_count = list->count; |
310 | 310 | ||
311 | rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1, NULL); | 311 | rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1, NULL); |
312 | rb->gui_synclist_set_icon_callback(&lists,NULL); | 312 | rb->gui_synclist_set_icon_callback(&lists,NULL); |
313 | rb->gui_synclist_set_nb_items(&lists,list->count); | 313 | rb->gui_synclist_set_nb_items(&lists,list->count); |
314 | rb->gui_synclist_limit_scroll(&lists,true); | 314 | rb->gui_synclist_limit_scroll(&lists,true); |
315 | rb->gui_synclist_select_item(&lists, 0); | 315 | rb->gui_synclist_select_item(&lists, 0); |
316 | 316 | ||
317 | while (!exit) | 317 | while (!exit) |
318 | { | 318 | { |
319 | rb->gui_synclist_draw(&lists); | 319 | rb->gui_synclist_draw(&lists); |
@@ -387,22 +387,22 @@ static int export_list_to_file_text(void) | |||
387 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); | 387 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); |
388 | return 0; | 388 | return 0; |
389 | } | 389 | } |
390 | 390 | ||
391 | if (list->count <= 0) | 391 | if (list->count <= 0) |
392 | { | 392 | { |
393 | rb->splashf(HZ*2, "no dirs in list file: %s", RFA_FILE); | 393 | rb->splashf(HZ*2, "no dirs in list file: %s", RFA_FILE); |
394 | return 0; | 394 | return 0; |
395 | } | 395 | } |
396 | 396 | ||
397 | /* create and open the file */ | 397 | /* create and open the file */ |
398 | int myfd = rb->creat(RFA_FILE_TEXT, 0666); | 398 | int myfd = rb->creat(RFA_FILE_TEXT, 0666); |
399 | if (myfd < 0) | 399 | if (myfd < 0) |
400 | { | 400 | { |
401 | rb->splashf(HZ*4, "failed to open: fd = %d, file = %s", | 401 | rb->splashf(HZ*4, "failed to open: fd = %d, file = %s", |
402 | myfd, RFA_FILE_TEXT); | 402 | myfd, RFA_FILE_TEXT); |
403 | return -1; | 403 | return -1; |
404 | } | 404 | } |
405 | 405 | ||
406 | /* write each directory to file */ | 406 | /* write each directory to file */ |
407 | for (i = 0; i < list->count; i++) | 407 | for (i = 0; i < list->count; i++) |
408 | { | 408 | { |
@@ -411,7 +411,7 @@ static int export_list_to_file_text(void) | |||
411 | rb->fdprintf(myfd, "%s\n", list->folder[i]); | 411 | rb->fdprintf(myfd, "%s\n", list->folder[i]); |
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
415 | rb->close(myfd); | 415 | rb->close(myfd); |
416 | rb->splash(HZ, "Done"); | 416 | rb->splash(HZ, "Done"); |
417 | return 1; | 417 | return 1; |
@@ -420,7 +420,7 @@ static int export_list_to_file_text(void) | |||
420 | static int import_list_from_file_text(void) | 420 | static int import_list_from_file_text(void) |
421 | { | 421 | { |
422 | char line[MAX_PATH]; | 422 | char line[MAX_PATH]; |
423 | 423 | ||
424 | buffer = rb->plugin_get_audio_buffer(&buffer_size); | 424 | buffer = rb->plugin_get_audio_buffer(&buffer_size); |
425 | if (buffer == NULL) | 425 | if (buffer == NULL) |
426 | { | 426 | { |
@@ -434,11 +434,11 @@ static int import_list_from_file_text(void) | |||
434 | rb->splashf(HZ*2, "failed to open: %s", RFA_FILE_TEXT); | 434 | rb->splashf(HZ*2, "failed to open: %s", RFA_FILE_TEXT); |
435 | return -1; | 435 | return -1; |
436 | } | 436 | } |
437 | 437 | ||
438 | /* set the list structure, and initialize count */ | 438 | /* set the list structure, and initialize count */ |
439 | list = (struct file_format *)buffer; | 439 | list = (struct file_format *)buffer; |
440 | list->count = 0; | 440 | list->count = 0; |
441 | 441 | ||
442 | while ((rb->read_line(myfd, line, MAX_PATH - 1)) > 0) | 442 | while ((rb->read_line(myfd, line, MAX_PATH - 1)) > 0) |
443 | { | 443 | { |
444 | /* copy the dir name, and skip the newline */ | 444 | /* copy the dir name, and skip the newline */ |
@@ -448,16 +448,16 @@ static int import_list_from_file_text(void) | |||
448 | { | 448 | { |
449 | if (line[len-1] == 0x0A || line[len-1] == 0x0D) | 449 | if (line[len-1] == 0x0A || line[len-1] == 0x0D) |
450 | line[len-1] = 0x00; | 450 | line[len-1] = 0x00; |
451 | if (len > 1 && | 451 | if (len > 1 && |
452 | (line[len-2] == 0x0A || line[len-2] == 0x0D)) | 452 | (line[len-2] == 0x0A || line[len-2] == 0x0D)) |
453 | line[len-2] = 0x00; | 453 | line[len-2] = 0x00; |
454 | } | 454 | } |
455 | 455 | ||
456 | rb->strcpy(list->folder[list->count++], line); | 456 | rb->strcpy(list->folder[list->count++], line); |
457 | } | 457 | } |
458 | 458 | ||
459 | rb->close(myfd); | 459 | rb->close(myfd); |
460 | 460 | ||
461 | if (list->count == 0) | 461 | if (list->count == 0) |
462 | { | 462 | { |
463 | load_list(); | 463 | load_list(); |
@@ -484,14 +484,14 @@ static int start_shuffled_play(void) | |||
484 | rb->splashf(HZ*2, "Not enough memory for shuffling"); | 484 | rb->splashf(HZ*2, "Not enough memory for shuffling"); |
485 | return 0; | 485 | return 0; |
486 | } | 486 | } |
487 | 487 | ||
488 | /* load the dat file if not already done */ | 488 | /* load the dat file if not already done */ |
489 | if ((list == NULL || list->count == 0) && (i = load_list()) != 0) | 489 | if ((list == NULL || list->count == 0) && (i = load_list()) != 0) |
490 | { | 490 | { |
491 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); | 491 | rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); |
492 | return 0; | 492 | return 0; |
493 | } | 493 | } |
494 | 494 | ||
495 | if (list->count <= 0) | 495 | if (list->count <= 0) |
496 | { | 496 | { |
497 | rb->splashf(HZ*2, "no dirs in list file: %s", RFA_FILE); | 497 | rb->splashf(HZ*2, "no dirs in list file: %s", RFA_FILE); |
@@ -507,7 +507,7 @@ static int start_shuffled_play(void) | |||
507 | } | 507 | } |
508 | for(i=0;i<list->count;i++) | 508 | for(i=0;i<list->count;i++) |
509 | order[i]=i; | 509 | order[i]=i; |
510 | 510 | ||
511 | for(i = list->count - 1; i >= 0; i--) | 511 | for(i = list->count - 1; i >= 0; i--) |
512 | { | 512 | { |
513 | /* the rand is from 0 to RAND_MAX, so adjust to our value range */ | 513 | /* the rand is from 0 to RAND_MAX, so adjust to our value range */ |
@@ -518,7 +518,7 @@ static int start_shuffled_play(void) | |||
518 | order[candidate] = order[i]; | 518 | order[candidate] = order[i]; |
519 | order[i] = store; | 519 | order[i] = store; |
520 | } | 520 | } |
521 | 521 | ||
522 | /* We don't want whatever is playing */ | 522 | /* We don't want whatever is playing */ |
523 | if (!(rb->playlist_remove_all_tracks(NULL) == 0 | 523 | if (!(rb->playlist_remove_all_tracks(NULL) == 0 |
524 | && rb->playlist_create(NULL, NULL) == 0)) | 524 | && rb->playlist_create(NULL, NULL) == 0)) |
@@ -643,6 +643,6 @@ enum plugin_status plugin_start(const void* parameter) | |||
643 | #endif | 643 | #endif |
644 | 644 | ||
645 | cancel = false; | 645 | cancel = false; |
646 | 646 | ||
647 | return main_menu(); | 647 | return main_menu(); |
648 | } | 648 | } |