[Bf-blender-cvs] [64f9559] soc-2014-viewport_context: Cleanup: line-length and header guards
Campbell Barton
noreply at git.blender.org
Thu Jul 24 14:37:41 CEST 2014
Commit: 64f9559115e1e877bcb985b5c927dd749f4fb4ff
Author: Campbell Barton
Date: Thu Jul 24 22:36:42 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rB64f9559115e1e877bcb985b5c927dd749f4fb4ff
Cleanup: line-length and header guards
===================================================================
M intern/ghost/intern/GHOST_Context.cpp
M intern/ghost/intern/GHOST_Context.h
M intern/ghost/intern/GHOST_ContextCGL.h
M intern/ghost/intern/GHOST_ContextCGL.mm
M intern/ghost/intern/GHOST_ContextEGL.cpp
M intern/ghost/intern/GHOST_ContextEGL.h
M intern/ghost/intern/GHOST_ContextGLX.cpp
M intern/ghost/intern/GHOST_ContextGLX.h
M intern/ghost/intern/GHOST_ContextNone.h
M intern/ghost/intern/GHOST_ContextWGL.cpp
M intern/ghost/intern/GHOST_ContextWGL.h
===================================================================
diff --git a/intern/ghost/intern/GHOST_Context.cpp b/intern/ghost/intern/GHOST_Context.cpp
index d5c6f2c..5cfaadf 100644
--- a/intern/ghost/intern/GHOST_Context.cpp
+++ b/intern/ghost/intern/GHOST_Context.cpp
@@ -147,7 +147,9 @@ bool win32_chk(bool result, const char *file, int line, const char *text)
break;
case ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB:
- 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";
+ 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;
#ifdef WITH_GLEW_ES
@@ -161,7 +163,8 @@ bool win32_chk(bool result, const char *file, int line, const char *text)
#endif
case ERROR_PROFILE_DOES_NOT_MATCH_DEVICE:
- msg = "The specified profile is intended for a device of a different type than the specified device.\n";
+ msg = ("The specified profile is intended for a device of a "
+ "different type than the specified device.\n");
break;
default:
diff --git a/intern/ghost/intern/GHOST_Context.h b/intern/ghost/intern/GHOST_Context.h
index a81720b..511dfa1 100644
--- a/intern/ghost/intern/GHOST_Context.h
+++ b/intern/ghost/intern/GHOST_Context.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_Context class.
*/
-#ifndef _GHOST_CONTEXT_H_
-#define _GHOST_CONTEXT_H_
+#ifndef __GHOST_CONTEXT_H__
+#define __GHOST_CONTEXT_H__
#include "GHOST_Types.h"
@@ -168,10 +168,6 @@ bool win32_chk(bool result, const char *file = NULL, int line = 0, const char *t
#endif
-
-
#define _CASE_CODE_RETURN_STR(code) case code: return #code;
-
-
-#endif // _GHOST_CONTEXT_H_
+#endif // __GHOST_CONTEXT_H__
diff --git a/intern/ghost/intern/GHOST_ContextCGL.h b/intern/ghost/intern/GHOST_ContextCGL.h
index d6e820a..f08b4cd 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.h
+++ b/intern/ghost/intern/GHOST_ContextCGL.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_ContextCGL class.
*/
-#ifndef _GHOST_CONTEXTCGL_H_
-#define _GHOST_CONTEXTCGL_H_
+#ifndef __GHOST_CONTEXTCGL_H__
+#define __GHOST_CONTEXTCGL_H__
#include "GHOST_Context.h"
@@ -100,7 +100,8 @@ public:
/**
* Removes references to native handles from this context and then returns
- * \return GHOST_kSuccess if it is OK for the parent to release the handles and GHOST_kFailure if releasing the handles will interfere with sharing
+ * \return GHOST_kSuccess if it is OK for the parent to release the handles and
+ * GHOST_kFailure if releasing the handles will interfere with sharing
*/
virtual GHOST_TSuccess releaseNativeHandles();
@@ -155,6 +156,4 @@ private:
static int s_sharedCount;
};
-
-
-#endif // _GHOST_CONTEXTCGL_H_
+#endif // __GHOST_CONTEXTCGL_H__
diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm
index 8d6075e..491d7a9 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -196,7 +196,9 @@ static void makeAttribList(
attribs.push_back(NSOpenGLPFABackingStore);
// Force software OpenGL, for debugging
- if (getenv("BLENDER_SOFTWAREGL")) { // XXX jwilkins: fixed this to work on Intel macs? useful feature for Windows and Linux too? Maybe a command line flag is better...
+ /* XXX jwilkins: fixed this to work on Intel macs? useful feature for Windows and Linux too?
+ * Maybe a command line flag is better... */
+ if (getenv("BLENDER_SOFTWAREGL")) {
attribs.push_back(NSOpenGLPFARendererID);
#if defined(__ppc__) || defined(__ppc64__)
attribs.push_back(kCGLRendererAppleSWID);
@@ -208,7 +210,8 @@ static void makeAttribList(
attribs.push_back(NSOpenGLPFAAccelerated);
}
- //attribs.push_back(NSOpenGLPFAAllowOfflineRenderers); // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
+ /* Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway */
+ //attribs.push_back(NSOpenGLPFAAllowOfflineRenderers);
attribs.push_back(NSOpenGLPFADepthSize);
attribs.push_back((NSOpenGLPixelFormatAttribute) 32);
@@ -351,7 +354,8 @@ error:
GHOST_TSuccess GHOST_ContextCGL::releaseNativeHandles()
{
- GHOST_TSuccess success = m_openGLContext != s_sharedOpenGLContext || s_sharedCount == 1 ? GHOST_kSuccess : GHOST_kFailure;
+ GHOST_TSuccess success = ((m_openGLContext != s_sharedOpenGLContext) ||
+ (s_sharedCount == 1 ? GHOST_kSuccess : GHOST_kFailure));
m_openGLContext = NULL;
m_openGLView = NULL;
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index ec51790..af1405a 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -45,7 +45,7 @@ EGLEWContext *eglewContext = NULL;
static const char *get_egl_error_enum_string(EGLenum error)
{
- switch(error) {
+ switch (error) {
_CASE_CODE_RETURN_STR(EGL_SUCCESS)
_CASE_CODE_RETURN_STR(EGL_NOT_INITIALIZED)
_CASE_CODE_RETURN_STR(EGL_BAD_ACCESS)
@@ -68,7 +68,7 @@ static const char *get_egl_error_enum_string(EGLenum error)
static const char *get_egl_error_message_string(EGLenum error)
{
- switch(error) {
+ switch (error) {
case EGL_SUCCESS:
return "The last function succeeded without error.";
@@ -193,7 +193,7 @@ EGLint GHOST_ContextEGL::s_vg_sharedCount = 0;
template <typename T>
T &choose_api(EGLenum api, T &a, T &b, T &c)
{
- switch(api) {
+ switch (api) {
case EGL_OPENGL_API:
return a;
case EGL_OPENGL_ES_API:
diff --git a/intern/ghost/intern/GHOST_ContextEGL.h b/intern/ghost/intern/GHOST_ContextEGL.h
index 62cdd49..968af15 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.h
+++ b/intern/ghost/intern/GHOST_ContextEGL.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_ContextEGL class.
*/
-#ifndef _GHOST_CONTEXTEGL_H_
-#define _GHOST_CONTEXTEGL_H_
+#ifndef __GHOST_CONTEXTEGL_H__
+#define __GHOST_CONTEXTEGL_H__
#include "GHOST_Context.h"
@@ -94,7 +94,8 @@ public:
/**
* Removes references to native handles from this context and then returns
- * \return GHOST_kSuccess if it is OK for the parent to release the handles and GHOST_kFailure if releasing the handles will interfere with sharing
+ * \return GHOST_kSuccess if it is OK for the parent to release the handles and
+ * GHOST_kFailure if releasing the handles will interfere with sharing
*/
virtual GHOST_TSuccess releaseNativeHandles();
@@ -158,4 +159,4 @@ private:
-#endif // _GHOST_CONTEXTEGL_H_
+#endif // __GHOST_CONTEXTEGL_H__
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 50e3146..f8ac809 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -156,7 +156,10 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
int glx_major, glx_minor; /* GLX version: major.minor */
if (!glXQueryVersion(m_display, &glx_major, &glx_minor)) {
- fprintf(stderr, "%s:%d: X11 glXQueryVersion() failed, verify working openGL system!\n", __FILE__, __LINE__);
+ fprintf(stderr,
+ "%s:%d: X11 glXQueryVersion() failed, "
+ "verify working openGL system!\n",
+ __FILE__, __LINE__);
/* exit if this is the first window */
if (s_sharedContext == NULL) {
@@ -181,7 +184,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
/* Find the display with highest samples, starting at level requested */
int actualSamples = m_numOfAASamples;
- for(;;) {
+ for (;;) {
attribs.clear();
if (m_stereoVisual)
@@ -230,18 +233,20 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
* but we need a valid visual to continue */
if (m_visualInfo != NULL) {
if (actualSamples < m_numOfAASamples) {
- fprintf(
- stderr,
- "Warning! Unable to find a multisample pixel format that supports exactly %d samples. Substituting one that uses %d samples.\n",
- m_numOfAASamples,
- actualSamples);
+ fprintf(stderr,
+ "Warning! Unable to find a multisample pixel format that supports exactly %d samples. "
+ "Substituting one that uses %d samples.\n",
+ m_numOfAASamples, actualSamples);
}
break;
}
if (actualSamples == 0) {
/* All options exhausted, cannot continue */
- fprintf(stderr, "%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
+ fprintf(stderr,
+ "%s:%d: X11 glXChooseVisual() failed, "
+ "verify working openGL system!\n",
+ __FILE__, __LINE__);
if (s_sharedContext == None) {
fprintf(stderr, "initial window could not find the GLX extension, exit!\n");
diff --git a/intern/ghost/intern/GHOST_ContextGLX.h b/intern/ghost/intern/GHOST_ContextGLX.h
index 4475a58..c1d4a50 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.h
+++ b/intern/ghost/intern/GHOST_ContextGLX.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_ContextGLX class.
*/
-#ifndef _GHOST_CONTEXTGLX_H_
-#define _GHOST_CONTEXTGLX_H_
+#ifndef __GHOST_CONTEXTGLX_H__
+#define __GHOST_CONTEXTGLX_H__
#include "GHOST_Context.h"
@@ -93,7 +93,8 @@ public:
/**
* Removes references to native handles from this context and then returns
- * \return GHOST_kSuccess if it is OK for the parent to release the handles and GHOST_kFailure if releasing the handles will interfere with sharing
+ * \return GHOST_kSuccess if it is OK for the parent to release the handles and
+ * GHOST_kFailure if releasing the handles will interfere with sharing
*/
virtual GHOST_TSuccess releaseNativeHandles();
@@ -139,6 +140,4 @@ private:
static int s_sharedCount;
};
-
-
-#endif // _GHOST_CONTEXTGLX_H_
+#endif // __GHOST_CONTEXTGLX_H__
diff --git a/intern/ghost/intern/GHOST_ContextNone.h b/intern/ghost/intern/GHOST_ContextNone.h
index d9f97d5..1d66c11 100644
--- a/intern/ghost/intern/GHOST_ContextNone.h
+++ b/intern/ghost/intern/GHOST_ContextNone.h
@@ -35,8 +35,6 @@
#include "GHOST_Context.h"
-
-
class GHOST_ContextNone : public GHOST_Context
{
public:
@@ -95,6 +93,4 @@ private:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list