Author: tkreuzer
Date: Fri Apr 10 22:36:13 2015
New Revision: 67146
URL:
http://svn.reactos.org/svn/reactos?rev=67146&view=rev
Log:
[FAST486]
Fix MSVC warnings
Modified:
trunk/reactos/lib/fast486/common.c
trunk/reactos/lib/fast486/common.h
trunk/reactos/lib/fast486/common.inl
trunk/reactos/lib/fast486/extraops.c
trunk/reactos/lib/fast486/fpu.c
trunk/reactos/lib/fast486/opcodes.c
trunk/reactos/lib/fast486/opgroups.c
Modified: trunk/reactos/lib/fast486/common.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=6…
==============================================================================
--- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -287,7 +287,7 @@
/* Task call */
return Fast486TaskSwitch(State, FAST486_TASK_CALL, IdtEntry->Selector);
}
-
+
if (GateSize != (State->SegmentRegs[FAST486_REG_CS].Size))
{
/* The gate size doesn't match the current operand size, so set the
OPSIZE flag. */
@@ -545,7 +545,7 @@
/* Make sure the entry exists in the GDT (not LDT!) */
if ((GET_SEGMENT_INDEX(Selector) == 0)
|| (Selector & SEGMENT_TABLE_INDICATOR)
- || GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
+ || GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1u))
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_TS, Selector);
return FALSE;
@@ -598,7 +598,7 @@
&& ((NewTssDescriptor.Signature != FAST486_BUSY_TSS_SIGNATURE)
|| (Type != FAST486_TASK_RETURN)))
{
- Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
+ Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
return FALSE;
}
Modified: trunk/reactos/lib/fast486/common.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.h?rev=6…
==============================================================================
--- trunk/reactos/lib/fast486/common.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.h [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -35,8 +35,8 @@
/* Block size for string operations */
#define STRING_BLOCK_SIZE 4096
-#define GET_SEGMENT_RPL(s) ((s) & 3)
-#define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8)
+#define GET_SEGMENT_RPL(s) ((s) & 3u)
+#define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8u)
#define SEGMENT_TABLE_INDICATOR (1 << 2)
#define EXCEPTION_HAS_ERROR_CODE(x) (((x) == 8) || ((x) >= 10 && (x) <=
14))
Modified: trunk/reactos/lib/fast486/common.inl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev…
==============================================================================
--- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -52,7 +52,7 @@
#endif
FORCEINLINE
-INT
+UINT
FASTCALL
Fast486GetCurrentPrivLevel(PFAST486_STATE State)
{
@@ -447,7 +447,7 @@
if (!(Selector & SEGMENT_TABLE_INDICATOR))
{
/* Make sure the GDT contains the entry */
- if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
+ if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1u))
{
*EntryValid = FALSE;
return TRUE;
@@ -468,7 +468,7 @@
else
{
/* Make sure the LDT contains the entry */
- if (GET_SEGMENT_INDEX(Selector) >= (State->Ldtr.Limit + 1))
+ if (GET_SEGMENT_INDEX(Selector) >= (State->Ldtr.Limit + 1u))
{
*EntryValid = FALSE;
return TRUE;
@@ -1512,7 +1512,7 @@
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_NE)
{
/* Call the #MF handler */
- Fast486Exception(State, FAST486_EXCEPTION_MF);
+ Fast486Exception(State, FAST486_EXCEPTION_MF);
}
else
{
@@ -1593,7 +1593,7 @@
{
/* Raise the stack fault and invalid operation exception */
State->FpuStatus.Sf = State->FpuStatus.Ie = TRUE;
-
+
/* Set the C1 condition code bit (stack overflow) */
State->FpuStatus.Code1 = TRUE;
Modified: trunk/reactos/lib/fast486/extraops.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/extraops.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/extraops.c [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -356,7 +356,7 @@
/* Exception occurred */
return;
}
-
+
Selector = LOWORD(Value);
}
else
@@ -440,7 +440,7 @@
/* Exception occurred */
return;
}
-
+
Selector = LOWORD(Value);
}
else
@@ -1642,7 +1642,7 @@
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
{
- INT i;
+ UINT i;
ULONG Value = 0;
BOOLEAN OperandSize, AddressSize;
FAST486_MOD_REG_RM ModRegRm;
Modified: trunk/reactos/lib/fast486/fpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.c?rev=6714…
==============================================================================
--- trunk/reactos/lib/fast486/fpu.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/fpu.c [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -65,7 +65,7 @@
ULONG MultiplicandLow, MultiplicandHigh, MultiplierLow, MultiplierHigh;
ULONG IntermediateLow, IntermediateHigh;
ULONGLONG LowProduct, Intermediate, Intermediate1, Intermediate2;
-
+
MultiplicandLow = (ULONG)(Multiplicand & 0xFFFFFFFFULL);
MultiplicandHigh = (ULONG)(Multiplicand >> 32);
MultiplierLow = (ULONG)(Multiplier & 0xFFFFFFFFULL);
@@ -229,7 +229,7 @@
Result->Mantissa = (ULONGLONG)Value;
ZeroCount = CountLeadingZeros64(Result->Mantissa);
-
+
Result->Mantissa <<= ZeroCount;
Result->Exponent = FPU_REAL10_BIAS + 63 - ZeroCount;
}
@@ -248,7 +248,7 @@
*Result = 0LL;
return TRUE;
}
-
+
if (FPU_IS_NAN(Value) || !FPU_IS_NORMALIZED(Value)
|| (UnbiasedExp < 0) || (UnbiasedExp > 63))
{
@@ -580,8 +580,8 @@
else TempResult.Sign = FALSE;
/* Invert the negative mantissa */
- if (FirstAdjusted.Sign) FirstAdjusted.Mantissa = -FirstAdjusted.Mantissa;
- if (SecondAdjusted.Sign) SecondAdjusted.Mantissa = -SecondAdjusted.Mantissa;
+ if (FirstAdjusted.Sign) FirstAdjusted.Mantissa =
-(LONGLONG)FirstAdjusted.Mantissa;
+ if (SecondAdjusted.Sign) SecondAdjusted.Mantissa =
-(LONGLONG)SecondAdjusted.Mantissa;
/* Calculate the mantissa of the result */
TempResult.Mantissa = FirstAdjusted.Mantissa + SecondAdjusted.Mantissa;
@@ -615,7 +615,7 @@
TempResult.Exponent++;
}
}
-
+
/* Normalize the result and return it */
Fast486FpuNormalize(State, &TempResult);
*Result = TempResult;
@@ -720,7 +720,7 @@
}
if (FPU_IS_INFINITY(FirstOperand) || FPU_IS_INFINITY(SecondOperand))
- {
+ {
/* The result will be infinity */
Result->Sign = FirstOperand->Sign ^ SecondOperand->Sign;
Result->Exponent = FPU_MAX_EXPONENT + 1;
@@ -755,7 +755,7 @@
{
/* Raise the underflow exception */
State->FpuStatus.Ue = TRUE;
-
+
if (!State->FpuControl.Um)
{
Fast486FpuException(State);
@@ -811,7 +811,7 @@
if (State->FpuControl.Im)
{
- /* Return the indefinite NaN */
+ /* Return the indefinite NaN */
Result->Sign = TRUE;
Result->Exponent = FPU_MAX_EXPONENT + 1;
Result->Mantissa = FPU_INDEFINITE_MANTISSA;
@@ -856,7 +856,7 @@
/* Divide the two mantissas */
Remainder = UnsignedDivMod128(0ULL,
/* Notice the 64 above - this is the high part */
- FirstOperand->Mantissa,
+ FirstOperand->Mantissa,
SecondOperand->Mantissa,
&QuotientLow,
&QuotientHigh);
@@ -1774,7 +1774,7 @@
SourceOperand = &MemoryData;
/* Perform the requested operation */
- Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
+ Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
#endif
}
@@ -1896,7 +1896,7 @@
Value.Exponent = *((PUSHORT)&Buffer[8]) & (FPU_MAX_EXPONENT +
1);
Value.Sign = *((PUCHAR)&Buffer[9]) >> 7;
- Fast486FpuPush(State, &Value);
+ Fast486FpuPush(State, &Value);
break;
}
@@ -1939,7 +1939,7 @@
return;
}
- Fast486FpuPop(State);
+ Fast486FpuPop(State);
break;
}
@@ -2469,7 +2469,7 @@
}
/* Perform the requested operation */
- Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
+ Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
if (!ModRegRm.Memory) Fast486FpuPop(State);
#endif
@@ -2653,7 +2653,7 @@
return;
}
- Fast486FpuPop(State);
+ Fast486FpuPop(State);
break;
}
Modified: trunk/reactos/lib/fast486/opcodes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=…
==============================================================================
--- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -4154,7 +4154,7 @@
FAST486_OPCODE_HANDLER(Fast486OpcodePopFlags)
{
BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size;
- INT Cpl = Fast486GetCurrentPrivLevel(State);
+ UINT Cpl = Fast486GetCurrentPrivLevel(State);
FAST486_FLAGS_REG NewFlags;
NO_LOCK_PREFIX();
@@ -4487,11 +4487,11 @@
if ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) &&
!State->Flags.Vm)
{
- INT i;
- INT OldCpl = Fast486GetCurrentPrivLevel(State);
+ UINT i;
+ UINT OldCpl = Fast486GetCurrentPrivLevel(State);
ULONG StackPtr;
ULONG StackSel;
-
+
if (GET_SEGMENT_RPL(Segment) > OldCpl)
{
/* Pop ESP */
@@ -4658,7 +4658,7 @@
/* Check for protected mode */
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
{
- INT OldCpl = Fast486GetCurrentPrivLevel(State);
+ UINT OldCpl = Fast486GetCurrentPrivLevel(State);
if (State->Flags.Vm)
{
@@ -5291,7 +5291,7 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax)
{
BOOLEAN OperandSize, AddressSize;
-
+
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
/* Make sure this is the right instruction */
@@ -5864,7 +5864,7 @@
|| (!AddressSize && (State->GeneralRegs[FAST486_REG_ECX].LowWord
== 0)))
{
/* Do nothing */
- return;
+ return;
}
}
Modified: trunk/reactos/lib/fast486/opgroups.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] Fri Apr 10 22:36:13 2015
@@ -209,7 +209,7 @@
case 2:
{
Result = (Value << Count) | (State->Flags.Cf << (Count - 1));
-
+
/* Complete the calculation, but make sure we don't shift by too much */
if ((Bits - Count) < 31) Result |= Value >> (Bits - Count + 1);
@@ -993,7 +993,7 @@
Quotient = State->GeneralRegs[FAST486_REG_EAX].LowWord / Value;
Remainder = State->GeneralRegs[FAST486_REG_EAX].LowWord % Value;
- if (Quotient > 0xFF)
+ if (Quotient > 0xFF)
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
@@ -1023,7 +1023,7 @@
Quotient = (SHORT)State->GeneralRegs[FAST486_REG_EAX].LowWord /
(CHAR)Value;
Remainder = (SHORT)State->GeneralRegs[FAST486_REG_EAX].LowWord %
(CHAR)Value;
- if (Quotient > 127 || Quotient < -128)
+ if (Quotient > 127 || Quotient < -128)
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
@@ -1142,7 +1142,7 @@
case 3:
{
/* Calculate the result */
- ULONG Result = -Value;
+ ULONG Result = -(LONG)Value;
if (!OperandSize) Result &= 0xFFFF;
/* Update the flags */