diff options
author | Barry Wardell <rockbox@barrywardell.net> | 2007-08-02 12:12:25 +0000 |
---|---|---|
committer | Barry Wardell <rockbox@barrywardell.net> | 2007-08-02 12:12:25 +0000 |
commit | c77b14571e96d1656ceb6da63827f59450a1b05c (patch) | |
tree | c2e9141ad4d223f4189d6822b67cd0b4dc890340 /rbutil | |
parent | 76635d55d1520e572c7f5408df444524e4aadb80 (diff) |
Fix a couple of warnings. Also fix a bug where the offset wasn't being reported right in errors when it was past 4GB.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14140 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/sansapatcher/bin2c.c | 1 | ||||
-rw-r--r-- | rbutil/sansapatcher/sansapatcher.c | 24 |
2 files changed, 13 insertions, 12 deletions
diff --git a/rbutil/sansapatcher/bin2c.c b/rbutil/sansapatcher/bin2c.c index 6aa3e49f69..a9ff6743f5 100644 --- a/rbutil/sansapatcher/bin2c.c +++ b/rbutil/sansapatcher/bin2c.c @@ -72,6 +72,7 @@ static int write_cfile(unsigned char* buf, off_t len, char* cname) static int write_hfile(unsigned char* buf, off_t len, char* cname) { + (void)buf; char filename[256]; FILE* fp; diff --git a/rbutil/sansapatcher/sansapatcher.c b/rbutil/sansapatcher/sansapatcher.c index c9f047f472..6b4b80896c 100644 --- a/rbutil/sansapatcher/sansapatcher.c +++ b/rbutil/sansapatcher/sansapatcher.c @@ -347,8 +347,8 @@ int is_e200(struct sansa_t* sansa) /* Check Main firmware header */ if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET, sectorbuf, 0x200) < 0) { - fprintf(stderr,"[ERR] Seek to 0x%08x in is_e200 failed.\n", - (unsigned int)(sansa->start+PPMI_OFFSET)); + fprintf(stderr,"[ERR] Seek to 0x%08llx in is_e200 failed.\n", + sansa->start+PPMI_OFFSET); return -5; } if (memcmp(sectorbuf,"PPMI",4)!=0) { @@ -359,8 +359,8 @@ int is_e200(struct sansa_t* sansa) /* Check main mi4 file header */ if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET+0x200, sectorbuf, 0x200) < 0) { - fprintf(stderr,"[ERR] Seek to 0x%08x in is_e200 failed.\n", - (unsigned int)(sansa->start+PPMI_OFFSET+0x200)); + fprintf(stderr,"[ERR] Seek to 0x%08llx in is_e200 failed.\n", + sansa->start+PPMI_OFFSET+0x200); return -5; } @@ -631,8 +631,8 @@ int sansa_add_bootloader(struct sansa_t* sansa, char* filename, int type) /* Now write the whole thing back to the Sansa */ if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { - fprintf(stderr,"[ERR] Seek to 0x%08x in add_bootloader failed.\n", - (unsigned int)(sansa->start+PPMI_OFFSET)); + fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n", + sansa->start+PPMI_OFFSET); return -5; } @@ -668,8 +668,8 @@ int sansa_delete_bootloader(struct sansa_t* sansa) /* Now write the whole thing back to the Sansa */ if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { - fprintf(stderr,"[ERR] Seek to 0x%08x in add_bootloader failed.\n", - (unsigned int)(sansa->start+PPMI_OFFSET)); + fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n", + sansa->start+PPMI_OFFSET); return -5; } @@ -715,7 +715,7 @@ int sansa_update_of(struct sansa_t* sansa, char* filename) int of_length = 0; /* Keep gcc happy when building for rbutil */ int ppmi_length; struct mi4header_t mi4header; - char buf[512]; + unsigned char buf[512]; /* Step 1 - check we have an OF on the Sansa to upgrade. We expect the Rockbox bootloader to be installed and the OF to be after it on disk. */ @@ -739,7 +739,7 @@ int sansa_update_of(struct sansa_t* sansa, char* filename) if (get_mi4header(buf,&mi4header)!=0) { /* We don't have a valid MI4 file after a bootloader, so do nothing. */ fprintf(stderr,"[ERR] No original firmware found at 0x%08llx\n", - (loff_t)(sansa->start+PPMI_OFFSET+0x200+ppmi_length)); + sansa->start+PPMI_OFFSET+0x200+ppmi_length); return -1; } @@ -777,8 +777,8 @@ int sansa_update_of(struct sansa_t* sansa, char* filename) /* Step 3 - write the OF to the Sansa */ if (sansa_seek(sansa, sansa->start+PPMI_OFFSET+0x200+ppmi_length) < 0) { - fprintf(stderr,"[ERR] Seek to 0x%08x in sansa_update_of failed.\n", - (unsigned int)(sansa->start+PPMI_OFFSET+0x200+ppmi_length)); + fprintf(stderr,"[ERR] Seek to 0x%08llx in sansa_update_of failed.\n", + sansa->start+PPMI_OFFSET+0x200+ppmi_length); return -1; } |