summaryrefslogtreecommitdiff
path: root/apps/filetree.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-12-05 22:44:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-12-05 22:44:42 +0000
commitf981ea93fb411019133a022c7dd873166d66b5dd (patch)
tree4f671d67b6584068d4e388c5fd4b6cdd54b5cca2 /apps/filetree.c
parent5c3546ccbb14b576fd5eef3815bdfc97047de422 (diff)
downloadrockbox-f981ea93fb411019133a022c7dd873166d66b5dd.tar.gz
rockbox-f981ea93fb411019133a022c7dd873166d66b5dd.zip
kill gcc4 warnings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8162 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetree.c')
-rw-r--r--apps/filetree.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 708c135be7..b870f969b5 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -106,10 +106,10 @@ static void check_file_thumbnails(struct tree_context* c)
106 { 106 {
107 int ext_pos; 107 int ext_pos;
108 108
109 ext_pos = strlen(entry->d_name) - strlen(file_thumbnail_ext); 109 ext_pos = strlen((char *)entry->d_name) - strlen(file_thumbnail_ext);
110 if (ext_pos <= 0 /* too short to carry ".talk" */ 110 if (ext_pos <= 0 /* too short to carry ".talk" */
111 || (entry->attribute & ATTR_DIRECTORY) /* no file */ 111 || (entry->attribute & ATTR_DIRECTORY) /* no file */
112 || strcasecmp(&entry->d_name[ext_pos], file_thumbnail_ext)) 112 || strcasecmp((char *)&entry->d_name[ext_pos], file_thumbnail_ext))
113 { /* or doesn't end with ".talk", no candidate */ 113 { /* or doesn't end with ".talk", no candidate */
114 continue; 114 continue;
115 } 115 }
@@ -121,7 +121,7 @@ static void check_file_thumbnails(struct tree_context* c)
121 /* search corresponding file in dir cache */ 121 /* search corresponding file in dir cache */
122 for (i=0; i < c->filesindir; i++) 122 for (i=0; i < c->filesindir; i++)
123 { 123 {
124 if (!strcasecmp(dircache[i].name, entry->d_name)) 124 if (!strcasecmp(dircache[i].name, (char *)entry->d_name))
125 { /* match */ 125 { /* match */
126 dircache[i].attr |= TREE_ATTR_THUMBNAIL; /* set the flag */ 126 dircache[i].attr |= TREE_ATTR_THUMBNAIL; /* set the flag */
127 break; /* exit search loop, because we found it */ 127 break; /* exit search loop, because we found it */
@@ -219,14 +219,12 @@ int ft_load(struct tree_context* c, const char* tempdir)
219 if (!entry) 219 if (!entry)
220 break; 220 break;
221 221
222 len = strlen(entry->d_name); 222 len = strlen((char *)entry->d_name);
223 223
224 /* skip directories . and .. */ 224 /* skip directories . and .. */
225 if ((entry->attribute & ATTR_DIRECTORY) && 225 if ((entry->attribute & ATTR_DIRECTORY) &&
226 (((len == 1) && 226 (((len == 1) && (!strncmp((char *)entry->d_name, ".", 1))) ||
227 (!strncmp(entry->d_name, ".", 1))) || 227 ((len == 2) && (!strncmp((char *)entry->d_name, "..", 2))))) {
228 ((len == 2) &&
229 (!strncmp(entry->d_name, "..", 2))))) {
230 i--; 228 i--;
231 continue; 229 continue;
232 } 230 }
@@ -249,7 +247,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
249 247
250 /* check for known file types */ 248 /* check for known file types */
251 if ( !(dptr->attr & ATTR_DIRECTORY) ) 249 if ( !(dptr->attr & ATTR_DIRECTORY) )
252 dptr->attr |= filetype_get_attr(entry->d_name); 250 dptr->attr |= filetype_get_attr((char *)entry->d_name);
253 251
254#ifdef BOOTFILE 252#ifdef BOOTFILE
255 /* memorize/compare details about the boot file */ 253 /* memorize/compare details about the boot file */
@@ -295,7 +293,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
295 dptr->time_write = 293 dptr->time_write =
296 (long)entry->wrtdate<<16 | 294 (long)entry->wrtdate<<16 |
297 (long)entry->wrttime; /* in one # */ 295 (long)entry->wrttime; /* in one # */
298 strcpy(dptr->name,entry->d_name); 296 strcpy(dptr->name, (char *)entry->d_name);
299 name_buffer_used += len + 1; 297 name_buffer_used += len + 1;
300 298
301 if (dptr->attr & ATTR_DIRECTORY) /* count the remaining dirs */ 299 if (dptr->attr & ATTR_DIRECTORY) /* count the remaining dirs */
@@ -384,7 +382,7 @@ int ft_enter(struct tree_context* c)
384 /* wps config file */ 382 /* wps config file */
385 case TREE_ATTR_WPS: 383 case TREE_ATTR_WPS:
386 wps_data_load(gui_wps[0].data, buf, true, true); 384 wps_data_load(gui_wps[0].data, buf, true, true);
387 set_file(buf, global_settings.wps_file, 385 set_file(buf, (char *)global_settings.wps_file,
388 MAX_FILENAME); 386 MAX_FILENAME);
389 break; 387 break;
390 388
@@ -392,7 +390,7 @@ int ft_enter(struct tree_context* c)
392 /* remote-wps config file */ 390 /* remote-wps config file */
393 case TREE_ATTR_RWPS: 391 case TREE_ATTR_RWPS:
394 wps_data_load(gui_wps[1].data, buf, true, true); 392 wps_data_load(gui_wps[1].data, buf, true, true);
395 set_file(buf, global_settings.rwps_file, 393 set_file(buf, (char *)global_settings.rwps_file,
396 MAX_FILENAME); 394 MAX_FILENAME);
397 break; 395 break;
398#endif 396#endif
@@ -416,7 +414,7 @@ int ft_enter(struct tree_context* c)
416 414
417 case TREE_ATTR_LNG: 415 case TREE_ATTR_LNG:
418 if(!lang_load(buf)) { 416 if(!lang_load(buf)) {
419 set_file(buf, global_settings.lang_file, 417 set_file(buf, (char *)global_settings.lang_file,
420 MAX_FILENAME); 418 MAX_FILENAME);
421 talk_init(); /* use voice of same language */ 419 talk_init(); /* use voice of same language */
422 gui_syncsplash(HZ, true, str(LANG_LANGUAGE_LOADED)); 420 gui_syncsplash(HZ, true, str(LANG_LANGUAGE_LOADED));
@@ -426,7 +424,7 @@ int ft_enter(struct tree_context* c)
426#ifdef HAVE_LCD_BITMAP 424#ifdef HAVE_LCD_BITMAP
427 case TREE_ATTR_FONT: 425 case TREE_ATTR_FONT:
428 font_load(buf); 426 font_load(buf);
429 set_file(buf, global_settings.font_file, MAX_FILENAME); 427 set_file(buf, (char *)global_settings.font_file, MAX_FILENAME);
430 break; 428 break;
431#endif 429#endif
432 430