https://git.reactos.org/?p=reactos.git;a=commitdiff;h=08c6d21e1fb9af8fc4d43…
commit 08c6d21e1fb9af8fc4d43a29e74ac3e05581c096
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun May 26 13:37:31 2019 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Jul 27 11:21:28 2019 +0200
[REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result
still unsigned
---
drivers/bus/acpi/cmbatt/cmbatt.c | 2 +-
sdk/lib/drivers/sound/shared/time.c | 4 ++--
subsystems/win/basesrv/dosdev.c | 2 +-
win32ss/drivers/font/bmfd/bmfd.h | 4 ++--
win32ss/drivers/font/bmfd/glyph.c | 2 +-
win32ss/user/ntuser/menu.c | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/bus/acpi/cmbatt/cmbatt.c b/drivers/bus/acpi/cmbatt/cmbatt.c
index 775f755c134..cdac118c531 100644
--- a/drivers/bus/acpi/cmbatt/cmbatt.c
+++ b/drivers/bus/acpi/cmbatt/cmbatt.c
@@ -980,7 +980,7 @@ CmBattGetBatteryStatus(IN PCMBATT_DEVICE_EXTENSION DeviceExtension,
else if (DeviceExtension->State & BATTERY_DISCHARGING)
{
/* The battery is discharging, so treat the rate as a negative rate */
- DeviceExtension->Rate = -DeviceExtension->Rate;
+ DeviceExtension->Rate = -(LONG)DeviceExtension->Rate;
}
else if (!(DeviceExtension->State & BATTERY_CHARGING) &&
(DeviceExtension->Rate))
{
diff --git a/sdk/lib/drivers/sound/shared/time.c b/sdk/lib/drivers/sound/shared/time.c
index 19b61bca216..70e0d36b635 100644
--- a/sdk/lib/drivers/sound/shared/time.c
+++ b/sdk/lib/drivers/sound/shared/time.c
@@ -29,8 +29,8 @@ SleepMs(ULONG Milliseconds)
{
LARGE_INTEGER Period;
- Period.QuadPart = -Milliseconds;
- Period.QuadPart *= 10000;
+ Period.QuadPart = Milliseconds;
+ Period.QuadPart *= -10000;
KeDelayExecutionThread(KernelMode, FALSE, &Period);
}
diff --git a/subsystems/win/basesrv/dosdev.c b/subsystems/win/basesrv/dosdev.c
index 83a01242e73..958dceca8ee 100644
--- a/subsystems/win/basesrv/dosdev.c
+++ b/subsystems/win/basesrv/dosdev.c
@@ -809,7 +809,7 @@ CSR_API(BaseSrvDefineDosDevice)
/* There's a target provided - new device, update buffer */
else
{
- RtlInitUnicodeString(&LinkTarget, &CurrentBuffer[-TargetLength -
1]);
+ RtlInitUnicodeString(&LinkTarget, CurrentBuffer - TargetLength - 1);
}
/*
diff --git a/win32ss/drivers/font/bmfd/bmfd.h b/win32ss/drivers/font/bmfd/bmfd.h
index 58aedb268ee..d1d954a6b7f 100644
--- a/win32ss/drivers/font/bmfd/bmfd.h
+++ b/win32ss/drivers/font/bmfd/bmfd.h
@@ -244,8 +244,8 @@ typedef struct
{
FONTOBJ *pfo;
PBMFD_FACE pface;
- ULONG xScale;
- ULONG yScale;
+ LONG xScale;
+ LONG yScale;
ULONG ulAngle;
} BMFD_FONT, *PBMFD_FONT;
diff --git a/win32ss/drivers/font/bmfd/glyph.c b/win32ss/drivers/font/bmfd/glyph.c
index ebc5f06e824..ddbcecf1a12 100644
--- a/win32ss/drivers/font/bmfd/glyph.c
+++ b/win32ss/drivers/font/bmfd/glyph.c
@@ -83,7 +83,7 @@ BmfdQueryGlyphAndBitmap(
PGLYPHENTRY pge;
ULONG xSrc, ySrc, cxSrc, cySrc;
ULONG xDst, yDst, cxDst, cyDst;
- ULONG xScale, yScale;
+ LONG xScale, yScale;
ULONG ulGlyphOffset, cjDstRow, color;
PVOID pvSrc0, pvDst0;
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index 5e48e5a5f7d..97e1fa2b805 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -1752,7 +1752,7 @@ static void FASTCALL MENU_DrawBitmapItem(HDC hdc, PITEM lpitem,
const RECT *rect
drawItem.itemData = lpitem->dwItemData;
/* some applications make this assumption on the DC's origin */
GreSetViewportOrgEx( hdc, lpitem->xItem, lpitem->yItem,
&origorg);
- RECTL_vOffsetRect( &drawItem.rcItem, - lpitem->xItem, -
lpitem->yItem);
+ RECTL_vOffsetRect(&drawItem.rcItem, -(LONG)lpitem->xItem,
-(LONG)lpitem->yItem);
co_IntSendMessage( UserHMGetHandle(WndOwner), WM_DRAWITEM, 0,
(LPARAM)&drawItem);
GreSetViewportOrgEx( hdc, origorg.x, origorg.y, NULL);
return;