summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-08-02 12:12:25 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-08-02 12:12:25 +0000
commitc77b14571e96d1656ceb6da63827f59450a1b05c (patch)
treec2e9141ad4d223f4189d6822b67cd0b4dc890340
parent76635d55d1520e572c7f5408df444524e4aadb80 (diff)
downloadrockbox-c77b14571e96d1656ceb6da63827f59450a1b05c.tar.gz
rockbox-c77b14571e96d1656ceb6da63827f59450a1b05c.zip
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
-rw-r--r--rbutil/sansapatcher/bin2c.c1
-rw-r--r--rbutil/sansapatcher/sansapatcher.c24
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)
72 72
73static int write_hfile(unsigned char* buf, off_t len, char* cname) 73static int write_hfile(unsigned char* buf, off_t len, char* cname)
74{ 74{
75 (void)buf;
75 char filename[256]; 76 char filename[256];
76 FILE* fp; 77 FILE* fp;
77 78
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)
347 347
348 /* Check Main firmware header */ 348 /* Check Main firmware header */
349 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET, sectorbuf, 0x200) < 0) { 349 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET, sectorbuf, 0x200) < 0) {
350 fprintf(stderr,"[ERR] Seek to 0x%08x in is_e200 failed.\n", 350 fprintf(stderr,"[ERR] Seek to 0x%08llx in is_e200 failed.\n",
351 (unsigned int)(sansa->start+PPMI_OFFSET)); 351 sansa->start+PPMI_OFFSET);
352 return -5; 352 return -5;
353 } 353 }
354 if (memcmp(sectorbuf,"PPMI",4)!=0) { 354 if (memcmp(sectorbuf,"PPMI",4)!=0) {
@@ -359,8 +359,8 @@ int is_e200(struct sansa_t* sansa)
359 359
360 /* Check main mi4 file header */ 360 /* Check main mi4 file header */
361 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET+0x200, sectorbuf, 0x200) < 0) { 361 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET+0x200, sectorbuf, 0x200) < 0) {
362 fprintf(stderr,"[ERR] Seek to 0x%08x in is_e200 failed.\n", 362 fprintf(stderr,"[ERR] Seek to 0x%08llx in is_e200 failed.\n",
363 (unsigned int)(sansa->start+PPMI_OFFSET+0x200)); 363 sansa->start+PPMI_OFFSET+0x200);
364 return -5; 364 return -5;
365 } 365 }
366 366
@@ -631,8 +631,8 @@ int sansa_add_bootloader(struct sansa_t* sansa, char* filename, int type)
631 /* Now write the whole thing back to the Sansa */ 631 /* Now write the whole thing back to the Sansa */
632 632
633 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { 633 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) {
634 fprintf(stderr,"[ERR] Seek to 0x%08x in add_bootloader failed.\n", 634 fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n",
635 (unsigned int)(sansa->start+PPMI_OFFSET)); 635 sansa->start+PPMI_OFFSET);
636 return -5; 636 return -5;
637 } 637 }
638 638
@@ -668,8 +668,8 @@ int sansa_delete_bootloader(struct sansa_t* sansa)
668 /* Now write the whole thing back to the Sansa */ 668 /* Now write the whole thing back to the Sansa */
669 669
670 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { 670 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) {
671 fprintf(stderr,"[ERR] Seek to 0x%08x in add_bootloader failed.\n", 671 fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n",
672 (unsigned int)(sansa->start+PPMI_OFFSET)); 672 sansa->start+PPMI_OFFSET);
673 return -5; 673 return -5;
674 } 674 }
675 675
@@ -715,7 +715,7 @@ int sansa_update_of(struct sansa_t* sansa, char* filename)
715 int of_length = 0; /* Keep gcc happy when building for rbutil */ 715 int of_length = 0; /* Keep gcc happy when building for rbutil */
716 int ppmi_length; 716 int ppmi_length;
717 struct mi4header_t mi4header; 717 struct mi4header_t mi4header;
718 char buf[512]; 718 unsigned char buf[512];
719 719
720 /* Step 1 - check we have an OF on the Sansa to upgrade. We expect the 720 /* Step 1 - check we have an OF on the Sansa to upgrade. We expect the
721 Rockbox bootloader to be installed and the OF to be after it on disk. */ 721 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)
739 if (get_mi4header(buf,&mi4header)!=0) { 739 if (get_mi4header(buf,&mi4header)!=0) {
740 /* We don't have a valid MI4 file after a bootloader, so do nothing. */ 740 /* We don't have a valid MI4 file after a bootloader, so do nothing. */
741 fprintf(stderr,"[ERR] No original firmware found at 0x%08llx\n", 741 fprintf(stderr,"[ERR] No original firmware found at 0x%08llx\n",
742 (loff_t)(sansa->start+PPMI_OFFSET+0x200+ppmi_length)); 742 sansa->start+PPMI_OFFSET+0x200+ppmi_length);
743 return -1; 743 return -1;
744 } 744 }
745 745
@@ -777,8 +777,8 @@ int sansa_update_of(struct sansa_t* sansa, char* filename)
777 777
778 /* Step 3 - write the OF to the Sansa */ 778 /* Step 3 - write the OF to the Sansa */
779 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET+0x200+ppmi_length) < 0) { 779 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET+0x200+ppmi_length) < 0) {
780 fprintf(stderr,"[ERR] Seek to 0x%08x in sansa_update_of failed.\n", 780 fprintf(stderr,"[ERR] Seek to 0x%08llx in sansa_update_of failed.\n",
781 (unsigned int)(sansa->start+PPMI_OFFSET+0x200+ppmi_length)); 781 sansa->start+PPMI_OFFSET+0x200+ppmi_length);
782 return -1; 782 return -1;
783 } 783 }
784 784