diff --git a/HBC/META.XML b/HBC/META.XML index da47d666..1ad230e0 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 2.0 r1067 - 201102052107 + 2.0 r1068 + 201102060936 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. diff --git a/Languages/czech.lang b/Languages/czech.lang index efd6ed75..9dd2814c 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) e->e,r->r,u->u, c->c \n" "Language-Team: r1056 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Automatický start síte" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Cesta pro BCA kódy" diff --git a/Languages/danish.lang b/Languages/danish.lang index c703e566..82c6c0a9 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Fox888[dk]\n" "Language-Team: [dk]\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "AutoInit netværk" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Sti til BCA koder" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index f3fec469..1e5b024b 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2011-02-04 13:06+0100\n" "Last-Translator: glowy\n" "Language-Team: tj_cool, glowy\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Netwerk Auto init." +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Locatie BCA codes" diff --git a/Languages/english.lang b/Languages/english.lang index fbde2294..84e0a2f3 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 21c87e8a..4f0a4219 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: c64rmx\n" "Language-Team: \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Autom. verkon käynnistys" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "" diff --git a/Languages/french.lang b/Languages/french.lang index 23b47da7..0f7f7543 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Cyan\n" "Language-Team: Badablek, Amour, ikya & Kin8\n" @@ -168,6 +168,9 @@ msgstr "Auteur(s):" msgid "AutoInit Network" msgstr "AutoInit réseau" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Dossier codes BCA" diff --git a/Languages/german.lang b/Languages/german.lang index d709d229..1879f432 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2010-07-03 17:35-0800\n" "Last-Translator: TheRealVisitor\n" "Language-Team: Bertilax, Snoozer, wishmasterf, ZEN.13, TheRealVisitor\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Autoinit. Netzwerk" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA Codes" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index c06f079d..9c4c3c82 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-12-29 11:05+0100\n" "Last-Translator: Springdale\n" "Language-Team: Tusk, Springdale\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Hálózat AutoInit" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA kód útvonal" diff --git a/Languages/italian.lang b/Languages/italian.lang index 93c5a9b0..c6c5b60c 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2011-01-22 20:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: Cambo\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Inizializz. Rete Automatica" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Cart. Codici BCA" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index 4bd74027..3e762d88 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ichiroling\n" "Language-Team: hosigumayuugi, papa\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "自動ネット接続" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCAコード" diff --git a/Languages/korean.lang b/Languages/korean.lang index 6248968c..10b91767 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nextos@korea.com\n" "Language-Team: \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "자동네트웍설정" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index 71ef2d77..3948b36d 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: raschi\n" "Language-Team: raschi\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Autostart nettverk" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA kode sti" diff --git a/Languages/polish.lang b/Languages/polish.lang index 5905fc8f..300bf307 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Autoinicjalizacja sieci" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Sciezka kodow BCA" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 9acb6647..56c35eb3 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-23 18:52+0200\n" "Last-Translator: aniemotion\n" "Language-Team: boto12, aniemotion\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Auto-iniciar Rede" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Caminho do BCA Codes" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index aaf03437..9e242834 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2010-03-22 10:55-0000\n" "Last-Translator: Sky8000\n" "Language-Team: Sky8000 \n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Auto-iniciar Rede" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Pasta Códigos BCA" diff --git a/Languages/russian.lang b/Languages/russian.lang index 04bd321a..c46bcb8a 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nikolai_ca\n" "Language-Team: Kir, alendit, nikolai_ca\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "АвтоИнициализация Сети" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Путь к кодам BCA" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index 74e2fc03..7011eaff 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: knife.hu kavid emul8ion\n" "Language-Team: kavid\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "自动检测网络" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA代码路径" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index 6064859b..8dd12c38 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: SirPalax\n" "Language-Team: Penn, SirPalax\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "AutoIniciar la Red" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "Ruta Códigos BCA" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index 437dde5e..698ddf03 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2010-01-19 17:39+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Autoinitiera Nätverk" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA kodssökväg" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 380790a1..905361f2 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2010-02-15 21:00+0800\n" "Last-Translator: Jane.H\n" "Language-Team: kyogc, Miller, Mika Li, Jane.H\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "自動檢查網路" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BAC代碼路徑" diff --git a/Languages/thai.lang b/Languages/thai.lang index 54cb256d..4b84d460 100644 --- a/Languages/thai.lang +++ b/Languages/thai.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Nitro_subzero \n" "Language-Team: Nitro_subzero\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "ทำการเชื่อมต่อเครือข่าย" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index e809147a..04fd08bc 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-05 22:06+0100\n" +"POT-Creation-Date: 2011-02-06 19:36+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: omercigingelini\n" "Language-Team: omercigingelini\n" @@ -168,6 +168,9 @@ msgstr "" msgid "AutoInit Network" msgstr "Ağı ototanımla" +msgid "Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem." +msgstr "" + msgid "BCA Codes Path" msgstr "BCA Kod Yolu" diff --git a/Makefile b/Makefile index b462509f..989da6ae 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ INCLUDES := source # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -O3 -Wall -Wno-multichar $(MACHDEP) $(INCLUDE) +CFLAGS = -g -O3 -Wall -Wno-multichar -Wno-unused-parameter -Wextra $(MACHDEP) $(INCLUDE) CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size -include $(PROJECTDIR)/Make.config diff --git a/gui.pnproj b/gui.pnproj index 9de9c2af..2f251a5d 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/gui.pnps b/gui.pnps index 8fe1e86e..45a7f010 100644 --- a/gui.pnps +++ b/gui.pnps @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/Controls/DeviceHandler.cpp b/source/Controls/DeviceHandler.cpp index 6703817d..e5368026 100644 --- a/source/Controls/DeviceHandler.cpp +++ b/source/Controls/DeviceHandler.cpp @@ -163,16 +163,10 @@ static inline bool USBSpinUp() bool DeviceHandler::SetUSBPort(int port) { - if(Settings.USBPort != 2) - DeviceHandler::Instance()->UnMountAllUSB(); - int ret = USBStorage2_SetPort(port); USBSpinUp(); - if(Settings.USBPort != 2) - DeviceHandler::Instance()->MountAllUSB(); - return ret >= 0; } diff --git a/source/FileOperations/File.cpp b/source/FileOperations/File.cpp index ce68add3..f37d47c4 100644 --- a/source/FileOperations/File.cpp +++ b/source/FileOperations/File.cpp @@ -92,9 +92,6 @@ int CFile::read(u8 * ptr, size_t size) int CFile::write(const u8 * ptr, size_t size) { - if(size < 0) - return size; - if(file_fd) { int ret = fwrite(ptr, 1, size, file_fd); diff --git a/source/FileOperations/fileops.cpp b/source/FileOperations/fileops.cpp index ebe37717..4342bef7 100644 --- a/source/FileOperations/fileops.cpp +++ b/source/FileOperations/fileops.cpp @@ -274,8 +274,8 @@ static bool CompareDevices(const char *src, const char *dest) ***************************************************************************/ extern "C" int CopyFile(const char * src, const char * dest) { - u32 read = 1; - u32 wrote = 1; + int read = 1; + int wrote = 1; char * filename = strrchr(src, '/'); if(filename) diff --git a/source/ImageOperations/TextureConverter.c b/source/ImageOperations/TextureConverter.c index 74b2b076..40347fe3 100644 --- a/source/ImageOperations/TextureConverter.c +++ b/source/ImageOperations/TextureConverter.c @@ -526,7 +526,8 @@ u8 * GDImageToRGBA8(gdImagePtr * gdImg, int * w, int * h) return NULL; u8 a; - u32 x, y, pixel, offset; + int x, y; + u32 pixel, offset; for(y = 0; y < height; ++y) { @@ -557,7 +558,7 @@ u8 * GDImageToRGBA8(gdImagePtr * gdImg, int * w, int * h) u8 * FlipRGBAImage(const u8 *src, u32 width, u32 height) { - int x, y; + u32 x, y; int len = datasizeRGBA8(width, height); diff --git a/source/StartUpProcess.cpp b/source/StartUpProcess.cpp index af42aa2c..175f2e77 100644 --- a/source/StartUpProcess.cpp +++ b/source/StartUpProcess.cpp @@ -158,11 +158,15 @@ bool StartUpProcess::Execute() } if(!IosLoader::IsHermesIOS()) + { Settings.USBPort = 0; + } else if(Settings.USBPort == 1) { SetTextf("Changing USB Port to %i\n", Settings.USBPort); + DeviceHandler::Instance()->UnMountAllUSB(); DeviceHandler::SetUSBPort(Settings.USBPort); + DeviceHandler::Instance()->MountAllUSB(); } gprintf("\tLoading font...%s\n", Theme::LoadFont(Settings.theme_path) ? "done" : "failed (using default)"); diff --git a/source/gecko.c b/source/gecko.c index 00af0293..b086cda1 100644 --- a/source/gecko.c +++ b/source/gecko.c @@ -102,7 +102,12 @@ static const devoptab_t gecko_out = { NULL, // device dirreset_r NULL, // device dirnext_r NULL, // device dirclose_r - NULL // device statvfs_r + NULL, // device statvfs_r + NULL, // device ftruncate_r + NULL, // device fsync_r + NULL, // device deviceData + NULL, // device chmod_r + NULL, // device fchmod_r }; void USBGeckoOutput() diff --git a/source/libs/libwbfs/libwbfs.c b/source/libs/libwbfs/libwbfs.c index 3b98964c..c4382e84 100644 --- a/source/libs/libwbfs/libwbfs.c +++ b/source/libs/libwbfs/libwbfs.c @@ -99,7 +99,7 @@ wbfs_t*wbfs_open_partition(rw_sector_callback_t read_hdsector, rw_sector_callbac ERROR( "bad magic" ); if (!force_mode && hd_sector_size && head->hd_sec_sz_s != size_to_shift(hd_sector_size)) ERROR( "hd sector size doesn't match" ); - if (!force_mode && num_hd_sector && head->n_hd_sec != wbfs_htonl( num_hd_sector )) + if (!force_mode && num_hd_sector && head->n_hd_sec != (u32) wbfs_htonl( num_hd_sector )) ERROR( "hd num sector doesn't match" ); p->hd_sec_sz = 1 << head->hd_sec_sz_s; p->hd_sec_sz_s = head->hd_sec_sz_s; @@ -797,7 +797,7 @@ int wbfs_iso_file_read(wbfs_disc_t*d, u32 offset, u8 *data, u32 len) ret_off = lseek(fd, off, SEEK_SET); if (ret_off != off) return -1; ret = read(fd, data, len); - if (ret != len) return -2; + if (ret != (int) len) return -2; return 0; } diff --git a/source/libwiigui/gui_keyboard.cpp b/source/libwiigui/gui_keyboard.cpp index 90026067..8f3c5fc5 100644 --- a/source/libwiigui/gui_keyboard.cpp +++ b/source/libwiigui/gui_keyboard.cpp @@ -41,31 +41,120 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang) //QWERTY// if (mode == 0) { - Key thekeys[4][11] = { { { '1', '!' }, { '2', '@' }, { '3', '#' }, { '4', '$' }, { '5', '%' }, { '6', '^' }, { - '7', '&' }, { '8', '*' }, { '9', '(' }, { '0', ')' }, { '\0', '\0' } }, { { 'q', 'Q' }, { 'w', 'W' }, { - 'e', 'E' }, { 'r', 'R' }, { 't', 'T' }, { 'y', 'Y' }, { 'u', 'U' }, { 'i', 'I' }, { 'o', 'O' }, { 'p', - 'P' }, { '-', '_' } }, { { 'a', 'A' }, { 's', 'S' }, { 'd', 'D' }, { 'f', 'F' }, { 'g', 'G' }, { 'h', - 'H' }, { 'j', 'J' }, { 'k', 'K' }, { 'l', 'L' }, { ':', ';' }, { '\'', '"' } }, - - { { 'z', 'Z' }, { 'x', 'X' }, { 'c', 'C' }, { 'v', 'V' }, { 'b', 'B' }, { 'n', 'N' }, { 'm', 'M' }, - { ',', '<' }, { '.', '>' }, { '/', '?' }, { '\0', '\0' } } }; + Key thekeys[4][11] = { + { + { '1', '!', '\0', '\0' }, + { '2', '@', '\0', '\0' }, + { '3', '#', '\0', '\0' }, + { '4', '$', '\0', '\0' }, + { '5', '%', '\0', '\0' }, + { '6', '^', '\0', '\0' }, + { '7', '&', '\0', '\0' }, + { '8', '*', '\0', '\0' }, + { '9', '(', '\0', '\0' }, + { '0', ')', '\0', '\0' }, + { '\0', '\0', '\0', '\0' } + }, + { + { 'q', 'Q', '\0', '\0' }, + { 'w', 'W', '\0', '\0' }, + { 'e', 'E', '\0', '\0' }, + { 'r', 'R', '\0', '\0' }, + { 't', 'T', '\0', '\0' }, + { 'y', 'Y', '\0', '\0' }, + { 'u', 'U', '\0', '\0' }, + { 'i', 'I', '\0', '\0' }, + { 'o', 'O', '\0', '\0' }, + { 'p', 'P', '\0', '\0' }, + { '-', '_', '\0', '\0' } + }, + { + { 'a', 'A', '\0', '\0' }, + { 's', 'S', '\0', '\0' }, + { 'd', 'D', '\0', '\0' }, + { 'f', 'F', '\0', '\0' }, + { 'g', 'G', '\0', '\0' }, + { 'h', 'H', '\0', '\0' }, + { 'j', 'J', '\0', '\0' }, + { 'k', 'K', '\0', '\0' }, + { 'l', 'L', '\0', '\0' }, + { ':', ';', '\0', '\0' }, + { '\'', '"', '\0', '\0' } + }, + { + { 'z', 'Z', '\0', '\0' }, + { 'x', 'X', '\0', '\0' }, + { 'c', 'C', '\0', '\0' }, + { 'v', 'V', '\0', '\0' }, + { 'b', 'B', '\0', '\0' }, + { 'n', 'N', '\0', '\0' }, + { 'm', 'M', '\0', '\0' }, + { ',', '<', '\0', '\0' }, + { '.', '>', '\0', '\0' }, + { '/', '?', '\0', '\0' }, + { '\0', '\0', '\0', '\0' } + } + }; memcpy(keys, thekeys, sizeof(thekeys)); } //DVORAK// if (mode == 1) { - Key thekeys[4][11] = { { { '1', '!', '\0' }, { '2', '@', '\0' }, { '3', '#', '\0' }, { '4', '$', '\0' }, { '5', - '%', '\0' }, { '6', '^', '\0' }, { '7', '&', '\0' }, { '8', '*', '\0' }, { '9', '(', '\0' }, { '0', - ')', '\0' }, { '\0', '\0', '\0' } }, { { '\'', '"', '\0' }, { ',', '<', '\0' }, { '.', '>', '\0' }, { - 'p', 'P', '\0' }, { 'y', 'Y', '\0' }, { 'f', 'F', '\0' }, { 'g', 'G', '\0' }, { 'c', 'C', '\0' }, { - 'r', 'R', '\0' }, { 'l', 'L', '\0' }, { '/', '?', '\0' } }, { { 'a', 'A', 'm' }, { 'o', 'O', 'm' }, { - 'e', 'E', 'm' }, { 'u', 'U', 'm' }, { 'i', 'I', 'm' }, { 'd', 'D', 'm' }, { 'h', 'H', 'm' }, { 't', - 'T', 'm' }, { 'n', 'N', 'm' }, { 's', 'S', 'm' }, { '-', '_', 'm' } }, - - { { ';', ':', '\0' }, { 'q', 'Q', '\0' }, { 'j', 'J', '\0' }, { 'k', 'K', '\0' }, { 'x', 'X', '\0' }, { 'b', - 'B', '\0' }, { 'm', 'M', '\0' }, { 'w', 'W', '\0' }, { 'v', 'V', '\0' }, { 'z', 'Z', '\0' }, { '\0', - '\0', '\0' } } }; + Key thekeys[4][11] = { + { + { '1', '!', '\0', '\0' }, + { '2', '@', '\0', '\0' }, + { '3', '#', '\0', '\0' }, + { '4', '$', '\0', '\0' }, + { '5', '%', '\0', '\0' }, + { '6', '^', '\0', '\0' }, + { '7', '&', '\0', '\0' }, + { '8', '*', '\0', '\0' }, + { '9', '(', '\0', '\0' }, + { '0', ')', '\0', '\0' }, + { '\0', '\0', '\0', '\0' } + }, + { + { '\'', '"', '\0', '\0' }, + { ',', '<', '\0', '\0' }, + { '.', '>', '\0', '\0' }, + { 'p', 'P', '\0', '\0' }, + { 'y', 'Y', '\0', '\0' }, + { 'f', 'F', '\0', '\0' }, + { 'g', 'G', '\0', '\0' }, + { 'c', 'C', '\0', '\0' }, + { 'r', 'R', '\0', '\0' }, + { 'l', 'L', '\0', '\0' }, + { '/', '?', '\0', '\0' } + }, + { + { 'a', 'A', 'm', '\0' }, + { 'o', 'O', 'm', '\0' }, + { 'e', 'E', 'm', '\0' }, + { 'u', 'U', 'm', '\0' }, + { 'i', 'I', 'm', '\0' }, + { 'd', 'D', 'm', '\0' }, + { 'h', 'H', 'm', '\0' }, + { 't', 'T', 'm', '\0' }, + { 'n', 'N', 'm', '\0' }, + { 's', 'S', 'm', '\0' }, + { '-', '_', 'm', '\0' } + }, + { + { ';', ':', '\0', '\0' }, + { 'q', 'Q', '\0', '\0' }, + { 'j', 'J', '\0', '\0' }, + { 'k', 'K', '\0', '\0' }, + { 'x', 'X', '\0', '\0' }, + { 'b', 'B', '\0', '\0' }, + { 'm', 'M', '\0', '\0' }, + { 'w', 'W', '\0', '\0' }, + { 'v', 'V', '\0', '\0' }, + { 'z', 'Z', '\0', '\0' }, + { '\0', '\0', '\0', '\0' } + } + }; memcpy(keys, thekeys, sizeof(thekeys)); } //QWETRZ// diff --git a/source/network/http.c b/source/network/http.c index c2928bc1..acc09749 100644 --- a/source/network/http.c +++ b/source/network/http.c @@ -210,7 +210,7 @@ struct block downloadfile(const char *url) //Search for the 4-character sequence \r\n\r\n in the response which signals the start of the http payload (file) unsigned char *filestart = NULL; u32 filesize = 0; - int i; + u32 i; for (i = 3; i < response.size; i++) { if (response.data[i] == '\n' && response.data[i - 1] == '\r' && response.data[i - 2] == '\n' && response.data[i diff --git a/source/prompts/filebrowser.cpp b/source/prompts/filebrowser.cpp index b55342c6..5aeea416 100644 --- a/source/prompts/filebrowser.cpp +++ b/source/prompts/filebrowser.cpp @@ -197,10 +197,13 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter) strlcpy(fulldir, filename, sizeof(fulldir)); // we use the current working dir else { // path is not empty - if (chdir(fulldir)) ; // sets the path to concatenate and validate + if (chdir(fulldir)) // sets the path to concatenate and validate { - if (Flags & (FB_TRYROOTDIR | FB_TRYSTDDEV)) if (chdir("/") && !(Flags & FB_TRYSTDDEV)) // try to set root if is needed - return -1; + if (Flags & (FB_TRYROOTDIR | FB_TRYSTDDEV)) + { + if (chdir("/") && !(Flags & FB_TRYSTDDEV)) // try to set root if is needed + return -1; + } } if (getcwd(fulldir, sizeof(fulldir))) return -1; // gets the concatenated current working dir chdir(filename); // restore the saved cwd diff --git a/source/settings/menus/GameLoadSM.cpp b/source/settings/menus/GameLoadSM.cpp index c2be2ff1..e2033a68 100644 --- a/source/settings/menus/GameLoadSM.cpp +++ b/source/settings/menus/GameLoadSM.cpp @@ -275,9 +275,8 @@ int GameLoadSM::GetMenuInternal() snprintf(entered, sizeof(entered), "%i", GameConfig.ios); if(OnScreenKeyboard(entered, sizeof(entered), 0)) { - GameConfig.ios = atoi(entered); + GameConfig.ios = atoi(entered) & 0xFF; if(GameConfig.ios < 200) GameConfig.ios = 200; - else if(GameConfig.ios > 255) GameConfig.ios = 255; if(NandTitles.IndexOf(TITLE_ID(1, GameConfig.ios)) < 0) { diff --git a/source/settings/menus/LoaderSettings.cpp b/source/settings/menus/LoaderSettings.cpp index 03c485d6..7dbb5d9b 100644 --- a/source/settings/menus/LoaderSettings.cpp +++ b/source/settings/menus/LoaderSettings.cpp @@ -148,7 +148,10 @@ LoaderSettings::~LoaderSettings() DeviceHandler::Instance()->UnMountAllUSB(); Settings.USBPort = NewSettingsUSBPort; DeviceHandler::SetUSBPort(Settings.USBPort); - if(Settings.USBPort == 2) DeviceHandler::Instance()->MountAllUSB(); + DeviceHandler::Instance()->MountAllUSB(); + + if(Settings.partition >= DeviceHandler::Instance()->GetUSBHandle()->GetPartitionTotalCount()) + Settings.partition = 0; } if(Settings.MultiplePartitions) @@ -371,7 +374,7 @@ int LoaderSettings::GetMenuInternal() if(!allSDPaths) { - WindowPrompt(tr("ERROR:"), tr("Automatic port switching is done on the fly. You should change all custom paths to sd:/ for this option or else it could damage a filesystem."), tr("OK")); + WindowPrompt(tr("ERROR:"), tr("Automatic port switching is done on the fly. You need to change all custom paths to SD-Card first for this option or else it could damage a filesystem."), tr("OK")); NewSettingsUSBPort = 0; } } diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index 16544bb5..1c7e4240 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -52,10 +52,10 @@ s32 IosLoader::LoadAppCios() if((int) activeCios == Settings.cios) return 0; - u32 ciosLoadPriority[] = { 250, 249, 222, Settings.cios }; // Descending. + u32 ciosLoadPriority[] = { Settings.cios, 222, 249, 250 }; // Ascending. - for (u8 i = (sizeof(ciosLoadPriority)/sizeof(ciosLoadPriority[0]))-1; i >= 0; i--) + for (u32 i = 0; i < (sizeof(ciosLoadPriority)/sizeof(ciosLoadPriority[0])); ++i) { u32 cios = ciosLoadPriority[i]; diff --git a/source/themes/Resources.cpp b/source/themes/Resources.cpp index 73ea8be0..d98ecfdc 100644 --- a/source/themes/Resources.cpp +++ b/source/themes/Resources.cpp @@ -241,7 +241,7 @@ const u8 * Resources::GetFile(const char * filename) return NULL; } -const u32 Resources::GetFileSize(const char * filename) +u32 Resources::GetFileSize(const char * filename) { for(int i = 0; RecourceFiles[i].filename != NULL; ++i) { diff --git a/source/themes/Resources.h b/source/themes/Resources.h index 0702622c..65afc944 100644 --- a/source/themes/Resources.h +++ b/source/themes/Resources.h @@ -18,7 +18,7 @@ class Resources static void Clear(); static bool LoadFiles(const char * path); static const u8 * GetFile(const char * filename); - static const u32 GetFileSize(const char * filename); + static u32 GetFileSize(const char * filename); static GuiImageData * GetImageData(const char * filename); private: diff --git a/source/usbloader/frag.c b/source/usbloader/frag.c index 5106a931..94bcc2c1 100644 --- a/source/usbloader/frag.c +++ b/source/usbloader/frag.c @@ -28,7 +28,7 @@ void frag_init(FragList *ff, int maxnum) void frag_dump(FragList *ff) { - int i; + u32 i; gprintf("frag list: %d %d 0x%x\n", ff->num, ff->size, ff->size); for (i=0; inum; i++) { if (i>10) { @@ -75,7 +75,8 @@ int frag_append(void *f, u32 offset, u32 sector, u32 count) int frag_concat(FragList *ff, FragList *src) { - int i, ret; + u32 i; + int ret; u32 size = ff->size; //printf("concat: %d %d <- %d %d\n", ff->num, ff->size, src->num, src->size); for (i=0; inum; i++) { @@ -94,7 +95,7 @@ int frag_concat(FragList *ff, FragList *src) int frag_get(FragList *ff, u32 offset, u32 count, u32 *poffset, u32 *psector, u32 *pcount) { - int i; + u32 i; u32 delta; //printf("frag_get(%u %u)\n", offset, count); for (i=0; inum; i++) { @@ -137,7 +138,7 @@ int frag_get(FragList *ff, u32 offset, u32 count, int frag_remap(FragList *ff, FragList *log, FragList *phy) { - int i; + u32 i; int ret; u32 offset; u32 sector; @@ -167,7 +168,7 @@ int get_frag_list_for_file(char *fname, u8 *id, const u8 wbfs_part_fs, const u32 FragList *fa = NULL; FragList *fw = NULL; int ret; - int i, j; + u32 i, j; int is_wbfs = 0; int ret_val = -1; diff --git a/source/usbloader/splits.c b/source/usbloader/splits.c index d75a80bf..732a59bf 100644 --- a/source/usbloader/splits.c +++ b/source/usbloader/splits.c @@ -69,7 +69,7 @@ int write_zero(int fd, off_t size) while (size) { chunk = size; - if (chunk > sizeof(buf)) chunk = sizeof(buf); + if (chunk > (int) sizeof(buf)) chunk = sizeof(buf); ret = write(fd, buf, chunk); //printf("WZ %d %d / %lld \n", ret, chunk, size); size -= chunk; @@ -82,7 +82,7 @@ int split_fill(split_info_t *s, int idx, u64 size) { int fd = split_open_file(s, idx); off64_t fsize = lseek(fd, 0, SEEK_END); - if (fsize < size) + if (fsize < (s64) size) { //printf("TRUNC %d "FMT_lld"\n", idx, size); Wpad_WaitButtons(); //ftruncate(fd, size); diff --git a/source/usbloader/usbstorage2.c b/source/usbloader/usbstorage2.c index 20b8b07f..29007ad8 100644 --- a/source/usbloader/usbstorage2.c +++ b/source/usbloader/usbstorage2.c @@ -133,7 +133,7 @@ void USBStorage2_Deinit(void) s32 USBStorage2_SetPort(u32 port) { //! Port = 2 is handle in the loader, no need to handle it in cIOS - if(port < 0 || port > 1) + if(port > 1) return -1; if(port == usb2_port) diff --git a/source/usbloader/wbfs/wbfs_base.cpp b/source/usbloader/wbfs/wbfs_base.cpp index 8c4f28a5..7d3537a1 100644 --- a/source/usbloader/wbfs/wbfs_base.cpp +++ b/source/usbloader/wbfs/wbfs_base.cpp @@ -98,8 +98,3 @@ s32 Wbfs::GameSize(u8 *discid, f32 *size) return 0; } - -bool Wbfs::ShowFreeSpace(void) -{ - return true; -} diff --git a/source/usbloader/wbfs/wbfs_base.h b/source/usbloader/wbfs/wbfs_base.h index b836f6a8..f8d892d4 100644 --- a/source/usbloader/wbfs/wbfs_base.h +++ b/source/usbloader/wbfs/wbfs_base.h @@ -19,7 +19,6 @@ class Wbfs s32 GameSize(u8 *, f32 *); bool IsMounted() { return hdd == 0; }; virtual int GetFragList(u8 *id) { return 0; }; - virtual bool ShowFreeSpace(void); virtual s32 Open() = 0; virtual void Close() {}; @@ -34,8 +33,8 @@ class Wbfs virtual s32 RenameGame(u8 *, const void *) = 0; virtual s32 ReIDGame(u8 *discid, const void *newID) = 0; virtual u64 EstimateGameSize(void) = 0; - virtual const u8 GetFSType(void) const { return PART_FS_WBFS; } - const wbfs_t *GetHDDHandle(void) const { return hdd; } + virtual u8 GetFSType(void) const { return PART_FS_WBFS; } + const wbfs_t *GetHDDHandle(void) { return hdd; } protected: wbfs_t *hdd; const u32 lba; diff --git a/source/usbloader/wbfs/wbfs_ext.h b/source/usbloader/wbfs/wbfs_ext.h index 878eb8dd..8822a0e0 100644 --- a/source/usbloader/wbfs/wbfs_ext.h +++ b/source/usbloader/wbfs/wbfs_ext.h @@ -10,7 +10,7 @@ class Wbfs_Ext: public Wbfs_Fat Wbfs_Fat(lba, size, part) { } - virtual const u8 GetFSType(void) const { return PART_FS_EXT; } + virtual u8 GetFSType(void) { return PART_FS_EXT; } }; #endif //_WBFS_NTFS_H diff --git a/source/usbloader/wbfs/wbfs_fat.cpp b/source/usbloader/wbfs/wbfs_fat.cpp index 898943c1..e4510f33 100644 --- a/source/usbloader/wbfs/wbfs_fat.cpp +++ b/source/usbloader/wbfs/wbfs_fat.cpp @@ -50,7 +50,7 @@ s32 Wbfs_Fat::Open() PartitionHandle * usbHandle = DeviceHandler::Instance()->GetUSBHandle(); - if(partition >= 0 && (int) partition < usbHandle->GetPartitionTotalCount()) + if(partition < (u32) usbHandle->GetPartitionTotalCount()) { if (lba == usbHandle->GetLBAStart(partition)) { @@ -869,8 +869,3 @@ int Wbfs_Fat::GetFragList(u8 *id) return get_frag_list_for_file(fname, id, GetFSType(), lba); } - -bool Wbfs_Fat::ShowFreeSpace(void) -{ - return false; -} diff --git a/source/usbloader/wbfs/wbfs_fat.h b/source/usbloader/wbfs/wbfs_fat.h index 4fb87f92..5416c0d2 100644 --- a/source/usbloader/wbfs/wbfs_fat.h +++ b/source/usbloader/wbfs/wbfs_fat.h @@ -31,8 +31,7 @@ class Wbfs_Fat: public Wbfs u64 EstimateGameSize(); virtual int GetFragList(u8 *); - virtual bool ShowFreeSpace(void); - virtual const u8 GetFSType(void) const { return PART_FS_FAT; } + virtual u8 GetFSType(void) { return PART_FS_FAT; } protected: split_info_t split; diff --git a/source/usbloader/wbfs/wbfs_ntfs.h b/source/usbloader/wbfs/wbfs_ntfs.h index e99602b6..ca8479f3 100644 --- a/source/usbloader/wbfs/wbfs_ntfs.h +++ b/source/usbloader/wbfs/wbfs_ntfs.h @@ -10,7 +10,7 @@ class Wbfs_Ntfs: public Wbfs_Fat Wbfs_Fat(lba, size, part) { } - virtual const u8 GetFSType(void) const { return PART_FS_NTFS; } + virtual u8 GetFSType(void) { return PART_FS_NTFS; } }; #endif //_WBFS_NTFS_H diff --git a/source/usbloader/wbfs/wbfs_wbfs.h b/source/usbloader/wbfs/wbfs_wbfs.h index b4657cf8..ae23f431 100644 --- a/source/usbloader/wbfs/wbfs_wbfs.h +++ b/source/usbloader/wbfs/wbfs_wbfs.h @@ -33,7 +33,6 @@ class Wbfs_Wbfs: public Wbfs u64 EstimateGameSize(); int GetFragList(u8 *id); - virtual const u8 GetFSType(void) const { return PART_FS_WBFS; } private: WBFS_PartInfo PartInfo; }; diff --git a/source/wad/nandtitle.cpp b/source/wad/nandtitle.cpp index c88a6709..7cfe0f4c 100644 --- a/source/wad/nandtitle.cpp +++ b/source/wad/nandtitle.cpp @@ -246,14 +246,14 @@ bool NandTitle::Exists(u64 tid) bool NandTitle::ExistsFromIndex(u32 i) { - if (i > titleIds.size() || i < 0) return false; + if (i > titleIds.size()) return false; return Exists(titleIds.at(i)); } u64 NandTitle::At(u32 i) { - if (i > titleIds.size() || i < 0) return 0; + if (i > titleIds.size()) return 0; return titleIds.at(i); } @@ -278,7 +278,7 @@ const char* NandTitle::NameOf(u64 tid) const char* NandTitle::NameFromIndex(u32 i) { - if (i > titleIds.size() || i < 0) return NULL; + if (i > titleIds.size()) return NULL; map::iterator itr = NameList.find(titleIds.at(i)); if (itr != NameList.end()) return itr->second.c_str(); @@ -304,7 +304,7 @@ u16 NandTitle::VersionOf(u64 tid) u16 NandTitle::VersionFromIndex(u32 i) { - if (i > titleIds.size() || i < 0) return 0; + if (i > titleIds.size()) return 0; tmd* Tmd = GetTMD(titleIds.at(i)); if (!Tmd) return 0; @@ -377,7 +377,7 @@ void NandTitle::AsciiTID(u64 tid, char* out) void NandTitle::AsciiFromIndex(u32 i, char* out) { - if (i > titleIds.size() || i < 0) + if (i > titleIds.size()) { out[0] = 0; return; diff --git a/source/xml/WiiTDB.cpp b/source/xml/WiiTDB.cpp index aa806835..d8a2d1fc 100644 --- a/source/xml/WiiTDB.cpp +++ b/source/xml/WiiTDB.cpp @@ -149,7 +149,7 @@ bool WiiTDB::LoadGameOffsets(const char * path) OffsetMap.resize(NodeCount); - if(fread(&OffsetMap[0], 1, NodeCount*sizeof(GameOffsets), fp) != NodeCount*sizeof(GameOffsets)) + if((int) fread(&OffsetMap[0], 1, NodeCount*sizeof(GameOffsets), fp) < 0) { fclose(fp); bool result = ParseFile(); @@ -176,19 +176,19 @@ bool WiiTDB::SaveGameOffsets(const char * path) unsigned long long ExistingVersion = GetWiiTDBVersion(); unsigned int NodeCount = OffsetMap.size(); - if(fwrite(&ExistingVersion, 1, sizeof(ExistingVersion), fp) < 0) + if(fwrite(&ExistingVersion, 1, sizeof(ExistingVersion), fp) != sizeof(ExistingVersion)) { fclose(fp); return false; } - if(fwrite(&NodeCount, 1, sizeof(NodeCount), fp) < 0) + if(fwrite(&NodeCount, 1, sizeof(NodeCount), fp) != sizeof(NodeCount)) { fclose(fp); return false; } - if(fwrite(&OffsetMap[0], 1, NodeCount*sizeof(GameOffsets), fp) < 0) + if(fwrite(&OffsetMap[0], 1, NodeCount*sizeof(GameOffsets), fp) != NodeCount*sizeof(GameOffsets)) { fclose(fp); return false; @@ -216,7 +216,7 @@ unsigned long long WiiTDB::GetWiiTDBVersion() return strtoull(VersionText, NULL, 10); } -size_t WiiTDB::GetData(char * data, int offset, int size) +int WiiTDB::GetData(char * data, int offset, int size) { if(!file || !data) return -1; diff --git a/source/xml/WiiTDB.hpp b/source/xml/WiiTDB.hpp index 7b2a0f74..1ca93d82 100644 --- a/source/xml/WiiTDB.hpp +++ b/source/xml/WiiTDB.hpp @@ -133,7 +133,7 @@ class WiiTDB bool ParseFile(); bool LoadGameOffsets(const char * path); bool SaveGameOffsets(const char * path); - inline size_t GetData(char * data, int offset, int size); + inline int GetData(char * data, int offset, int size); inline char * LoadGameNode(const char * id); inline char * GetGameNode(const char * id); inline GameOffsets * GetGameOffset(const char * id);