Author: hbelusca
Date: Sat Apr 11 13:49:32 2015
New Revision: 67163
URL: 
http://svn.reactos.org/svn/reactos?rev=67163&view=rev
Log:
[CONSRV]: Fix MSVC warnings.
Modified:
    trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c
    trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
    trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
    trunk/reactos/win32ss/user/winsrv/consrv/frontends/terminal.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c      [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c      [iso-8859-1] Sat Apr 11
13:49:32 2015
@@ -162,20 +162,14 @@
                        IN PCOORD Start,
                        IN UINT Length)
 {
-    if (Buff->ScreenBufferSize.X <= Start->X + Length)
-    {
-        UpdateRect->Left = 0;
+    if ((UINT)Buff->ScreenBufferSize.X <= Start->X + Length)
+    {
+        UpdateRect->Left  = 0;
+        UpdateRect->Right = Buff->ScreenBufferSize.X - 1;
     }
     else
     {
-        UpdateRect->Left = Start->X;
-    }
-    if (Buff->ScreenBufferSize.X <= Start->X + Length)
-    {
-        UpdateRect->Right = Buff->ScreenBufferSize.X - 1;
-    }
-    else
-    {
+        UpdateRect->Left  = Start->X;
         UpdateRect->Right = Start->X + Length - 1;
     }
     UpdateRect->Top = Start->Y;
@@ -391,7 +385,7 @@
                                    IN USHORT NewScreenAttrib,
                                    IN USHORT NewPopupAttrib)
 {
-    DWORD X, Y, Length;
+    ULONG X, Y, Length;
     PCHAR_INFO Ptr;
     COORD  TopLeft = {0};
@@ -796,7 +790,7 @@
      * if we are going to overflow...
      */
     // Ptr = ConioCoordToPointer(Buffer, Xpos, Ypos); // Doesn't work
-    for (i = 0; i < min(NumCodesToRead, Buffer->ScreenBufferSize.X *
Buffer->ScreenBufferSize.Y); ++i)
+    for (i = 0; i < min(NumCodesToRead, (ULONG)Buffer->ScreenBufferSize.X *
Buffer->ScreenBufferSize.Y); ++i)
     {
         // Ptr = ConioCoordToPointer(Buffer, Xpos, Ypos); // Doesn't work either
         Ptr = &Buffer->Buffer[Xpos + Ypos * Buffer->ScreenBufferSize.X];
@@ -855,7 +849,7 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PVOID WriteBuffer = NULL;
     PWCHAR tmpString = NULL;
-    DWORD X, Y, Length; // , Written = 0;
+    ULONG X, Y, Length; // , Written = 0;
     ULONG CodeSize;
     PCHAR_INFO Ptr;
@@ -989,7 +983,7 @@
                         IN PCOORD WriteCoord,
                         OUT PULONG NumCodesWritten OPTIONAL)
 {
-    DWORD X, Y, Length; // , Written = 0;
+    ULONG X, Y, Length; // , Written = 0;
     PCHAR_INFO Ptr;
     if (Console == NULL || Buffer == NULL || WriteCoord == NULL)
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c     [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c     [iso-8859-1] Sat
Apr 11 13:49:32 2015
@@ -1916,8 +1916,8 @@
         if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary;
         // Compensate for added scroll bars in new window
-        if (charx < Buff->ScreenBufferSize.X) windy -=
GetSystemMetrics(SM_CYHSCROLL);    // new window will have a horizontal scroll bar
-        if (chary < Buff->ScreenBufferSize.Y) windx -=
GetSystemMetrics(SM_CXVSCROLL);    // new window will have a vertical scroll bar
+        if (charx < (DWORD)Buff->ScreenBufferSize.X) windy -=
GetSystemMetrics(SM_CYHSCROLL);    // new window will have a horizontal scroll bar
+        if (chary < (DWORD)Buff->ScreenBufferSize.Y) windx -=
GetSystemMetrics(SM_CXVSCROLL);    // new window will have a vertical scroll bar
         charx = windx / (int)WidthUnit ;
         chary = windy / (int)HeightUnit;
@@ -1929,8 +1929,8 @@
         // Resize window
         if ((charx != Buff->ViewSize.X) || (chary != Buff->ViewSize.Y))
         {
-            Buff->ViewSize.X = (charx <= Buff->ScreenBufferSize.X) ? charx :
Buff->ScreenBufferSize.X;
-            Buff->ViewSize.Y = (chary <= Buff->ScreenBufferSize.Y) ? chary :
Buff->ScreenBufferSize.Y;
+            Buff->ViewSize.X = (charx <= (DWORD)Buff->ScreenBufferSize.X) ?
charx : Buff->ScreenBufferSize.X;
+            Buff->ViewSize.Y = (chary <= (DWORD)Buff->ScreenBufferSize.Y) ?
chary : Buff->ScreenBufferSize.Y;
         }
         ResizeConWnd(GuiData, WidthUnit, HeightUnit);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c       [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c       [iso-8859-1] Sat
Apr 11 13:49:32 2015
@@ -199,7 +199,7 @@
      * array, because of the way things are stored inside it. The downside is
      * that it makes the code more complicated.
      */
-    for (yPos = Begin->Y; (yPos <= End->Y) && (NumChars > 0); yPos++)
+    for (yPos = Begin->Y; (yPos <= (ULONG)End->Y) && (NumChars > 0);
yPos++)
     {
         xBeg = (yPos == Begin->Y ? Begin->X : 0);
         xEnd = (yPos ==   End->Y ?   End->X : Buffer->ScreenBufferSize.X - 1);
@@ -366,8 +366,8 @@
     RightChar  = rcFramebuffer->right  / GuiData->CharWidth;
     BottomLine = rcFramebuffer->bottom / GuiData->CharHeight;
-    if (RightChar  >= Buffer->ScreenBufferSize.X) RightChar  =
Buffer->ScreenBufferSize.X - 1;
-    if (BottomLine >= Buffer->ScreenBufferSize.Y) BottomLine =
Buffer->ScreenBufferSize.Y - 1;
+    if (RightChar  >= (ULONG)Buffer->ScreenBufferSize.X) RightChar  =
Buffer->ScreenBufferSize.X - 1;
+    if (BottomLine >= (ULONG)Buffer->ScreenBufferSize.Y) BottomLine =
Buffer->ScreenBufferSize.Y - 1;
     LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/terminal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/terminal.c       [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/terminal.c       [iso-8859-1] Sat
Apr 11 13:49:32 2015
@@ -561,7 +561,7 @@
                 EndX = (Buff->CursorPosition.X + TAB_WIDTH) & ~(TAB_WIDTH - 1);
                 EndX = min(EndX, (UINT)Buff->ScreenBufferSize.X);
                 Ptr = ConioCoordToPointer(Buff, Buff->CursorPosition.X,
Buff->CursorPosition.Y);
-                while (Buff->CursorPosition.X < EndX)
+                while ((UINT)Buff->CursorPosition.X < EndX)
                 {
                     Ptr->Char.UnicodeChar = L' ';
                     Ptr->Attributes = Buff->ScreenDefaultAttrib;