From: Aleksandar Andrejevic Date: Wed, 19 Jun 2013 21:13:43 +0000 (+0000) Subject: [SOFTX86] X-Git-Tag: backups/0.3.17@66124~1365^2~597 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f7714ef9c10164e8180873c66c241d44b7651358;ds=inline [SOFTX86] Fix warnings in softx86. svn path=/branches/ntvdm/; revision=59260 --- diff --git a/include/reactos/libs/softx86/softx86.h b/include/reactos/libs/softx86/softx86.h index 587f7e7dcb2..7f61854cd87 100644 --- a/include/reactos/libs/softx86/softx86.h +++ b/include/reactos/libs/softx86/softx86.h @@ -3,7 +3,7 @@ #define SOFTX86_H /* get the Softx86 configuration defines */ -#include +#include #ifdef __cplusplus extern "C" { @@ -215,16 +215,16 @@ typedef struct { #define SEGMENT_OFFSET_TO_LINEAR(s,o) (SEGMENT_TO_LINEAR(x)+o) /* force a given value to fit within the specified size */ -#define MASK_BYTE_SIZE(x) (x &= 0xFF) -#define MASK_WORD_SIZE(x) (x &= 0xFFFF) -#define MASK_DWORD_SIZE(x) (x &= 0xFFFFFFFFL) -#define FORCE_BYTE_SIZE(x) (x & 0xFF) -#define FORCE_WORD_SIZE(x) (x & 0xFFFF) -#define FORCE_DWORD_SIZE(x) (x & 0xFFFFFFFFL) +#define MASK_BYTE_SIZE(x) ((x) &= 0xFF) +#define MASK_WORD_SIZE(x) ((x) &= 0xFFFF) +#define MASK_DWORD_SIZE(x) ((x) &= 0xFFFFFFFFL) +#define FORCE_BYTE_SIZE(x) ((x) & 0xFF) +#define FORCE_WORD_SIZE(x) ((x) & 0xFFFF) +#define FORCE_DWORD_SIZE(x) ((x) & 0xFFFFFFFFL) /* sign-extending macros */ -#define SGNEXT8(x) (x | ((x & 0x80) ? 0xFFFFFF00 : 0)) -#define SGNEXT16(x) (x | ((x & 0x8000) ? 0xFFFF0000 : 0)) +#define SGNEXT8(x) ((x) | (((x) & 0x80) ? 0xFFFFFF00 : 0)) +#define SGNEXT16(x) ((x) | (((x) & 0x8000) ? 0xFFFF0000 : 0)) /*===================================================================================== Softx86 bug structure diff --git a/lib/3rdparty/softx86/softx86/CMakeLists.txt b/lib/3rdparty/softx86/softx86/CMakeLists.txt index 6d3a579b53e..a6b61368267 100644 --- a/lib/3rdparty/softx86/softx86/CMakeLists.txt +++ b/lib/3rdparty/softx86/softx86/CMakeLists.txt @@ -27,4 +27,3 @@ list(APPEND SOURCE ) add_library(softx86 ${SOURCE}) -allow_warnings(softx86) diff --git a/lib/3rdparty/softx86/softx86/groupies.c b/lib/3rdparty/softx86/softx86/groupies.c index cbeb73cf1b3..11f72bd0c80 100644 --- a/lib/3rdparty/softx86/softx86/groupies.c +++ b/lib/3rdparty/softx86/softx86/groupies.c @@ -198,10 +198,12 @@ int Sfx86OpcodeDec_group80(sx86_ubyte opcode,softx86_ctx* ctx,char buf[128]) imm16 = softx86_fetch_dec_byte(ctx); if (w16) + { if (sx) imm16 |= (imm16&0x80) ? 0xFF80 : 0; else imm16 |= softx86_fetch_dec_byte(ctx)<<8; + } if (reg == 0) sprintf(buf,"ADD %s,%04Xh",op1_tmp,imm16); else if (reg == 1) sprintf(buf,"OR %s,%04Xh",op1_tmp,imm16); diff --git a/lib/3rdparty/softx86/softx86/softx86.c b/lib/3rdparty/softx86/softx86/softx86.c index a65aedf80eb..da6150189f8 100644 --- a/lib/3rdparty/softx86/softx86/softx86.c +++ b/lib/3rdparty/softx86/softx86/softx86.c @@ -1445,8 +1445,10 @@ void sx86_exec_full_modrmonly_rw_imm(softx86_ctx* ctx,sx86_ubyte w16,sx86_ubyte if (mod == 3) { /* immediate <-> register */ imm = softx86_fetch_exec_byte(ctx); if (w16) + { if (sx) imm |= (imm&0x80) ? 0xFF80 : 0; else imm |= softx86_fetch_exec_byte(ctx)<<8; + } // TODO: For 386+ 32-bit instructions... if (d32) {...} if (w16) { @@ -1542,8 +1544,10 @@ void sx86_exec_full_modrmonly_rw_imm(softx86_ctx* ctx,sx86_ubyte w16,sx86_ubyte imm = softx86_fetch_exec_byte(ctx); if (w16) + { if (sx) imm |= (imm&0x80) ? 0xFF80 : 0; else imm |= softx86_fetch_exec_byte(ctx)<<8; + } // TODO: For 386+ 32-bit instructions... if (d32) {...} if (w16) { @@ -1742,8 +1746,10 @@ void sx86_exec_full_modrmonly_ro_imm(softx86_ctx* ctx,sx86_ubyte w16,sx86_ubyte if (mod == 3) { /* immediate <-> register */ imm = softx86_fetch_exec_byte(ctx); if (w16) + { if (sx) imm |= (imm&0x80) ? 0xFF80 : 0; else imm |= softx86_fetch_exec_byte(ctx)<<8; + } // TODO: For 386+ 32-bit instructions... if (d32) {...} if (w16) { @@ -1835,8 +1841,10 @@ void sx86_exec_full_modrmonly_ro_imm(softx86_ctx* ctx,sx86_ubyte w16,sx86_ubyte imm = softx86_fetch_exec_byte(ctx); if (w16) + { if (sx) imm |= (imm&0x80) ? 0xFF80 : 0; else imm |= softx86_fetch_exec_byte(ctx)<<8; + } // TODO: For 386+ 32-bit instructions... if (d32) {...} if (w16) { @@ -2616,7 +2624,7 @@ void sx86_exec_full_modrmonly_memx(softx86_ctx* ctx,sx86_ubyte mod,sx86_ubyte rm lo = sx86_far_to_linear(ctx,seg,ofs); softx86_fetch(ctx,NULL,lo,tmp,sz); - op64(ctx,tmp,sz); + op64(ctx,(char*)tmp,sz); } } } @@ -2709,7 +2717,7 @@ void sx86_exec_full_modrw_memx(softx86_ctx* ctx,sx86_ubyte mod,sx86_ubyte rm,int lo = sx86_far_to_linear(ctx,seg,ofs); softx86_fetch(ctx,NULL,lo,tmp,sz); - op64(ctx,tmp,sz); + op64(ctx,(char*)tmp,sz); softx86_write(ctx,NULL,lo,tmp,sz); } }