https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ec53d4227807256ae0359810430c072840acf888

commit ec53d4227807256ae0359810430c072840acf888
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Thu Jun 22 07:28:15 2023 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Thu Jun 22 07:28:15 2023 +0900

    [MSPAINT] s/pointSP/s_pointSP/ and s/pointStack/s_pointStack/
    
    CORE-18867
---
 base/applications/mspaint/mouse.cpp    | 90 +++++++++++++++++-----------------
 base/applications/mspaint/toolsmodel.h |  4 +-
 base/applications/mspaint/winproc.cpp  |  8 +--
 3 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/base/applications/mspaint/mouse.cpp 
b/base/applications/mspaint/mouse.cpp
index 29959f1bb38..dad03d9fc0a 100644
--- a/base/applications/mspaint/mouse.cpp
+++ b/base/applications/mspaint/mouse.cpp
@@ -11,8 +11,8 @@
 
 #include "precomp.h"
 
-INT ToolBase::pointSP = 0;
-POINT ToolBase::pointStack[256] = { { 0 } };
+INT ToolBase::s_pointSP = 0;
+POINT ToolBase::s_pointStack[256] = { { 0 } };
 
 /* FUNCTIONS ********************************************************/
 
@@ -65,7 +65,7 @@ void updateLast(LONG x, LONG y)
 
 void ToolBase::reset()
 {
-    pointSP = 0;
+    s_pointSP = 0;
     g_ptStart.x = g_ptStart.y = g_ptEnd.x = g_ptEnd.y = -1;
     selectionModel.ResetPtStack();
     if (selectionModel.m_bShow)
@@ -675,17 +675,17 @@ struct BezierTool : ToolBase
             return;
 
         COLORREF rgb = (m_bLeftButton ? m_fg : m_bg);
-        switch (pointSP)
+        switch (s_pointSP)
         {
             case 1:
-                Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, 
pointStack[1].y, rgb,
+                Line(hdc, s_pointStack[0].x, s_pointStack[0].y, 
s_pointStack[1].x, s_pointStack[1].y, rgb,
                      toolsModel.GetLineWidth());
                 break;
             case 2:
-                Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], 
pointStack[1], rgb, toolsModel.GetLineWidth());
+                Bezier(hdc, s_pointStack[0], s_pointStack[2], s_pointStack[2], 
s_pointStack[1], rgb, toolsModel.GetLineWidth());
                 break;
             case 3:
-                Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], 
pointStack[1], rgb, toolsModel.GetLineWidth());
+                Bezier(hdc, s_pointStack[0], s_pointStack[2], s_pointStack[3], 
s_pointStack[1], rgb, toolsModel.GetLineWidth());
                 break;
         }
     }
@@ -697,15 +697,15 @@ struct BezierTool : ToolBase
         if (!m_bDrawing)
         {
             m_bDrawing = TRUE;
-            pointStack[pointSP].x = pointStack[pointSP + 1].x = x;
-            pointStack[pointSP].y = pointStack[pointSP + 1].y = y;
-            ++pointSP;
+            s_pointStack[s_pointSP].x = s_pointStack[s_pointSP + 1].x = x;
+            s_pointStack[s_pointSP].y = s_pointStack[s_pointSP + 1].y = y;
+            ++s_pointSP;
         }
         else
         {
-            ++pointSP;
-            pointStack[pointSP].x = x;
-            pointStack[pointSP].y = y;
+            ++s_pointSP;
+            s_pointStack[s_pointSP].x = x;
+            s_pointStack[s_pointSP].y = y;
         }
 
         imageModel.NotifyImageChanged();
