From fc19445ba011fed5b9568b2621ffe70bd23638c3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Fri, 25 Feb 2005 18:50:16 +0000 Subject: more long policy git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6065 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/sprintf.c | 6 +++--- firmware/drivers/ata.c | 10 +++++----- firmware/drivers/fat.c | 14 +++++++------- firmware/export/fat.h | 2 +- firmware/kernel.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/firmware/common/sprintf.c b/firmware/common/sprintf.c index 3518a1ba5e..0b42f66ba1 100644 --- a/firmware/common/sprintf.c +++ b/firmware/common/sprintf.c @@ -43,7 +43,7 @@ static int format( char *str; char tmpbuf[12], pad; int ch, width, val, sign; - long lval; + long lval, lsign; unsigned int uval; unsigned long ulval; bool ok = true; @@ -116,7 +116,7 @@ static int format( while (ulval); break; case 'd': - lval = sign = va_arg (ap, long); + lval = lsign = va_arg (ap, long); if (lval < 0) lval = -lval; do @@ -125,7 +125,7 @@ static int format( lval /= 10; } while (lval > 0); - if (sign < 0) + if (lsign < 0) *--str = '-'; break; diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 12ad11532a..b1910c6a7a 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -243,7 +243,7 @@ bool old_recorder = false; int ata_spinup_time = 0; static bool spinup = false; static bool sleeping = true; -static int sleep_timeout = 5*HZ; +static long sleep_timeout = 5*HZ; static bool poweroff = false; #ifdef HAVE_ATA_POWER_OFF 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) { - int timeout = current_tick + HZ*30; + long timeout = current_tick + HZ*30; while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) { last_disk_activity = current_tick; 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) { - int timeout; + long timeout; if (!wait_for_bsy()) return 0; @@ -479,7 +479,7 @@ int ata_read_sectors(IF_MV2(int drive,) void* inbuf) { int ret = 0; - int timeout; + long timeout; int count; void* buf; long spinup_start; @@ -762,7 +762,7 @@ int ata_write_sectors(IF_MV2(int drive,) { int i; int ret = 0; - int spinup_start; + long spinup_start; #ifdef HAVE_MULTIVOLUME (void)drive; /* unused for now */ diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 374e951996..9056870bc5 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -629,7 +629,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce, sectorbuf); if(rc < 0) { - panicf("flush_fat_sector() - Could not write sector %d" + panicf("flush_fat_sector() - Could not write sector %ld" " (error %d)\n", secnum, rc); } @@ -649,7 +649,7 @@ static void flush_fat_sector(struct fat_cache_entry *fce, secnum, 1, sectorbuf); if(rc < 0) { - panicf("flush_fat_sector() - Could not write sector %d" + panicf("flush_fat_sector() - Could not write sector %ld" " (error %d)\n", secnum, rc); } @@ -832,15 +832,15 @@ static int update_fat_entry(IF_MV2(struct bpb* fat_bpb,) { long sector = 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); if (entry==val) - panicf("Creating FAT loop: %x,%x\n",entry,val); + panicf("Creating FAT loop: %lx,%lx\n",entry,val); 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); if (!sec) @@ -2012,9 +2012,9 @@ static int transfer(IF_MV2(struct bpb* fat_bpb,) firstallowed = fat_bpb->firstdatasector; 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) - panicf("Write %d after data\n", + panicf("Write %ld after data\n", start + count - fat_bpb->totalsectors); rc = ata_write_sectors(IF_MV2(fat_bpb->drive,) start + fat_bpb->startsector, count, buf); diff --git a/firmware/export/fat.h b/firmware/export/fat.h index c9ce0805aa..3bb895cdc8 100644 --- a/firmware/export/fat.h +++ b/firmware/export/fat.h @@ -68,7 +68,7 @@ struct fat_dir { unsigned int entry; unsigned int entrycount; - int sector; + long sector; struct fat_file file; unsigned char sectorcache[3][SECTOR_SIZE]; }; diff --git a/firmware/kernel.c b/firmware/kernel.c index d21244202f..6280019e75 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -289,7 +289,7 @@ static void tick_start(unsigned int interval_in_ms) 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); return; } -- cgit v1.2.3