summaryrefslogtreecommitdiff
path: root/apps/filetypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetypes.c')
-rw-r--r--apps/filetypes.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index e2240089ce..4e88f81dec 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -149,7 +149,7 @@ void filetype_init(void)
149 149
150/* get icon */ 150/* get icon */
151#ifdef HAVE_LCD_BITMAP 151#ifdef HAVE_LCD_BITMAP
152const char* filetype_get_icon(int attr) 152const unsigned char* filetype_get_icon(int attr)
153#else 153#else
154int filetype_get_icon(int attr) 154int filetype_get_icon(int attr)
155#endif 155#endif
@@ -249,7 +249,7 @@ int filetype_load_menu(struct menu_item* menu,int max_items)
249 cp=strrchr(filetypes[i].plugin,'/'); 249 cp=strrchr(filetypes[i].plugin,'/');
250 if (cp) cp++; 250 if (cp) cp++;
251 else cp=filetypes[i].plugin; 251 else cp=filetypes[i].plugin;
252 menu[cnt].desc = cp; 252 menu[cnt].desc = (unsigned char *)cp;
253 cnt++; 253 cnt++;
254 if (cnt == max_items) 254 if (cnt == max_items)
255 break; 255 break;
@@ -317,14 +317,14 @@ static void scan_plugins(void)
317 /* exttypes[] full, bail out */ 317 /* exttypes[] full, bail out */
318 if (cnt_exttypes >= MAX_EXTTYPES) 318 if (cnt_exttypes >= MAX_EXTTYPES)
319 { 319 {
320 gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); 320 gui_syncsplash(HZ, true, str(LANG_FILETYPES_EXTENSION_FULL));
321 break; 321 break;
322 } 322 }
323 323
324 /* filetypes[] full, bail out */ 324 /* filetypes[] full, bail out */
325 if (cnt_filetypes >= MAX_FILETYPES) 325 if (cnt_filetypes >= MAX_FILETYPES)
326 { 326 {
327 gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL)); 327 gui_syncsplash(HZ, true, str(LANG_FILETYPES_FULL));
328 break; 328 break;
329 } 329 }
330 330
@@ -348,31 +348,31 @@ static void scan_plugins(void)
348 } 348 }
349 349
350 /* filter out non rock files */ 350 /* filter out non rock files */
351 if (strcasecmp( 351 if (strcasecmp((char *)&entry->d_name[strlen((char *)entry->d_name) -
352 &entry->d_name[strlen(entry->d_name) - sizeof(ROCK_EXTENSION) + 1], 352 sizeof(ROCK_EXTENSION) + 1],
353 ROCK_EXTENSION)) { 353 ROCK_EXTENSION)) {
354 continue; 354 continue;
355 } 355 }
356 356
357 /* filter out to long filenames */ 357 /* filter out to long filenames */
358 if (strlen(entry->d_name) > MAX_PLUGIN_LENGTH + 5) 358 if (strlen((char *)entry->d_name) > MAX_PLUGIN_LENGTH + 5)
359 { 359 {
360 gui_syncsplash(HZ,true,str(LANG_FILETYPES_PLUGIN_NAME_LONG)); 360 gui_syncsplash(HZ, true, str(LANG_FILETYPES_PLUGIN_NAME_LONG));
361 continue; 361 continue;
362 } 362 }
363 363
364 dot=strrchr(entry->d_name,'.'); 364 dot=strrchr((char *)entry->d_name,'.');
365 *dot='\0'; 365 *dot='\0';
366 dash=strchr(entry->d_name,'-'); 366 dash=strchr((char *)entry->d_name,'-');
367 367
368 /* add plugin and extension */ 368 /* add plugin and extension */
369 if (dash) 369 if (dash)
370 { 370 {
371 *dash='\0'; 371 *dash='\0';
372 ix=(filetype_get_attr(entry->d_name) >> 8); 372 ix=(filetype_get_attr((char *)entry->d_name) >> 8);
373 if (!ix) 373 if (!ix)
374 { 374 {
375 cp=get_string(entry->d_name); 375 cp=get_string((char *)entry->d_name);
376 if (cp) 376 if (cp)
377 { 377 {
378 exttypes[cnt_exttypes].extension=cp; 378 exttypes[cnt_exttypes].extension=cp;
@@ -385,7 +385,7 @@ static void scan_plugins(void)
385 cnt_exttypes++; 385 cnt_exttypes++;
386 386
387 *dash='-'; 387 *dash='-';
388 cp=get_string(entry->d_name); 388 cp=get_string((char *)entry->d_name);
389 if (cp) 389 if (cp)
390 { 390 {
391 filetypes[cnt_filetypes].plugin=cp; 391 filetypes[cnt_filetypes].plugin=cp;
@@ -402,7 +402,7 @@ static void scan_plugins(void)
402 *dash='-'; 402 *dash='-';
403 if (!filetypes[ix].plugin) 403 if (!filetypes[ix].plugin)
404 { 404 {
405 cp=get_string(entry->d_name); 405 cp=get_string((char *)entry->d_name);
406 if (cp) 406 if (cp)
407 { 407 {
408 filetypes[cnt_filetypes].plugin=cp; 408 filetypes[cnt_filetypes].plugin=cp;
@@ -421,7 +421,7 @@ static void scan_plugins(void)
421 for (i = first_soft_filetype; i < cnt_filetypes; i++) 421 for (i = first_soft_filetype; i < cnt_filetypes; i++)
422 { 422 {
423 if (filetypes[i].plugin) 423 if (filetypes[i].plugin)
424 if (!strcasecmp(filetypes[i].plugin,entry->d_name)) 424 if (!strcasecmp(filetypes[i].plugin, (char *)entry->d_name))
425 { 425 {
426 found=true; 426 found=true;
427 break; 427 break;
@@ -430,7 +430,7 @@ static void scan_plugins(void)
430 430
431 if (!found) 431 if (!found)
432 { 432 {
433 cp=get_string(entry->d_name); 433 cp=get_string((char *)entry->d_name);
434 if (cp) 434 if (cp)
435 { 435 {
436 filetypes[cnt_filetypes].plugin=cp; 436 filetypes[cnt_filetypes].plugin=cp;
@@ -477,7 +477,7 @@ static int add_plugin(char *plugin)
477 { 477 {
478 cp = string2icon(icon); 478 cp = string2icon(icon);
479 if (cp) 479 if (cp)
480 filetypes[cnt_filetypes].icon = cp; 480 filetypes[cnt_filetypes].icon = (unsigned char *)cp;
481 else 481 else
482 return 0; 482 return 0;
483 } 483 }
@@ -498,7 +498,7 @@ static int add_plugin(char *plugin)
498 { 498 {
499 cp = string2icon(icon); 499 cp = string2icon(icon);
500 if (cp) 500 if (cp)
501 filetypes[cnt_filetypes].icon = cp; 501 filetypes[cnt_filetypes].icon = (unsigned char *)cp;
502 else 502 else
503 return 0; 503 return 0;
504 } 504 }
@@ -538,13 +538,13 @@ bool read_config(const char* file)
538 { 538 {
539 if (cnt_exttypes >= MAX_EXTTYPES) 539 if (cnt_exttypes >= MAX_EXTTYPES)
540 { 540 {
541 gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); 541 gui_syncsplash(HZ, true, str(LANG_FILETYPES_EXTENSION_FULL));
542 break; 542 break;
543 } 543 }
544 544
545 if (cnt_filetypes >= MAX_FILETYPES) 545 if (cnt_filetypes >= MAX_FILETYPES)
546 { 546 {
547 gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL)); 547 gui_syncsplash(HZ, true, str(LANG_FILETYPES_FULL));
548 break; 548 break;
549 } 549 }
550 550
@@ -635,7 +635,7 @@ bool read_config(const char* file)
635 { 635 {
636 cp = string2icon(str[icon]); 636 cp = string2icon(str[icon]);
637 if (cp) 637 if (cp)
638 exttypes[i].type->icon = cp; 638 exttypes[i].type->icon = (unsigned char *)cp;
639 } 639 }
640 } 640 }
641 } 641 }
@@ -713,7 +713,7 @@ static char* string2icon(const char* str)
713 (unsigned long) string_buffer - 713 (unsigned long) string_buffer -
714 (unsigned long) next_free_string) < ICON_LENGTH) 714 (unsigned long) next_free_string) < ICON_LENGTH)
715 { 715 {
716 gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); 716 gui_syncsplash(HZ, true, str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
717 return NULL; 717 return NULL;
718 } 718 }
719 719
@@ -762,14 +762,14 @@ static char* get_string(const char* str)
762 (unsigned long) string_buffer - 762 (unsigned long) string_buffer -
763 (unsigned long) next_free_string)) 763 (unsigned long) next_free_string))
764 { 764 {
765 strcpy(next_free_string,str); 765 strcpy(next_free_string, str);
766 cp=next_free_string; 766 cp=next_free_string;
767 next_free_string=&next_free_string[l]; 767 next_free_string=&next_free_string[l];
768 return cp; 768 return cp;
769 } 769 }
770 else 770 else
771 { 771 {
772 gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); 772 gui_syncsplash(HZ, true, str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
773 return NULL; 773 return NULL;
774 } 774 }
775} 775}