diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-27 16:21:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-27 16:21:13 +0400 |
commit | 2ab62ce126651c600a8039de0dd95a4e3c02ea47 (patch) | |
tree | 7bd05d0ffa253332de7328d77e0d712fea6ae880 /intern | |
parent | aa6301674471500f74d3984d6d17d82ad5e8724f (diff) |
code cleanup: defines with braces - end with '(void)0' so callers must end with ';' like normal function.
... without this some editors dont parse the source so well.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_Debug.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.cpp | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.cpp | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 16 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCarbon.cpp | 26 |
5 files changed, 28 insertions, 30 deletions
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h index a6392fce9bf..c364f1d26a4 100644 --- a/intern/ghost/intern/GHOST_Debug.h +++ b/intern/ghost/intern/GHOST_Debug.h @@ -51,8 +51,8 @@ #ifdef GHOST_DEBUG -# define GHOST_PRINT(x) { std::cout << x; } -# define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); } +# define GHOST_PRINT(x) { std::cout << x; } (void)0 +# define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); } (void)0 #else // GHOST_DEBUG # define GHOST_PRINT(x) # define GHOST_PRINTF(x, ...) @@ -67,7 +67,7 @@ GHOST_PRINT(info); \ GHOST_PRINT("\n"); \ } \ - } + } (void)0 #else // GHOST_DEBUG # define GHOST_ASSERT(x, info) #endif // GHOST_DEBUG diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index ee21128ecbb..8c6491bcbfd 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -142,7 +142,7 @@ GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting& setting const bool stereoVisual, const GHOST_TUns16 numOfAASamples) { GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(m_windowManager, "GHOST_System::beginFullScreen(): invalid window manager") + GHOST_ASSERT(m_windowManager, "GHOST_System::beginFullScreen(): invalid window manager"); if (m_displayManager) { if (!m_windowManager->getFullScreen()) { m_displayManager->getCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, m_preFullScreenSetting); @@ -184,12 +184,12 @@ GHOST_TSuccess GHOST_System::updateFullScreen(const GHOST_DisplaySetting& settin GHOST_TSuccess GHOST_System::endFullScreen(void) { GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(m_windowManager, "GHOST_System::endFullScreen(): invalid window manager") + GHOST_ASSERT(m_windowManager, "GHOST_System::endFullScreen(): invalid window manager"); if (m_windowManager->getFullScreen()) { //GHOST_IWindow* window = m_windowManager->getFullScreenWindow(); //GHOST_PRINT("GHOST_System::endFullScreen(): leaving window manager full-screen mode\n"); success = m_windowManager->endFullScreen(); - GHOST_ASSERT(m_displayManager, "GHOST_System::endFullScreen(): invalid display manager") + GHOST_ASSERT(m_displayManager, "GHOST_System::endFullScreen(): invalid display manager"); //GHOST_PRINT("GHOST_System::endFullScreen(): leaving full-screen mode\n"); success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, m_preFullScreenSetting); } @@ -350,7 +350,7 @@ GHOST_TSuccess GHOST_System::exit() GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples) { GHOST_TSuccess success; - GHOST_ASSERT(m_displayManager, "GHOST_System::createFullScreenWindow(): invalid display manager") + GHOST_ASSERT(m_displayManager, "GHOST_System::createFullScreenWindow(): invalid display manager"); GHOST_DisplaySetting settings; success = m_displayManager->getCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, settings); diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index fc4ca8f8f61..ac580895c50 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -57,8 +57,6 @@ #include "GHOST_NDOFManager.h" #include "AssertMacros.h" -#define GHOST_KEY_SWITCH(mac, ghost) { case (mac): ghostKey = (ghost); break; } - /* blender class and types events */ enum { kEventClassBlender = 'blnd' diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 7a65c741532..9e9bbc0e395 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -389,11 +389,11 @@ GHOST_TSuccess GHOST_SystemWin32::init() // Determine whether this system has a high frequency performance counter. */ m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER *)&m_freq) == TRUE; if (m_hasPerformanceCounter) { - GHOST_PRINT("GHOST_SystemWin32::init: High Frequency Performance Timer available\n") + GHOST_PRINT("GHOST_SystemWin32::init: High Frequency Performance Timer available\n"); ::QueryPerformanceCounter((LARGE_INTEGER *)&m_start); } else { - GHOST_PRINT("GHOST_SystemWin32::init: High Frequency Performance Timer not available\n") + GHOST_PRINT("GHOST_SystemWin32::init: High Frequency Performance Timer not available\n"); } if (success) { @@ -885,7 +885,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LRESULT lResult = 0; GHOST_SystemWin32 *system = ((GHOST_SystemWin32 *)getSystem()); - GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized") + GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized"); if (hwnd) { GHOST_WindowWin32 *window = (GHOST_WindowWin32 *)::GetWindowLong(hwnd, GWL_USERDATA); @@ -917,9 +917,9 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, case RIM_TYPEKEYBOARD: event = processKeyEvent(window, raw); if (!event) { - GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ") - GHOST_PRINT(msg) - GHOST_PRINT(" key ignored\n") + GHOST_PRINT("GHOST_SystemWin32::wndProc: key event "); + GHOST_PRINT(msg); + GHOST_PRINT(" key ignored\n"); } break; #ifdef WITH_INPUT_NDOF @@ -1233,7 +1233,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, } else { // Event found for a window before the pointer to the class has been set. - GHOST_PRINT("GHOST_SystemWin32::wndProc: GHOST window event before creation\n") + GHOST_PRINT("GHOST_SystemWin32::wndProc: GHOST window event before creation\n"); /* These are events we typically miss at this point: WM_GETMINMAXINFO 0x24 WM_NCCREATE 0x81 @@ -1245,7 +1245,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, } else { // Events without valid hwnd - GHOST_PRINT("GHOST_SystemWin32::wndProc: event without window\n") + GHOST_PRINT("GHOST_SystemWin32::wndProc: event without window\n"); } if (event) { diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 16e3cb49652..d67b02fce6b 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -221,7 +221,7 @@ bool GHOST_WindowCarbon::getValid() const void GHOST_WindowCarbon::setTitle(const STR_String& title) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setTitle(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setTitle(): window invalid"); Str255 title255; gen2mac(title, title255); ::SetWTitle(m_windowRef, title255); @@ -230,7 +230,7 @@ void GHOST_WindowCarbon::setTitle(const STR_String& title) void GHOST_WindowCarbon::getTitle(STR_String& title) const { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getTitle(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getTitle(): window invalid"); Str255 title255; ::GetWTitle(m_windowRef, title255); mac2gen(title255, title); @@ -241,7 +241,7 @@ void GHOST_WindowCarbon::getWindowBounds(GHOST_Rect& bounds) const { OSStatus success; Rect rect; - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getWindowBounds(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getWindowBounds(): window invalid"); success = ::GetWindowBounds(m_windowRef, kWindowStructureRgn, &rect); bounds.m_b = rect.bottom; bounds.m_l = rect.left; @@ -253,7 +253,7 @@ void GHOST_WindowCarbon::getWindowBounds(GHOST_Rect& bounds) const void GHOST_WindowCarbon::getClientBounds(GHOST_Rect& bounds) const { Rect rect; - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getClientBounds(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getClientBounds(): window invalid"); //::GetPortBounds(m_grafPtr, &rect); ::GetWindowBounds(m_windowRef, kWindowContentRgn, &rect); @@ -277,7 +277,7 @@ void GHOST_WindowCarbon::getClientBounds(GHOST_Rect& bounds) const GHOST_TSuccess GHOST_WindowCarbon::setClientWidth(GHOST_TUns32 width) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientWidth(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientWidth(): window invalid"); GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); if (((GHOST_TUns32)cBnds.getWidth()) != width) { @@ -289,7 +289,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowCarbon::setClientHeight(GHOST_TUns32 height) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientHeight(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientHeight(): window invalid"); GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); #ifdef GHOST_DRAW_CARBON_GUTTER @@ -307,7 +307,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowCarbon::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientSize(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setClientSize(): window invalid"); GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); #ifdef GHOST_DRAW_CARBON_GUTTER @@ -328,7 +328,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setClientSize(GHOST_TUns32 width, GHOST_TUns3 GHOST_TWindowState GHOST_WindowCarbon::getState() const { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getState(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getState(): window invalid"); GHOST_TWindowState state; if (::IsWindowVisible(m_windowRef) == false) { state = GHOST_kWindowStateMinimized; @@ -345,7 +345,7 @@ GHOST_TWindowState GHOST_WindowCarbon::getState() const void GHOST_WindowCarbon::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::screenToClient(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::screenToClient(): window invalid"); Point point; point.h = inX; point.v = inY; @@ -361,7 +361,7 @@ void GHOST_WindowCarbon::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOS void GHOST_WindowCarbon::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::clientToScreen(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::clientToScreen(): window invalid"); Point point; point.h = inX; point.v = inY; @@ -377,7 +377,7 @@ void GHOST_WindowCarbon::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOS GHOST_TSuccess GHOST_WindowCarbon::setState(GHOST_TWindowState state) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setState(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setState(): window invalid"); switch (state) { case GHOST_kWindowStateMinimized: ::HideWindow(m_windowRef); @@ -400,7 +400,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setState(GHOST_TWindowState state) GHOST_TSuccess GHOST_WindowCarbon::setOrder(GHOST_TWindowOrder order) { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setOrder(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::setOrder(): window invalid"); if (order == GHOST_kWindowOrderTop) { //::BringToFront(m_windowRef); is wrong, front window should be active for input too ::SelectWindow(m_windowRef); @@ -555,7 +555,7 @@ GHOST_TSuccess GHOST_WindowCarbon::removeDrawingContext() GHOST_TSuccess GHOST_WindowCarbon::invalidate() { - GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::invalidate(): window invalid") + GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::invalidate(): window invalid"); if (!m_fullScreen) { Rect rect; ::GetPortBounds(m_grafPtr, &rect); |