Browse Source

Minor layout clean-ups.

tags/2021-05-28
jules 10 years ago
parent
commit
05c68c28f3
2 changed files with 10 additions and 9 deletions
  1. +9
    -8
      modules/juce_events/native/juce_win32_Messaging.cpp
  2. +1
    -1
      modules/juce_events/timers/juce_Timer.cpp

+ 9
- 8
modules/juce_events/native/juce_win32_Messaging.cpp View File

@@ -38,7 +38,7 @@ namespace WindowsMessageHelpers
void dispatchMessageFromLParam (LPARAM lParam) void dispatchMessageFromLParam (LPARAM lParam)
{ {
MessageManager::MessageBase* const message = reinterpret_cast <MessageManager::MessageBase*> (lParam);
MessageManager::MessageBase* const message = reinterpret_cast<MessageManager::MessageBase*> (lParam);
JUCE_TRY JUCE_TRY
{ {
@@ -61,15 +61,17 @@ namespace WindowsMessageHelpers
dispatchMessageFromLParam (lParam); dispatchMessageFromLParam (lParam);
return 0; return 0;
} }
else if (message == broadcastId)
if (message == broadcastId)
{ {
const ScopedPointer<String> messageString ((String*) lParam); const ScopedPointer<String> messageString ((String*) lParam);
MessageManager::getInstance()->deliverBroadcastMessage (*messageString); MessageManager::getInstance()->deliverBroadcastMessage (*messageString);
return 0; return 0;
} }
else if (message == WM_COPYDATA)
if (message == WM_COPYDATA)
{ {
const COPYDATASTRUCT* const data = reinterpret_cast <const COPYDATASTRUCT*> (lParam);
const COPYDATASTRUCT* const data = reinterpret_cast<const COPYDATASTRUCT*> (lParam);
if (data->dwData == broadcastId) if (data->dwData == broadcastId)
{ {
@@ -88,7 +90,7 @@ namespace WindowsMessageHelpers
BOOL CALLBACK broadcastEnumWindowProc (HWND hwnd, LPARAM lParam) BOOL CALLBACK broadcastEnumWindowProc (HWND hwnd, LPARAM lParam)
{ {
if (hwnd != juce_messageWindowHandle) if (hwnd != juce_messageWindowHandle)
reinterpret_cast <Array<HWND>*> (lParam)->add (hwnd);
reinterpret_cast<Array<HWND>*> (lParam)->add (hwnd);
return TRUE; return TRUE;
} }
@@ -157,9 +159,8 @@ void MessageManager::broadcastMessage (const String& value)
{ {
HWND hwnd = windows.getUnchecked(i); HWND hwnd = windows.getUnchecked(i);
TCHAR windowName [64]; // no need to read longer strings than this
GetWindowText (hwnd, windowName, 64);
windowName [63] = 0;
TCHAR windowName[64] = { 0 }; // no need to read longer strings than this
GetWindowText (hwnd, windowName, 63);
if (String (windowName) == WindowsMessageHelpers::messageWindowName) if (String (windowName) == WindowsMessageHelpers::messageWindowName)
{ {


+ 1
- 1
modules/juce_events/timers/juce_Timer.cpp View File

@@ -186,7 +186,7 @@ public:
private: private:
Timer* volatile firstTimer; Timer* volatile firstTimer;
Atomic <int> callbackNeeded;
Atomic<int> callbackNeeded;
struct CallTimersMessage : public MessageManager::MessageBase struct CallTimersMessage : public MessageManager::MessageBase
{ {


Loading…
Cancel
Save