From abce099804046237034c671d528005364aff0d72 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 15 Sep 2012 04:57:51 +0000 Subject: [PATCH] code cleanup: quiet some windows warnings. --- intern/ghost/intern/GHOST_WindowCarbon.cpp | 2 +- intern/ghost/intern/GHOST_WindowWin32.cpp | 29 +++++++++------------ intern/ghost/intern/GHOST_WindowWin32.h | 4 +-- intern/utfconv/utfconv.c | 8 +++--- source/blender/blenloader/intern/readfile.c | 6 +---- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index c7be02cc7af..99d8854667e 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -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) { diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 0e8ff438998..98c574e89ea 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -20,7 +20,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Maarten Gribnau. * * ***** END GPL LICENSE BLOCK ***** */ @@ -29,13 +29,6 @@ * \ingroup GHOST */ - -/** - * Copyright (C) 2001 NaN Technologies B.V. - * \author Maarten Gribnau - * \date May 10, 2001 - */ - #include #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 @@ -58,14 +51,14 @@ #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) diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h index 3f52f9e22b0..9e4377b8225 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.h +++ b/intern/ghost/intern/GHOST_WindowWin32.h @@ -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 */ diff --git a/intern/utfconv/utfconv.c b/intern/utfconv/utfconv.c index a9b2920111d..7f7a612528d 100644 --- a/intern/utfconv/utfconv.c +++ b/intern/utfconv/utfconv.c @@ -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) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 683e751b6b9..3935546bf58 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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;