[REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 26 May 2019 11:37:31 +0000 (13:37 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 27 Jul 2019 09:21:28 +0000 (11:21 +0200)
drivers/bus/acpi/cmbatt/cmbatt.c
sdk/lib/drivers/sound/shared/time.c
subsystems/win/basesrv/dosdev.c
win32ss/drivers/font/bmfd/bmfd.h
win32ss/drivers/font/bmfd/glyph.c
win32ss/user/ntuser/menu.c

index 775f755..cdac118 100644 (file)
@@ -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 */
     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))
     {
     }
     else if (!(DeviceExtension->State & BATTERY_CHARGING) && (DeviceExtension->Rate))
     {
index 19b61bc..70e0d36 100644 (file)
@@ -29,8 +29,8 @@ SleepMs(ULONG Milliseconds)
 {
     LARGE_INTEGER Period;
 
 {
     LARGE_INTEGER Period;
 
-    Period.QuadPart = -Milliseconds;
-    Period.QuadPart *= 10000;
+    Period.QuadPart = Milliseconds;
+    Period.QuadPart *= -10000;
 
     KeDelayExecutionThread(KernelMode, FALSE, &Period);
 }
 
     KeDelayExecutionThread(KernelMode, FALSE, &Period);
 }
index 83a0124..958dcec 100644 (file)
@@ -809,7 +809,7 @@ CSR_API(BaseSrvDefineDosDevice)
         /* There's a target provided - new device, update buffer */
         else
         {
         /* There's a target provided - new device, update buffer */
         else
         {
-            RtlInitUnicodeString(&LinkTarget, &CurrentBuffer[-TargetLength - 1]);
+            RtlInitUnicodeString(&LinkTarget, CurrentBuffer - TargetLength - 1);
         }
 
         /*
         }
 
         /*
index 58aedb2..d1d954a 100644 (file)
@@ -244,8 +244,8 @@ typedef struct
 {
     FONTOBJ *pfo;
     PBMFD_FACE pface;
 {
     FONTOBJ *pfo;
     PBMFD_FACE pface;
-    ULONG xScale;
-    ULONG yScale;
+    LONG xScale;
+    LONG yScale;
     ULONG ulAngle;
 } BMFD_FONT, *PBMFD_FONT;
 
     ULONG ulAngle;
 } BMFD_FONT, *PBMFD_FONT;
 
index ebc5f06..ddbcecf 100644 (file)
@@ -83,7 +83,7 @@ BmfdQueryGlyphAndBitmap(
     PGLYPHENTRY pge;
     ULONG xSrc, ySrc, cxSrc, cySrc;
     ULONG xDst, yDst, cxDst, cyDst;
     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;
 
     ULONG ulGlyphOffset, cjDstRow, color;
     PVOID pvSrc0, pvDst0;
 
index 5e48e5a..97e1fa2 100644 (file)
@@ -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);
                 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;
                 co_IntSendMessage( UserHMGetHandle(WndOwner), WM_DRAWITEM, 0, (LPARAM)&drawItem);
                 GreSetViewportOrgEx( hdc, origorg.x, origorg.y, NULL);
                 return;