code cleanup: quiet some windows warnings.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 15 Sep 2012 04:57:51 +0000 (04:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 15 Sep 2012 04:57:51 +0000 (04:57 +0000)
intern/ghost/intern/GHOST_WindowCarbon.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/utfconv/utfconv.c
source/blender/blenloader/intern/readfile.c

index c7be02cc7afd4e7159d5680a3aeeee9be0888838..99d8854667ebe637ce1729fc30479efecbb38132 100644 (file)
@@ -676,7 +676,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setWindowCursorShape(GHOST_TStandardCursor sh
        return GHOST_kSuccess;
 }
 
-#if 0
+#if 0  /* UNUSED */
 /** Reverse the bits in a GHOST_TUns8 */
 static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
 {
index 0e8ff438998088afc5881dab0b6a283dab84b8f1..98c574e89ea1e9f3319df5356629a8d1a5899b51 100644 (file)
@@ -20,7 +20,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): Maarten Gribnau.
  *
  * ***** END GPL LICENSE BLOCK *****
  */
  *  \ingroup GHOST
  */
 
-
-/**
- * Copyright (C) 2001 NaN Technologies B.V.
- * \author     Maarten Gribnau
- * \date       May 10, 2001
- */
-
 #include <string.h>
 #include "GHOST_WindowWin32.h"
 #include "GHOST_SystemWin32.h"
@@ -50,7 +43,7 @@
 
 // MSVC6 still doesn't define M_PI
 #ifndef M_PI
-#define M_PI 3.1415926536
+#  define M_PI 3.1415926536
 #endif
 
 // Some more multisample defines
 #define WGL_SAMPLES_ARB         0x2042
 
 // win64 doesn't define GWL_USERDATA
-#ifdef WIN32
-#ifndef GWL_USERDATA
-#define GWL_USERDATA GWLP_USERDATA
-#define GWL_WNDPROC GWLP_WNDPROC
-#endif
+#ifdef WIN32  /* why? - probably should remove */
+#  ifndef GWL_USERDATA
+#    define GWL_USERDATA GWLP_USERDATA
+#    define GWL_WNDPROC GWLP_WNDPROC
+#  endif
 #endif
 
-wchar_t *GHOST_WindowWin32::s_windowClassName = L"GHOST_WindowClass";
+const wchar_t *GHOST_WindowWin32::s_windowClassName = L"GHOST_WindowClass";
 const int GHOST_WindowWin32::s_maxTitleLength = 128;
 HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL;
 HDC GHOST_WindowWin32::s_firstHDC = NULL;
@@ -149,7 +142,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(
        m_tablet(0),
        m_maxPressure(0),
        m_multisample(numOfAASamples),
-       m_parentWindowHwnd(parentwindowhwnd),
        m_multisampleEnabled(msEnabled),
        m_msPixelFormat(msPixelFormat),
        //For recreation
@@ -160,7 +152,8 @@ GHOST_WindowWin32::GHOST_WindowWin32(
        m_height(height),
        m_normal_state(GHOST_kWindowStateNormal),
        m_stereo(stereoVisual),
-       m_nextWindow(NULL)
+       m_nextWindow(NULL),
+       m_parentWindowHwnd(parentwindowhwnd),
 {
        OSVERSIONINFOEX versionInfo;
        bool hasMinVersionForTaskbar = false;
@@ -1208,6 +1201,7 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
        return ch;
 }
 
+#if 0  /* UNUSED */
 /** Reverse the bits in a GHOST_TUns16 */
 static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
 {
@@ -1217,6 +1211,7 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
        shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
        return shrt;
 }
+#endif
 GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
                                                              GHOST_TUns8 mask[16][2],
                                                              int hotX, int hotY)
index 3f52f9e22b0ccedcbb4c64dfa5cf0c2809b687be..9e4377b822582c20151b273d79c5e1e6b2921d03 100644 (file)
@@ -236,7 +236,7 @@ public:
         * Returns the name of the window class.
         * \return The name of the window class.
         */
-       static wchar_t *getWindowClassName() {
+       static const wchar_t *getWindowClassName() {
                return s_windowClassName;
        }
 
@@ -355,7 +355,7 @@ protected:
        /** ITaskbarList3 structure for progress bar*/
        ITaskbarList3 *m_Bar;
 
-       static wchar_t *s_windowClassName;
+       static const wchar_t *s_windowClassName;
        static const int s_maxTitleLength;
 
        /** WinTab dll handle */
index a9b2920111dc01128cd7b724e1eb4dcaf2cbbf56..7f7a612528d775ea6da99ba60e403123423eea4c 100644 (file)
@@ -219,7 +219,9 @@ int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16)
        return err;
 }
 
-int is_ascii(const char *in8)
+/* UNUSED FUNCTIONS */
+#if 0
+static int is_ascii(const char *in8)
 {
        for (; *in8; in8++)
                if (0x80 & *in8) return 0;
@@ -227,7 +229,7 @@ int is_ascii(const char *in8)
        return 1;
 }
 
-void utf_8_cut_end(char *inout8, size_t maxcutpoint)
+static void utf_8_cut_end(char *inout8, size_t maxcutpoint)
 {
        char *cur = inout8 + maxcutpoint;
        char cc;
@@ -235,7 +237,7 @@ void utf_8_cut_end(char *inout8, size_t maxcutpoint)
 
        cc = *cur;
 }
-
+#endif
 
 
 char *alloc_utf_8_from_16(const wchar_t *in16, size_t add)
index 683e751b6b963e56272f1dbc0239589d5c9cdb56..3935546bf5895172033ad12bb3962c4c1def0fde 100644 (file)
@@ -589,11 +589,7 @@ static void switch_endian_bh8(BHead8 *bhead)
 static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, int do_endian_swap)
 {
        BHead4 *bhead4 = (BHead4 *) bhead;
-#if defined(WIN32) && !defined(FREE_WINDOWS)
-       __int64 old;
-#else
-       long long old;
-#endif
+       int64_t old;
 
        bhead4->code = bhead8->code;
        bhead4->len = bhead8->len;