Author: aandrejevic
Date: Wed Jun 19 21:13:43 2013
New Revision: 59260
URL:
http://svn.reactos.org/svn/reactos?rev=59260&view=rev
Log:
[SOFTX86]
Fix warnings in softx86.
Modified:
branches/ntvdm/include/reactos/libs/softx86/softx86.h
branches/ntvdm/lib/3rdparty/softx86/softx86/CMakeLists.txt
branches/ntvdm/lib/3rdparty/softx86/softx86/groupies.c
branches/ntvdm/lib/3rdparty/softx86/softx86/softx86.c
Modified: branches/ntvdm/include/reactos/libs/softx86/softx86.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/libs/soft…
==============================================================================
--- branches/ntvdm/include/reactos/libs/softx86/softx86.h [iso-8859-1] (original)
+++ branches/ntvdm/include/reactos/libs/softx86/softx86.h [iso-8859-1] Wed Jun 19 21:13:43
2013
@@ -3,7 +3,7 @@
#define SOFTX86_H
/* get the Softx86 configuration defines */
-#include <softx86cfg.h>
+#include <softx86/softx86cfg.h>
#ifdef __cplusplus
extern "C" {
@@ -215,16 +215,16 @@
#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
Modified: branches/ntvdm/lib/3rdparty/softx86/softx86/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86/CMakeLists.txt [iso-8859-1] Wed Jun 19
21:13:43 2013
@@ -27,4 +27,3 @@
)
add_library(softx86 ${SOURCE})
-allow_warnings(softx86)
Modified: branches/ntvdm/lib/3rdparty/softx86/softx86/groupies.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86/groupies.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86/groupies.c [iso-8859-1] Wed Jun 19
21:13:43 2013
@@ -198,10 +198,12 @@
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);
Modified: branches/ntvdm/lib/3rdparty/softx86/softx86/softx86.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86/softx86.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86/softx86.c [iso-8859-1] Wed Jun 19 21:13:43
2013
@@ -1445,8 +1445,10 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);
}
}