Commit: b477e670c2b3d44f7d972ae4f9b65e5b9870dd0f
Author: Campbell Barton
Date:   Thu Jul 24 18:35:30 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rBb477e670c2b3d44f7d972ae4f9b65e5b9870dd0f

Replace if -> ifdef, also some code-style

===================================================================

M       intern/ghost/intern/GHOST_Context.cpp
M       intern/ghost/intern/GHOST_ContextWGL.cpp
M       intern/glew-mx/glew-mx.h
M       intern/glew-mx/intern/glew-mx.c
M       source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/intern/ghost/intern/GHOST_Context.cpp 
b/intern/ghost/intern/GHOST_Context.cpp
index 163219e..346ceb3 100644
--- a/intern/ghost/intern/GHOST_Context.cpp
+++ b/intern/ghost/intern/GHOST_Context.cpp
@@ -159,7 +159,7 @@ bool win32_chk(bool result, const char* file, int line, 
const char* text)
                                msg = "The device contexts specified are not 
compatible.  This can occur if the device contexts are managed by different 
drivers or possibly on different graphics adapters.\n";
                                break;
 
-#if WITH_GLEW_ES
+#ifdef WITH_GLEW_ES
                        case ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV:
                                msg = "The device context(s) and rendering 
context have non-matching affinity masks.\n";
                                break;
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp 
b/intern/ghost/intern/GHOST_ContextWGL.cpp
index 0518527..458a433 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -745,7 +745,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
                int profileBitCore   = m_contextProfileMask & 
WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
                int profileBitCompat = m_contextProfileMask & 
WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
 
-#if WITH_GLEW_ES
+#ifdef WITH_GLEW_ES
                int profileBitES     = m_contextProfileMask & 
WGL_CONTEXT_ES_PROFILE_BIT_EXT;
 #endif
 
@@ -755,7 +755,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
                if (!WGLEW_ARB_create_context_profile && profileBitCompat)
                        fprintf(stderr, "Warning! OpenGL compatibility profile 
not available.\n");
 
-#if WITH_GLEW_ES
+#ifdef WITH_GLEW_ES
                if (!WGLEW_EXT_create_context_es_profile && profileBitES && 
m_contextMajorVersion == 1)
                        fprintf(stderr, "Warning! OpenGL ES profile not 
available.\n");
 
@@ -771,7 +771,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
                if (WGLEW_ARB_create_context_profile && profileBitCompat)
                        profileMask |= profileBitCompat;
 
-#if WITH_GLEW_ES
+#ifdef WITH_GLEW_ES
                if (WGLEW_EXT_create_context_es_profile && profileBitES)
                        profileMask |= profileBitES;
 #endif
diff --git a/intern/glew-mx/glew-mx.h b/intern/glew-mx/glew-mx.h
index 5af9773..513b441 100644
--- a/intern/glew-mx/glew-mx.h
+++ b/intern/glew-mx/glew-mx.h
@@ -33,13 +33,13 @@
 #ifndef __GLEW_MX_H__
 #define __GLEW_MX_H__
 
-#if GLEW_MX
+#ifdef GLEW_MX
 #define glewGetContext() _mxContext
 #endif
 
 #include <GL/glew.h>
 
-#if GLEW_MX
+#ifdef GLEW_MX
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/intern/glew-mx/intern/glew-mx.c b/intern/glew-mx/intern/glew-mx.c
index da9ef85..9e1b00d 100644
--- a/intern/glew-mx/intern/glew-mx.c
+++ b/intern/glew-mx/intern/glew-mx.c
@@ -27,10 +27,11 @@
 
 /** \file glew-mx.c
  *  \ingroup glew-mx
+ *
  * GLEW Context Management
  */
 
-#if GLEW_MX
+#ifdef GLEW_MX
 
 #include "glew-mx.h"
 
@@ -38,21 +39,21 @@
 #include <stdlib.h>
 #include <string.h>
 
-GLEWContext* _mxContext = NULL;
+GLEWContext *_mxContext = NULL;
 
-GLEWContext* mxGetContext(void)
+GLEWContext *mxGetContext(void)
 {
        return _mxContext;
 }
 
-void mxSetContext(GLEWContext* ctx)
+void mxSetContext(GLEWContext *ctx)
 {
        _mxContext = ctx;
 }
 
-GLEWContext* mxCreateContext(void)
+GLEWContext *mxCreateContext(void)
 {
-       GLEWContext* ctx = malloc(sizeof(GLEWContext));
+       GLEWContext *ctx = malloc(sizeof(GLEWContext));
 
        if (ctx != NULL)
                memset(ctx, 0, sizeof(GLEWContext));
@@ -60,7 +61,7 @@ GLEWContext* mxCreateContext(void)
        return ctx;
 }
 
-void mxDestroyContext(GLEWContext* ctx)
+void mxDestroyContext(GLEWContext *ctx)
 {
        if (_mxContext == ctx)
                _mxContext = NULL;
diff --git a/source/blender/windowmanager/intern/wm_window.c 
b/source/blender/windowmanager/intern/wm_window.c
index a89374e..7e650bf 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -434,7 +434,7 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
                wm_init_state.start_x = 0;
                wm_init_state.start_y = 0;
 
-#if WITH_X11 /* X11 */
+#ifdef WITH_X11 /* X11 */
                /* X11, start maximized but use default sane size */
                wm_init_state.size_x = min_ii(wm_init_state.size_x, 
WM_WIN_INIT_SIZE_X);
                wm_init_state.size_y = min_ii(wm_init_state.size_y, 
WM_WIN_INIT_SIZE_Y);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to