diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-06 05:31:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-06 05:31:15 +0400 |
commit | 5d2e4bb87e6d3db0a7978dd3bd3ec573a52c4ae9 (patch) | |
tree | 3f5fe8fac4f5efcab43eadd5f2bcb46f30ec7f96 /source/gameengine | |
parent | 5c52455fba091eb69e59e6f2dba4411d4791074d (diff) |
code cleanup: capitalize defines.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 10 | ||||
-rw-r--r-- | source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 5347aaafc65..a35cb4f9f69 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -262,7 +262,7 @@ PyMethodDef PyObjectPlus::Methods[] = { {NULL, NULL} /* Sentinel */ }; -#define attr_invalid (&(PyObjectPlus::Attributes[0])) +#define BGE_PY_ATTR_INVALID (&(PyObjectPlus::Attributes[0])) PyAttributeDef PyObjectPlus::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("invalid", PyObjectPlus, pyattr_get_invalid), {NULL} //Sentinel @@ -281,7 +281,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * PyObjectPlus *ref= (BGE_PROXY_REF(self_py)); char* ptr = (attrdef->m_usePtr) ? (char*)BGE_PROXY_PTR(self_py) : (char*)ref; if (ptr == NULL || (BGE_PROXY_PYREF(self_py) && (ref==NULL || !ref->py_is_valid()))) { - if (attrdef == attr_invalid) + if (attrdef == BGE_PY_ATTR_INVALID) Py_RETURN_TRUE; // don't bother running the function PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index ea4ac1e150b..48fa3257d20 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -81,7 +81,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) return NULL; #else /* WITH_SDL */ if (joyindex < 0 || joyindex >= JOYINDEX_MAX) { - echo("Error-invalid joystick index: " << joyindex); + ECHO("Error-invalid joystick index: " << joyindex); return NULL; } @@ -96,7 +96,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) # else if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ) { # endif - echo("Error-Initializing-SDL: " << SDL_GetError()); + ECHO("Error-Initializing-SDL: " << SDL_GetError()); return NULL; } @@ -242,7 +242,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) if (m_isinit == false) { if (m_joyindex>=m_joynum) { // don't print a message, because this is done anyway - //echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); + //ECHO("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); // Need this so python args can return empty lists m_axismax = m_buttonmax = m_hatmax = 0; @@ -253,7 +253,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) SDL_JoystickEventState(SDL_ENABLE); m_isinit = true; - echo("Joystick " << m_joyindex << " initialized"); + ECHO("Joystick " << m_joyindex << " initialized"); /* must run after being initialized */ m_axismax = SDL_JoystickNumAxes(m_private->m_joystick); @@ -279,7 +279,7 @@ void SCA_Joystick::DestroyJoystickDevice(void) #ifdef WITH_SDL if (m_isinit) { if (SDL_JoystickOpened(m_joyindex)) { - echo("Closing-joystick " << m_joyindex); + ECHO("Closing-joystick " << m_joyindex); SDL_JoystickClose(m_private->m_joystick); } m_isinit = false; diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h index 45766eb9057..148bdd0962e 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h @@ -37,10 +37,10 @@ #endif #ifndef _DEBUG -#define echo(x) +# define ECHO(x) #else -#include <iostream> -#define echo(x) std::cout << x << std::endl; +# include <iostream> +# define ECHO(x) std::cout << x << std::endl; #endif #define JOYINDEX_MAX 8 |