OSDN Git Service

Reduce some compiler warnings
authorsdottaka <sdottaka@users.sourceforge.net>
Thu, 15 Jan 2015 06:37:27 +0000 (15:37 +0900)
committersdottaka <sdottaka@users.sourceforge.net>
Thu, 15 Jan 2015 06:37:27 +0000 (15:37 +0900)
src/ImgDiffBuffer.hpp
src/ImgMergeBuffer.hpp
src/ImgWindow.hpp

index 2ec06b6..2a92d18 100644 (file)
@@ -974,7 +974,7 @@ protected:
                                                                scanline[x * 4 + 0] = Image::valueB(color);\r
                                                                scanline[x * 4 + 1] = Image::valueG(color);\r
                                                                scanline[x * 4 + 2] = Image::valueR(color);\r
-                                                               scanline[x * 4 + 3] = 0xff * m_diffColorAlpha;\r
+                                                               scanline[x * 4 + 3] = static_cast<unsigned char>(0xff * m_diffColorAlpha);\r
                                                        }\r
                                                }\r
                                        }\r
index 0b8c510..0a31a61 100644 (file)
@@ -199,14 +199,14 @@ public:
                        {\r
                                if (m_diff(x / m_diffBlockSize, y / m_diffBlockSize) == diffIndex + 1)\r
                                {\r
-                                       for (int i = 0; i < m_diffBlockSize; ++i)\r
+                                       for (unsigned i = 0; i < m_diffBlockSize; ++i)\r
                                        {\r
                                                int sy = y + i - m_offset[srcPane].y; \r
                                                if (sy >= 0 && sy < m_imgOrig32[srcPane].height())\r
                                                {\r
                                                        const unsigned char *scanline_src = m_imgOrig32[srcPane].scanLine(sy);\r
                                                        unsigned char *scanline_dst = m_imgOrig32[dstPane].scanLine(y + i - m_offset[dstPane].y);\r
-                                                       for (int j = 0; j < m_diffBlockSize; ++j)\r
+                                                       for (unsigned j = 0; j < m_diffBlockSize; ++j)\r
                                                        {\r
                                                                int sx = x + j - m_offset[srcPane].x; \r
                                                                if (sx >= 0 && sx < m_imgOrig32[srcPane].width())\r
index 98682d4..084635a 100644 (file)
@@ -193,9 +193,9 @@ public:
                        GetClientRect(m_hWnd, &rc);\r
                        unsigned width  = static_cast<unsigned>(m_fip->getWidth()  * m_zoom) + MARGIN * 2; \r
                        unsigned height = static_cast<unsigned>(m_fip->getHeight() * m_zoom) + MARGIN * 2; \r
-                       if (m_nHScrollPos > width  - rc.right)\r
+                       if (m_nHScrollPos > static_cast<int>(width  - rc.right))\r
                                m_nHScrollPos = width  - rc.right;\r
-                       if (m_nVScrollPos > height - rc.bottom)\r
+                       if (m_nVScrollPos > static_cast<int>(height - rc.bottom))\r
                                m_nVScrollPos = height - rc.bottom;\r
                        CalcScrollBarRange();\r
                        InvalidateRect(m_hWnd, NULL, TRUE);\r