1
0
Fork 0
forked from len0rd/rockbox

more long policy

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6065 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jean-Philippe Bernardy 2005-02-25 18:50:16 +00:00
parent 5786b384ab
commit fc19445ba0
5 changed files with 17 additions and 17 deletions

View file

@ -43,7 +43,7 @@ static int format(
char *str; char *str;
char tmpbuf[12], pad; char tmpbuf[12], pad;
int ch, width, val, sign; int ch, width, val, sign;
long lval; long lval, lsign;
unsigned int uval; unsigned int uval;
unsigned long ulval; unsigned long ulval;
bool ok = true; bool ok = true;
@ -116,7 +116,7 @@ static int format(
while (ulval); while (ulval);
break; break;
case 'd': case 'd':
lval = sign = va_arg (ap, long); lval = lsign = va_arg (ap, long);
if (lval < 0) if (lval < 0)
lval = -lval; lval = -lval;
do do
@ -125,7 +125,7 @@ static int format(
lval /= 10; lval /= 10;
} }
while (lval > 0); while (lval > 0);
if (sign < 0) if (lsign < 0)
*--str = '-'; *--str = '-';
break; break;

View file

@ -243,7 +243,7 @@ bool old_recorder = false;
int ata_spinup_time = 0; int ata_spinup_time = 0;
static bool spinup = false; static bool spinup = false;
static bool sleeping = true; static bool sleeping = true;
static int sleep_timeout = 5*HZ; static long sleep_timeout = 5*HZ;
static bool poweroff = false; static bool poweroff = false;
#ifdef HAVE_ATA_POWER_OFF #ifdef HAVE_ATA_POWER_OFF
static int poweroff_timeout = 2*HZ; static int poweroff_timeout = 2*HZ;
@ -270,7 +270,7 @@ static int set_features(void);
static int wait_for_bsy(void) __attribute__ ((section (".icode"))); static int wait_for_bsy(void) __attribute__ ((section (".icode")));
static int wait_for_bsy(void) static int wait_for_bsy(void)
{ {
int timeout = current_tick + HZ*30; long timeout = current_tick + HZ*30;
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) { while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
last_disk_activity = current_tick; last_disk_activity = current_tick;
yield(); yield();
@ -285,7 +285,7 @@ static int wait_for_bsy(void)
static int wait_for_rdy(void) __attribute__ ((section (".icode"))); static int wait_for_rdy(void) __attribute__ ((section (".icode")));
static int wait_for_rdy(void) static int wait_for_rdy(void)
{ {
int timeout; long timeout;
if (!wait_for_bsy()) if (!wait_for_bsy())
return 0; return 0;
@ -479,7 +479,7 @@ int ata_read_sectors(IF_MV2(int drive,)
void* inbuf) void* inbuf)
{ {
int ret = 0; int ret = 0;
int timeout; long timeout;
int count; int count;
void* buf; void* buf;
long spinup_start; long spinup_start;
@ -762,7 +762,7 @@ int ata_write_sectors(IF_MV2(int drive,)
{ {
int i; int i;
int ret = 0; int ret = 0;
int spinup_start; long spinup_start;
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME
(void)drive; /* unused for now */ (void)drive; /* unused for now */

View file

@ -629,7 +629,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce,
sectorbuf); sectorbuf);
if(rc < 0) if(rc < 0)
{ {
panicf("flush_fat_sector() - Could not write sector %d" panicf("flush_fat_sector() - Could not write sector %ld"
" (error %d)\n", " (error %d)\n",
secnum, rc); secnum, rc);
} }
@ -649,7 +649,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce,
secnum, 1, sectorbuf); secnum, 1, sectorbuf);
if(rc < 0) if(rc < 0)
{ {
panicf("flush_fat_sector() - Could not write sector %d" panicf("flush_fat_sector() - Could not write sector %ld"
" (error %d)\n", " (error %d)\n",
secnum, rc); secnum, rc);
} }
@ -832,15 +832,15 @@ static int update_fat_entry(IF_MV2(struct bpb* fat_bpb,)
{ {
long sector = entry / CLUSTERS_PER_FAT_SECTOR; long sector = entry / CLUSTERS_PER_FAT_SECTOR;
int offset = entry % CLUSTERS_PER_FAT_SECTOR; int offset = entry % CLUSTERS_PER_FAT_SECTOR;
long unsigned int* sec; unsigned long* sec;
LDEBUGF("update_fat_entry(%lx,%lx)\n",entry,val); LDEBUGF("update_fat_entry(%lx,%lx)\n",entry,val);
if (entry==val) if (entry==val)
panicf("Creating FAT loop: %x,%x\n",entry,val); panicf("Creating FAT loop: %lx,%lx\n",entry,val);
if ( entry < 2 ) if ( entry < 2 )
panicf("Updating reserved FAT entry %d.\n",entry); panicf("Updating reserved FAT entry %ld.\n",entry);
sec = cache_fat_sector(IF_MV2(fat_bpb,) sector, true); sec = cache_fat_sector(IF_MV2(fat_bpb,) sector, true);
if (!sec) if (!sec)
@ -2012,9 +2012,9 @@ static int transfer(IF_MV2(struct bpb* fat_bpb,)
firstallowed = fat_bpb->firstdatasector; firstallowed = fat_bpb->firstdatasector;
if (start < firstallowed) if (start < firstallowed)
panicf("Write %d before data\n", firstallowed - start); panicf("Write %ld before data\n", firstallowed - start);
if (start + count > fat_bpb->totalsectors) if (start + count > fat_bpb->totalsectors)
panicf("Write %d after data\n", panicf("Write %ld after data\n",
start + count - fat_bpb->totalsectors); start + count - fat_bpb->totalsectors);
rc = ata_write_sectors(IF_MV2(fat_bpb->drive,) rc = ata_write_sectors(IF_MV2(fat_bpb->drive,)
start + fat_bpb->startsector, count, buf); start + fat_bpb->startsector, count, buf);

View file

@ -68,7 +68,7 @@ struct fat_dir
{ {
unsigned int entry; unsigned int entry;
unsigned int entrycount; unsigned int entrycount;
int sector; long sector;
struct fat_file file; struct fat_file file;
unsigned char sectorcache[3][SECTOR_SIZE]; unsigned char sectorcache[3][SECTOR_SIZE];
}; };

View file

@ -289,7 +289,7 @@ static void tick_start(unsigned int interval_in_ms)
if(count > 0xffffL) if(count > 0xffffL)
{ {
panicf("Error! The tick interval is too long (%dms->%x)\n", panicf("Error! The tick interval is too long (%dms->%lx)\n",
interval_in_ms, count); interval_in_ms, count);
return; return;
} }