diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/grfio.c | 20 | ||||
-rw-r--r-- | src/common/mmo.h | 4 | ||||
-rw-r--r-- | src/common/socket.c | 5 |
3 files changed, 20 insertions, 9 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c index d27636d33..c8c021b8d 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -140,7 +140,11 @@ static unsigned char NibbleData[4][64]={ */ static unsigned int getlong(unsigned char *p) { - return *p+p[1]*256+(p[2]+p[3]*256)*65536; +// return *p+p[1]*256+(p[2]+p[3]*256)*65536; + return p[0] + | p[1] << 0x08 + | p[2] << 0x10 + | p[3] << 0x18; // Shinomori } /*========================================== @@ -158,15 +162,17 @@ static void BitConvert(BYTE *Src,char *BitSwapTable) { int lop,prm; BYTE tmp[8]; - *(DWORD*)tmp=*(DWORD*)(tmp+4)=0; +// *(DWORD*)tmp=*(DWORD*)(tmp+4)=0; + memset(tmp,0,8); for(lop=0;lop!=64;lop++) { prm = BitSwapTable[lop]-1; if (Src[(prm >> 3) & 7] & BitMaskTable[prm & 7]) { tmp[(lop >> 3) & 7] |= BitMaskTable[lop & 7]; } } - *(DWORD*)Src = *(DWORD*)tmp; - *(DWORD*)(Src+4) = *(DWORD*)(tmp+4); +// *(DWORD*)Src = *(DWORD*)tmp; +// *(DWORD*)(Src+4) = *(DWORD*)(tmp+4); + memcpy(Src,tmp,8); } static void BitConvert4(BYTE *Src) @@ -194,7 +200,11 @@ static void BitConvert4(BYTE *Src) tmp[(lop >> 3) + 4] |= BitMaskTable[lop & 7]; } } - *(DWORD*)Src ^= *(DWORD*)(tmp+4); +// *(DWORD*)Src ^= *(DWORD*)(tmp+4); + Src[0] ^= tmp[4]; + Src[1] ^= tmp[5]; + Src[2] ^= tmp[6]; + Src[3] ^= tmp[7]; } static void decode_des_etc(BYTE *buf,int len,int type,int cycle) diff --git a/src/common/mmo.h b/src/common/mmo.h index 5ee6bf602..44069b85f 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -325,10 +325,6 @@ enum { #ifndef strnicmp #define strnicmp strncasecmp #endif -#ifndef strrchr -#define strrchr rindex -#endif - #endif #endif // _MMO_H_ diff --git a/src/common/socket.c b/src/common/socket.c index dfeebf03a..0f5b53550 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -17,6 +17,11 @@ #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> + +#ifndef SIOCGIFCONF +#include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori] +#endif + #endif #include <fcntl.h> |