summaryrefslogtreecommitdiff
path: root/rbutil/irivertools.cpp
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2007-06-10 22:08:48 +0000
committerAntoine Cellerier <dionoea@videolan.org>2007-06-10 22:08:48 +0000
commit1bc4ce9a0a949c4b93451354d5d53ae838b3659c (patch)
tree19b4bbe16f24cf095b42826090220435b0bf60c9 /rbutil/irivertools.cpp
parent71eedc7a5be6b01fc910967e93ef7f3acf92eeaf (diff)
downloadrockbox-1bc4ce9a0a949c4b93451354d5d53ae838b3659c.tar.gz
rockbox-1bc4ce9a0a949c4b93451354d5d53ae838b3659c.zip
Simplify code (use + operator to concatenate strings instead of Printf()). Please revert if use of Printf was intentional.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13612 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/irivertools.cpp')
-rwxr-xr-xrbutil/irivertools.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/rbutil/irivertools.cpp b/rbutil/irivertools.cpp
index 65891d546b..1e6341923d 100755
--- a/rbutil/irivertools.cpp
+++ b/rbutil/irivertools.cpp
@@ -61,8 +61,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
61 wxFile f; 61 wxFile f;
62 if(!f.Open(infile)) 62 if(!f.Open(infile))
63 { 63 {
64 err.Printf(wxT("Could not open: %s"),infile.c_str()); 64 ERR_DIALOG(wxT("Could not open: ") + infile, wxT("mkboot"));
65 ERR_DIALOG(err, wxT("mkboot"));
66 return false; 65 return false;
67 } 66 }
68 i = f.Read(image,16); 67 i = f.Read(image,16);
@@ -88,8 +87,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
88 /* Now, read the boot loader into the image */ 87 /* Now, read the boot loader into the image */
89 if(!f.Open(bootloader)) 88 if(!f.Open(bootloader))
90 { 89 {
91 err.Printf(wxT("Could not open: %s"),bootloader.c_str()); 90 ERR_DIALOG(wxT("Could not open: ") + bootloader, wxT("mkboot"));
92 ERR_DIALOG(err, wxT("mkboot"));
93 return false; 91 return false;
94 } 92 }
95 93
@@ -105,8 +103,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
105 103
106 if(!f.Open(outfile,wxFile::write)) 104 if(!f.Open(outfile,wxFile::write))
107 { 105 {
108 err.Printf(wxT("Could not open: %s"),outfile.c_str()); 106 ERR_DIALOG(wxT("Could not open: ") + outfile, wxT("mkboot"));
109 ERR_DIALOG(err, wxT("mkboot"));
110 return false; 107 return false;
111 } 108 }
112 109
@@ -230,14 +227,13 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
230 227
231 if(!infile.Open(infile_name)) 228 if(!infile.Open(infile_name))
232 { 229 {
233 err.Printf(wxT("Could not open: %s"),infile_name.c_str()); 230 ERR_DIALOG(wxT("Could not open: ") + infile_name, wxT("iriver_decode"));
234 ERR_DIALOG(err, wxT("iriver_decode"));
235 return -1; 231 return -1;
236 } 232 }
237 if(!outfile.Open(outfile_name,wxFile::write)) 233 if(!outfile.Open(outfile_name,wxFile::write))
238 { 234 {
239 err.Printf(wxT("Could not open: %s"),outfile_name.c_str()); 235 ERR_DIALOG(wxT("Could not open: ") + outfile_name,
240 ERR_DIALOG(err, wxT("iriver_decode")); 236 wxT("iriver_decode"));
241 return -1; 237 return -1;
242 } 238 }
243 lenread = infile.Read( headerdata, 512); 239 lenread = infile.Read( headerdata, 512);
@@ -417,14 +413,13 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
417 413
418 if(!infile.Open(infile_name,wxFile::read)) 414 if(!infile.Open(infile_name,wxFile::read))
419 { 415 {
420 err.Printf(wxT("Could not open: %s"),infile_name.c_str()); 416 ERR_DIALOG(wxT("Could not open: ") + infile_name, wxT("iriver_decode"));
421 ERR_DIALOG(err, wxT("iriver_decode"));
422 return -1; 417 return -1;
423 } 418 }
424 if(!outfile.Open(outfile_name,wxFile::write)) 419 if(!outfile.Open(outfile_name,wxFile::write))
425 { 420 {
426 err.Printf(wxT("Could not open: %s"),outfile_name.c_str()); 421 ERR_DIALOG(wxT("Could not open: ") + outfile_name,
427 ERR_DIALOG(err, wxT("iriver_decode")); 422 wxT("iriver_decode"));
428 return -1; 423 return -1;
429 } 424 }
430 425
@@ -562,14 +557,14 @@ bool PatchFirmware(wxString firmware,wxString bootloader,int series, int table_e
562 break; 557 break;
563 } 558 }
564 559
565 name1.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "firmware.bin"), 560 name1 = gv->stdpaths->GetUserDataDir()
566 gv->stdpaths->GetUserDataDir().c_str()); 561 + wxT("" PATH_SEP "download" PATH_SEP "firmware.bin"),
567 /* descrambled file */ 562 /* descrambled file */
568 name2.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "new.bin"), 563 name2 = gv->stdpaths->GetUserDataDir()
569 gv->stdpaths->GetUserDataDir().c_str()); 564 + wxT("" PATH_SEP "download" PATH_SEP "new.bin");
570 /* patched file */ 565 /* patched file */
571 name3.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "new.hex"), 566 name3 = gv->stdpaths->GetUserDataDir()
572 gv->stdpaths->GetUserDataDir().c_str()); 567 + wxT("" PATH_SEP "download" PATH_SEP "new.hex");
573 if (iriver_decode(firmware, name1, FALSE, STRIP_NONE) == -1) { 568 if (iriver_decode(firmware, name1, FALSE, STRIP_NONE) == -1) {
574 ERR_DIALOG(wxT("Error in descramble"), wxT("Descramble Firmware")); 569 ERR_DIALOG(wxT("Error in descramble"), wxT("Descramble Firmware"));
575 wxRemoveFile(name1); 570 wxRemoveFile(name1);