diff --git a/gui.pnproj b/gui.pnproj
index c79b05df..600c6a3d 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 270f2823..b0ef8c1f 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/libwiigui/gui_button.cpp b/source/libwiigui/gui_button.cpp
index 6059445c..40ee15c8 100644
--- a/source/libwiigui/gui_button.cpp
+++ b/source/libwiigui/gui_button.cpp
@@ -436,8 +436,8 @@ void GuiButton::Update(GuiTrigger * t)
cc_btns_trig = trigger[i]->wpad.btns_d >> 16;
if(
- (t->wpad.btns_d > 0 &&
- wm_btns == wm_btns_trig ||
+ ((t->wpad.btns_d > 0 &&
+ wm_btns == wm_btns_trig) ||
(cc_btns == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC)) ||
(t->pad.btns_d == trigger[i]->pad.btns_d && t->pad.btns_d > 0))
{
@@ -489,8 +489,8 @@ void GuiButton::Update(GuiTrigger * t)
cc_btns_trig = trigger[i]->wpad.btns_h >> 16;
if(
- (t->wpad.btns_d > 0 &&
- wm_btns == wm_btns_trig ||
+ ((t->wpad.btns_d > 0 &&
+ wm_btns == wm_btns_trig) ||
(cc_btns == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC)) ||
(t->pad.btns_d == trigger[i]->pad.btns_h && t->pad.btns_d > 0))
{
@@ -500,8 +500,8 @@ void GuiButton::Update(GuiTrigger * t)
}
if(
- (t->wpad.btns_h > 0 &&
- wm_btns_h == wm_btns_trig ||
+ ((t->wpad.btns_h > 0 &&
+ wm_btns_h == wm_btns_trig) ||
(cc_btns_h == cc_btns_trig && t->wpad.exp.type == EXP_CLASSIC)) ||
(t->pad.btns_h == trigger[i]->pad.btns_h && t->pad.btns_h > 0))
{
diff --git a/source/patches/dvd_broadway.c b/source/patches/dvd_broadway.c
index daa9e197..0d012392 100644
--- a/source/patches/dvd_broadway.c
+++ b/source/patches/dvd_broadway.c
@@ -359,7 +359,8 @@ s32 bwDVD_LowSeek(u32 offset,dvdcallbacklow cb)
s32 bwDVD_LowOffset(u64 offset,dvdcallbacklow cb)
{
s32 ret;
- u32 *off = (u32*)(void*)(&offset);
+ //u32 *off = (u32*)(void*)(&offset);
+ union { u64 off64; u32 off32[2]; } off;off.off64 = offset;
struct dicontext *ctx;
struct dicommand *cmd;
@@ -371,8 +372,8 @@ s32 bwDVD_LowOffset(u64 offset,dvdcallbacklow cb)
cmd = ctx->cmd;
cmd->diReg[0] = (IOCTL_DI_OFFSET<<24);
cmd->diReg[1] = 0;
- if(off[0]) cmd->diReg[1] = 1;
- cmd->diReg[2] = off[1];
+ if(off.off32[0]) cmd->diReg[1] = 1;
+ cmd->diReg[2] = off.off32[1];
ret = IOS_IoctlAsync(__dvd_fd,IOCTL_DI_OFFSET,cmd->diReg,sizeof(struct dicommand),__di_regvalcache,0x20,__dvd_iostransactionCB,ctx);
return ret;
diff --git a/source/settings/cfg.c b/source/settings/cfg.c
index b2065dc0..1e24736d 100644
--- a/source/settings/cfg.c
+++ b/source/settings/cfg.c
@@ -11,6 +11,7 @@
#include "listfiles.h"
#include "xml/xml.h" /* XML - Lustar*/
#include "cfg.h"
+#define isspace2(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
struct SSettings Settings;
@@ -416,14 +417,14 @@ u8 get_block(struct discHdr *header) {
char* trim_n_copy(char *dest, char *src, int n, int size) {
int len;
// trim leading white space
- while (isspace(*src)) {
+ while (isspace2(*src)) {
src++;
n--;
}
len = strlen(src);
if (len > n) len = n;
// trim trailing white space
- while (len > 0 && isspace(src[len-1])) len--;
+ while (len > 0 && isspace2(src[len-1])) len--;
if (len >= size) len = size-1;
strlcpy(dest, src, len+1);
//printf("trim_copy: '%s' %d\n", dest, len); //sleep(1);
diff --git a/source/usbloader/wdvd.c b/source/usbloader/wdvd.c
index ed27def5..52d602dc 100644
--- a/source/usbloader/wdvd.c
+++ b/source/usbloader/wdvd.c
@@ -116,15 +116,16 @@ s32 WDVD_Seek(u64 offset) {
}
s32 WDVD_Offset(u64 offset) {
- u32 *off = (u32 *)((void *)&offset);
+ //u32 *off = (u32 *)((void *)&offset);
+ union { u64 off64; u32 off32[2]; } off;off.off64 = offset;
s32 ret;
memset(inbuf, 0, sizeof(inbuf));
/* Set offset */
inbuf[0] = IOCTL_DI_OFFSET << 24;
- inbuf[1] = (off[0]) ? 1: 0;
- inbuf[2] = (off[1] >> 2);
+ inbuf[1] = (off.off32[0]) ? 1: 0;
+ inbuf[2] = (off.off32[1] >> 2);
ret = IOS_Ioctl(di_fd, IOCTL_DI_OFFSET, inbuf, sizeof(inbuf), outbuf, sizeof(outbuf));
if (ret < 0)
diff --git a/source/xml/xml.c b/source/xml/xml.c
index 7c243ea2..e2c0bd11 100644
--- a/source/xml/xml.c
+++ b/source/xml/xml.c
@@ -475,7 +475,7 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt)
++gameinfo.wifiCnt;
GetTextFromNode(nodeidtmp, nodedata, "feature", NULL, NULL, MXML_DESCEND, gameinfo.wififeatures[gameinfo.wifiCnt],
sizeof(gameinfo.wififeatures[gameinfo.wifiCnt]));
- gameinfo.wififeatures[gameinfo.wifiCnt][0] = toupper(gameinfo.wififeatures[gameinfo.wifiCnt][0]);
+ gameinfo.wififeatures[gameinfo.wifiCnt][0] = toupper((int)gameinfo.wififeatures[gameinfo.wifiCnt][0]);
if (gameinfo.wifiCnt == XML_ELEMMAX)
break;
}
@@ -542,14 +542,14 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt)
++gameinfo.genreCnt;
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
strlcpy(gameinfo.genresplit[gameinfo.genreCnt],splitresult,sizeof(gameinfo.genresplit[gameinfo.genreCnt]));
- gameinfo.genresplit[gameinfo.genreCnt][0] = toupper(gameinfo.genresplit[gameinfo.genreCnt][0]);
+ gameinfo.genresplit[gameinfo.genreCnt][0] = toupper((int)gameinfo.genresplit[gameinfo.genreCnt][0]);
while (splitresult != NULL) {
splitresult = strtok(NULL, delimgenre);
if (splitresult != NULL && strcmp(splitresult,"")!=0) {
++gameinfo.genreCnt;
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
strlcpy(gameinfo.genresplit[gameinfo.genreCnt],splitresult,sizeof(gameinfo.genresplit[gameinfo.genreCnt]));
- gameinfo.genresplit[gameinfo.genreCnt][0] = toupper(gameinfo.genresplit[gameinfo.genreCnt][0]);
+ gameinfo.genresplit[gameinfo.genreCnt][0] = toupper((int)gameinfo.genresplit[gameinfo.genreCnt][0]);
if (gameinfo.genreCnt == XML_ELEMMAX)
break;
}