Author: rharabien Date: Sat Jun 25 14:34:52 2011 New Revision: 52455
URL: http://svn.reactos.org/svn/reactos?rev=52455&view=rev Log: [MSPAINT] - Fix MSVC warnings
Modified: trunk/reactos/base/applications/mspaint/drawing.c trunk/reactos/base/applications/mspaint/drawing.h trunk/reactos/base/applications/mspaint/globalvar.h trunk/reactos/base/applications/mspaint/main.c trunk/reactos/base/applications/mspaint/mouse.c trunk/reactos/base/applications/mspaint/mouse.h trunk/reactos/base/applications/mspaint/winproc.c
Modified: trunk/reactos/base/applications/mspaint/drawing.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/d... ============================================================================== --- trunk/reactos/base/applications/mspaint/drawing.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/drawing.c [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -13,7 +13,7 @@ /* FUNCTIONS ********************************************************/
void -Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness) +Line(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int thickness) { HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color)); MoveToEx(hdc, x1, y1, NULL); @@ -22,7 +22,7 @@ }
void -Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) +Rect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style) { HBRUSH oldBrush; LOGBRUSH logbrush; @@ -37,7 +37,7 @@ }
void -Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) +Ellp(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style) { HBRUSH oldBrush; LOGBRUSH logbrush; @@ -52,7 +52,7 @@ }
void -RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) +RRect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style) { LOGBRUSH logbrush; HBRUSH oldBrush; @@ -67,7 +67,7 @@ }
void -Poly(HDC hdc, POINT * lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed) +Poly(HDC hdc, POINT * lpPoints, int nCount, COLORREF fg, COLORREF bg, int thickness, int style, BOOL closed) { LOGBRUSH logbrush; HBRUSH oldBrush; @@ -85,7 +85,7 @@ }
void -Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness) +Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thickness) { HPEN oldPen; POINT fourPoints[4]; @@ -99,7 +99,7 @@ }
void -Fill(HDC hdc, int x, int y, int color) +Fill(HDC hdc, LONG x, LONG y, COLORREF color) { HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); ExtFloodFill(hdc, x, y, GetPixel(hdc, x, y), FLOODFILLSURFACE); @@ -107,7 +107,7 @@ }
void -Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius) +Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius) { short a; HPEN oldPen; @@ -122,9 +122,10 @@ }
void -Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius) -{ - short a, x, y; +Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius) +{ + LONG a, x, y; + for(a = 0; a <= 100; a++) for(y = (y1 * (100 - a) + y2 * a) / 100 - radius + 1; y < (y1 * (100 - a) + y2 * a) / 100 + radius + 1; y++) @@ -135,10 +136,10 @@ }
void -Airbrush(HDC hdc, short x, short y, int color, int r) -{ - short a; - short b; +Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r) +{ + LONG a, b; + for(b = -r; b <= r; b++) for(a = -r; a <= r; a++) if ((a * a + b * b <= r * r) && (rand() % 4 == 0)) @@ -146,7 +147,7 @@ }
void -Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style) +Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, COLORREF style) { HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); @@ -231,7 +232,7 @@ }
void -RectSel(HDC hdc, short x1, short y1, short x2, short y2) +RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2) { HBRUSH oldBrush; LOGBRUSH logbrush; @@ -246,7 +247,7 @@ }
void -SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2) +SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2) { HBRUSH oldBrush; LOGBRUSH logbrush;
Modified: trunk/reactos/base/applications/mspaint/drawing.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/d... ============================================================================== --- trunk/reactos/base/applications/mspaint/drawing.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/drawing.h [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -6,28 +6,28 @@ * PROGRAMMERS: Benedikt Freisen */
-void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness); +void Line(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int thickness);
-void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style); +void Rect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style);
-void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style); +void Ellp(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style);
-void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style); +void RRect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style);
-void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed); +void Poly(HDC hdc, POINT *lpPoints, int nCount, COLORREF fg, COLORREF bg, int thickness, int style, BOOL closed);
-void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness); +void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thickness);
-void Fill(HDC hdc, int x, int y, int color); +void Fill(HDC hdc, LONG x, LONG y, COLORREF color);
-void Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius); +void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius);
-void Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius); +void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius);
-void Airbrush(HDC hdc, short x, short y, int color, int r); +void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r);
-void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style); +void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int style);
-void RectSel(HDC hdc, short x1, short y1, short x2, short y2); +void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2);
-void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2); +void SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2);
Modified: trunk/reactos/base/applications/mspaint/globalvar.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/g... ============================================================================== --- trunk/reactos/base/applications/mspaint/globalvar.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/globalvar.h [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -26,10 +26,10 @@ extern int redoSteps; extern BOOL imageSaved;
-extern short startX; -extern short startY; -extern short lastX; -extern short lastY; +extern LONG startX; +extern LONG startY; +extern LONG lastX; +extern LONG lastY; extern int lineWidth; extern int shapeStyle; extern int brushStyle;
Modified: trunk/reactos/base/applications/mspaint/main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/m... ============================================================================== --- trunk/reactos/base/applications/mspaint/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/main.c [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -43,10 +43,10 @@ int redoSteps = 0; BOOL imageSaved = TRUE;
-short startX; -short startY; -short lastX; -short lastY; +LONG startX; +LONG startY; +LONG lastX; +LONG lastY; int lineWidth = 1; int shapeStyle = 0; int brushStyle = 0;
Modified: trunk/reactos/base/applications/mspaint/mouse.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/m... ============================================================================== --- trunk/reactos/base/applications/mspaint/mouse.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/mouse.c [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -26,7 +26,7 @@ }
void -regularize(short x0, short y0, short *x1, short *y1) +regularize(LONG x0, LONG y0, LONG *x1, LONG *y1) { if (abs(*x1 - x0) >= abs(*y1 - y0)) *y1 = y0 + (*y1 > y0 ? abs(*x1 - x0) : -abs(*x1 - x0)); @@ -35,7 +35,7 @@ }
void -roundTo8Directions(short x0, short y0, short *x1, short *y1) +roundTo8Directions(LONG x0, LONG y0, LONG *x1, LONG *y1) { if (abs(*x1 - x0) >= abs(*y1 - y0)) { @@ -59,7 +59,7 @@ int ptSP = 0;
void -startPaintingL(HDC hdc, short x, short y, int fg, int bg) +startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { startX = x; startY = y; @@ -132,7 +132,7 @@ }
void -whilePaintingL(HDC hdc, short x, short y, int fg, int bg) +whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { switch (activeTool) { @@ -149,8 +149,8 @@ break; case TOOL_RECTSEL: { - short tempX; - short tempY; + int tempX; + int tempY; resetToU1(); tempX = max(0, min(x, imgXRes)); tempY = max(0, min(y, imgYRes)); @@ -209,7 +209,7 @@ pointStack[pointSP].y = y; if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, - (short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y); + &pointStack[pointSP].x, &pointStack[pointSP].y); if (pointSP + 1 >= 2) Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE); break; @@ -232,7 +232,7 @@ }
void -endPaintingL(HDC hdc, short x, short y, int fg, int bg) +endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { switch (activeTool) { @@ -350,7 +350,7 @@ pointStack[pointSP].y = y; if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, - (short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y); + &pointStack[pointSP].x, &pointStack[pointSP].y); pointSP++; if (pointSP >= 2) { @@ -384,7 +384,7 @@ }
void -startPaintingR(HDC hdc, short x, short y, int fg, int bg) +startPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { startX = x; startY = y; @@ -444,7 +444,7 @@ }
void -whilePaintingR(HDC hdc, short x, short y, int fg, int bg) +whilePaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { switch (activeTool) { @@ -496,7 +496,7 @@ pointStack[pointSP].y = y; if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, - (short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y); + &pointStack[pointSP].x, &pointStack[pointSP].y); if (pointSP + 1 >= 2) Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE); break; @@ -519,7 +519,7 @@ }
void -endPaintingR(HDC hdc, short x, short y, int fg, int bg) +endPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) { switch (activeTool) { @@ -553,7 +553,7 @@ pointStack[pointSP].y = y; if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, - (short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y); + &pointStack[pointSP].x, &pointStack[pointSP].y); pointSP++; if (pointSP >= 2) {
Modified: trunk/reactos/base/applications/mspaint/mouse.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/m... ============================================================================== --- trunk/reactos/base/applications/mspaint/mouse.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/mouse.h [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -8,14 +8,14 @@
void placeSelWin(void);
-void startPaintingL(HDC hdc, short x, short y, int fg, int bg); +void startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
-void whilePaintingL(HDC hdc, short x, short y, int fg, int bg); +void whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
-void endPaintingL(HDC hdc, short x, short y, int fg, int bg); +void endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
-void startPaintingR(HDC hdc, short x, short y, int fg, int bg); +void startPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
-void whilePaintingR(HDC hdc, short x, short y, int fg, int bg); +void whilePaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
-void endPaintingR(HDC hdc, short x, short y, int fg, int bg); +void endPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg);
Modified: trunk/reactos/base/applications/mspaint/winproc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/w... ============================================================================== --- trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] Sat Jun 25 14:34:52 2011 @@ -503,7 +503,7 @@ } SendMessage(hImageArea, WM_PAINT, 0, 0); if ((activeTool == TOOL_ZOOM) && (zoom < 8000)) - zoomTo(zoom * 2, (short)LOWORD(lParam), (short)HIWORD(lParam)); + zoomTo(zoom * 2, LOWORD(lParam), HIWORD(lParam)); } break;
@@ -524,7 +524,7 @@ } SendMessage(hImageArea, WM_PAINT, 0, 0); if ((activeTool == TOOL_ZOOM) && (zoom > 125)) - zoomTo(zoom / 2, (short)LOWORD(lParam), (short)HIWORD(lParam)); + zoomTo(zoom / 2, LOWORD(lParam), HIWORD(lParam)); } break;
@@ -589,8 +589,8 @@ case WM_MOUSEMOVE: if (hwnd == hImageArea) { - short xNow = (short)LOWORD(lParam) * 1000 / zoom; - short yNow = (short)HIWORD(lParam) * 1000 / zoom; + LONG xNow = LOWORD(lParam) * 1000 / zoom; + LONG yNow = HIWORD(lParam) * 1000 / zoom; if ((!drawing) || (activeTool <= TOOL_AIRBRUSH)) { TRACKMOUSEEVENT tme; @@ -598,7 +598,7 @@ if (activeTool == TOOL_ZOOM) { SendMessage(hImageArea, WM_PAINT, 0, 0); - drawZoomFrame((short)LOWORD(lParam), (short)HIWORD(lParam)); + drawZoomFrame(LOWORD(lParam), HIWORD(lParam)); }
tme.cbSize = sizeof(TRACKMOUSEEVENT); @@ -617,8 +617,8 @@ if (drawing) { /* values displayed in statusbar */ - short xRel = xNow - startX; - short yRel = yNow - startY; + LONG xRel = xNow - startX; + LONG yRel = yNow - startY; /* freesel, rectsel and text tools always show numbers limited to fit into image area */ if ((activeTool == TOOL_FREESEL) || (activeTool == TOOL_RECTSEL) || (activeTool == TOOL_TEXT)) {