@@ -713,16 +713,16 @@ struct BezierTool : ToolBase
 
     void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override
     {
-        pointStack[pointSP].x = x;
-        pointStack[pointSP].y = y;
+        s_pointStack[s_pointSP].x = x;
+        s_pointStack[s_pointSP].y = y;
         imageModel.NotifyImageChanged();
     }
 
     void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override
     {
-        pointStack[pointSP].x = x;
-        pointStack[pointSP].y = y;
-        if (pointSP >= 3)
+        s_pointStack[s_pointSP].x = x;
+        s_pointStack[s_pointSP].y = y;
+        if (s_pointSP >= 3)
         {
             OnFinishDraw();
             return;
@@ -777,13 +777,13 @@ struct ShapeTool : ToolBase
 
     void OnDrawOverlayOnImage(HDC hdc)
     {
-        if (pointSP <= 0)
+        if (s_pointSP <= 0)
             return;
 
         if (m_bLeftButton)
-            Poly(hdc, pointStack, pointSP + 1, m_fg, m_bg, 
toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE);
+            Poly(hdc, s_pointStack, s_pointSP + 1, m_fg, m_bg, 
toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE);
         else
-            Poly(hdc, pointStack, pointSP + 1, m_bg, m_fg, 
toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE);
+            Poly(hdc, s_pointStack, s_pointSP + 1, m_bg, m_fg, 
toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE);
     }
 
     void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) 
override
@@ -791,23 +791,23 @@ struct ShapeTool : ToolBase
         m_bLeftButton = bLeftButton;
         m_bClosed = FALSE;
 
-        if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
-            roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 
1].y, x, y);
+        if ((s_pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
+            roundTo8Directions(s_pointStack[s_pointSP - 1].x, 
s_pointStack[s_pointSP - 1].y, x, y);
 
-        pointStack[pointSP].x = x;
-        pointStack[pointSP].y = y;
+        s_pointStack[s_pointSP].x = x;
+        s_pointStack[s_pointSP].y = y;
 
-        if (pointSP && bDoubleClick)
+        if (s_pointSP && bDoubleClick)
         {
             OnFinishDraw();
             return;
         }
 
-        if (pointSP == 0)
+        if (s_pointSP == 0)
         {
-            pointSP++;
-            pointStack[pointSP].x = x;
-            pointStack[pointSP].y = y;
+            s_pointSP++;
+            s_pointStack[s_pointSP].x = x;
+            s_pointStack[s_pointSP].y = y;
         }
 
         imageModel.NotifyImageChanged();
@@ -815,35 +815,35 @@ struct ShapeTool : ToolBase
 
     void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override
     {
-        if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
-            roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 
1].y, x, y);
+        if ((s_pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
+            roundTo8Directions(s_pointStack[s_pointSP - 1].x, 
s_pointStack[s_pointSP - 1].y, x, y);
 
-        pointStack[pointSP].x = x;
-        pointStack[pointSP].y = y;
+        s_pointStack[s_pointSP].x = x;
+        s_pointStack[s_pointSP].y = y;
 
         imageModel.NotifyImageChanged();
     }
 
     void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override
     {
-        if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
-            roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 
1].y, x, y);
+        if ((s_pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
+            roundTo8Directions(s_pointStack[s_pointSP - 1].x, 
s_pointStack[s_pointSP - 1].y, x, y);
 
         m_bClosed = FALSE;
-        if (nearlyEqualPoints(x, y, pointStack[0].x, pointStack[0].y))
+        if (nearlyEqualPoints(x, y, s_pointStack[0].x, s_pointStack[0].y))
         {
             OnFinishDraw();
             return;
         }
         else
         {
-            pointSP++;
-            pointStack[pointSP].x = x;
-            pointStack[pointSP].y = y;
+            s_pointSP++;
+            s_pointStack[s_pointSP].x = x;
+            s_pointStack[s_pointSP].y = y;
         }
 
-        if (pointSP == _countof(pointStack))
-            pointSP--;
+        if (s_pointSP == _countof(s_pointStack))
+            s_pointSP--;
 
         imageModel.NotifyImageChanged();
     }
@@ -855,9 +855,9 @@ struct ShapeTool : ToolBase
 
     void OnFinishDraw() override
     {
-        if (pointSP)
+        if (s_pointSP)
         {
-            --pointSP;
+            --s_pointSP;
             m_bClosed = TRUE;
 
             imageModel.PushImageForUndo();
@@ -865,7 +865,7 @@ struct ShapeTool : ToolBase
         }
 
         m_bClosed = FALSE;
-        pointSP = 0;
+        s_pointSP = 0;
 
         ToolBase::OnFinishDraw();
     }
diff --git a/base/applications/mspaint/toolsmodel.h 
b/base/applications/mspaint/toolsmodel.h
index b31183b3584..f7d29c28a0e 100644
--- a/base/applications/mspaint/toolsmodel.h
+++ b/base/applications/mspaint/toolsmodel.h
@@ -36,8 +36,8 @@ struct ToolBase
     TOOLTYPE m_tool;
     HDC m_hdc;
     COLORREF m_fg, m_bg;
-    static INT pointSP;
-    static POINT pointStack[256];
+    static INT s_pointSP;
+    static POINT s_pointStack[256];
 
     ToolBase(TOOLTYPE tool) : m_tool(tool), m_hdc(NULL) { }
     virtual ~ToolBase() { }
diff --git a/base/applications/mspaint/winproc.cpp 
b/base/applications/mspaint/winproc.cpp
index 41829b84b8f..b07f44da4bb 100644
--- a/base/applications/mspaint/winproc.cpp
+++ b/base/applications/mspaint/winproc.cpp
@@ -422,7 +422,7 @@ BOOL CMainWindow::CanUndo() const
         return (BOOL)textEditWindow.SendMessage(EM_CANUNDO);
     if (selectionModel.m_bShow && toolsModel.IsSelection())
         return TRUE;
-    if (ToolBase::pointSP != 0)
+    if (ToolBase::s_pointSP != 0)
         return TRUE;
     return imageModel.CanUndo();
 }
@@ -431,7 +431,7 @@ BOOL CMainWindow::CanRedo() const
 {
     if (toolsModel.GetActiveTool() == TOOL_TEXT && 
::IsWindowVisible(textEditWindow))
         return FALSE; // There is no "WM_REDO" in EDIT control
-    if (ToolBase::pointSP != 0)
+    if (ToolBase::s_pointSP != 0)
         return TRUE;
     return imageModel.CanRedo();
 }
@@ -696,7 +696,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, 
LPARAM lParam, BOOL& bH
                     break;
                 }
             }
-            if (ToolBase::pointSP != 0) // drawing something?
+            if (ToolBase::s_pointSP != 0) // drawing something?
             {
                 canvasWindow.cancelDrawing();
                 break;
@@ -709,7 +709,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, 
LPARAM lParam, BOOL& bH
                 // There is no "WM_REDO" in EDIT control
                 break;
             }
-            if (ToolBase::pointSP != 0) // drawing something?
+            if (ToolBase::s_pointSP != 0) // drawing something?
             {
                 canvasWindow.finishDrawing();
                 break;

Reply via email to