long policy

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5931 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jean-Philippe Bernardy 2005-02-12 12:29:41 +00:00
parent 39eb8e134f
commit 8758713f84
2 changed files with 14 additions and 11 deletions

View file

@ -131,9 +131,9 @@ int db_load(struct tree_context* c)
int i, offset, rc;
int dcachesize = global_settings.max_files_in_dir * sizeof(struct entry);
int itemcount, stringlen, hits=0;
unsigned int* nptr = (void*) c->name_buffer;
unsigned int* dptr = c->dircache;
unsigned int* safeplace = NULL;
unsigned long* nptr = (void*) c->name_buffer;
unsigned long* dptr = c->dircache;
unsigned long* safeplace = NULL;
int safeplacelen = 0;
int table = c->currtable;
@ -169,7 +169,7 @@ int db_load(struct tree_context* c)
for (i=0; i < 4; i++) {
strcpy(nbuf, labels[i]);
dptr[0] = (unsigned int)nbuf;
dptr[0] = (unsigned long)nbuf;
dptr[1] = tables[i];
nbuf += strlen(nbuf) + 1;
dptr += 2;
@ -189,7 +189,7 @@ int db_load(struct tree_context* c)
for (i=0; i < 3; i++) {
strcpy(nbuf, labels[i]);
dptr[0] = (unsigned int)nbuf;
dptr[0] = (unsigned long)nbuf;
dptr[1] = tables[i];
nbuf += strlen(nbuf) + 1;
dptr += 2;
@ -345,7 +345,7 @@ int db_load(struct tree_context* c)
}
/* store name pointer in dir cache */
dptr[0] = (unsigned int)nptr;
dptr[0] = (unsigned long)nptr;
if (skip)
lseek(fd, skip, SEEK_CUR);
@ -374,7 +374,7 @@ int db_load(struct tree_context* c)
if (c->currtable == albums4artist && !c->dirfull) {
strcpy((char*)nptr, str(LANG_ID3DB_ALL_SONGS));
dptr[0] = (unsigned int)nptr;
dptr[0] = (unsigned long)nptr;
dptr[1] = extra; /* offset to artist */
hits++;
}
@ -560,7 +560,7 @@ static int db_play_folder(struct tree_context* c)
lseek(fd, pathoffset, SEEK_SET);
rc = read(fd, buf, sizeof(buf));
if (rc < songlen) {
DEBUGF("short path read(%d) = %d\n", sizeof(buf), rc);
DEBUGF("short path read(%ld) = %d\n", sizeof(buf), rc);
return -2;
}

View file

@ -24,6 +24,7 @@
#include <lcd.h>
#include <debug.h>
#include <font.h>
#include "limits.h"
#include "bookmark.h"
#include "tree.h"
#include "settings.h"
@ -160,9 +161,9 @@ static int compare(const void* p1, const void* p2)
int t2 = e2->attr & TREE_ATTR_MASK;
if (!t1) /* unknown type */
t1 = 0x7FFFFFFF; /* gets a high number, to sort after known */
t1 = INT_MAX; /* gets a high number, to sort after known */
if (!t2) /* unknown type */
t2 = 0x7FFFFFFF; /* gets a high number, to sort after known */
t2 = INT_MAX; /* gets a high number, to sort after known */
if (t1 - t2) /* if different */
return t1 - t2;
@ -276,7 +277,9 @@ int ft_load(struct tree_context* c, const char* tempdir)
break;
}
dptr->name = &c->name_buffer[name_buffer_used];
dptr->time_write = entry->wrtdate<<16 | entry->wrttime; /* in one # */
dptr->time_write =
(long)entry->wrtdate<<16 |
(long)entry->wrttime; /* in one # */
strcpy(dptr->name,entry->d_name);
name_buffer_used += len + 1;