fixed: warnings on mac os x

This commit is contained in:
Nick Bolton 2014-02-25 15:03:43 +00:00
parent bdb4c47898
commit c44971b43d
42 changed files with 271 additions and 191 deletions

View File

@ -67,6 +67,11 @@ set(libs)
# Depending on the platform, pass in the required defines.
if (UNIX)
# warnings as errors:
# we have a problem with people checking in code with warnings.
set(CMAKE_CXX_FLAGS "-Werror")
# For config.h, detect the libraries, functions, etc.
include(CheckIncludeFiles)
include(CheckLibraryExists)

View File

@ -131,19 +131,15 @@
// math functions we define __FP__, the include guard macro for fp.h, to
// prevent fp.h from being included.
#if defined(__APPLE__)
#define __FP__
# define __FP__
#endif
// define NULL
#include <stddef.h>
// we don't want to use NULL since it's old and nasty, so replace any
// usages with nullptr (warning: this could break many things).
// if not c++0x yet, future proof code by allowing use of nullptr
#ifdef nullptr
#define NULL nullptr
#else
#define nullptr NULL
// if not c++0x, future proof code by allowing use of nullptr
#ifndef nullptr
# define nullptr NULL
#endif
// make assert available since we use it a lot

View File

@ -60,18 +60,10 @@ CCryptoMode::~CCryptoMode()
}
if (m_encryption) {
switch (m_mode) {
case kCfb:
delete reinterpret_cast<CCfbModeEnc*>(m_crypto);
break;
}
delete reinterpret_cast<CCfbModeEnc*>(m_crypto);
}
else {
switch (m_mode) {
case kCfb:
delete reinterpret_cast<CCfbModeDec*>(m_crypto);
break;
}
delete reinterpret_cast<CCfbModeDec*>(m_crypto);
}
}
@ -83,18 +75,10 @@ CCryptoMode::processData(byte* out, const byte* in, size_t length)
}
if (m_encryption) {
switch (m_mode) {
case kCfb:
reinterpret_cast<CCfbModeEnc*>(m_crypto)->ProcessData(out, in, length);
break;
}
reinterpret_cast<CCfbModeEnc*>(m_crypto)->ProcessData(out, in, length);
}
else {
switch (m_mode) {
case kCfb:
reinterpret_cast<CCfbModeDec*>(m_crypto)->ProcessData(out, in, length);
break;
}
reinterpret_cast<CCfbModeDec*>(m_crypto)->ProcessData(out, in, length);
}
}
@ -107,17 +91,9 @@ CCryptoMode::setKeyWithIv(const byte* key, size_t length, const byte* iv)
}
if (m_encryption) {
switch (m_mode) {
case kCfb:
reinterpret_cast<CCfbModeEnc*>(m_crypto)->SetKeyWithIV(key, length, iv);
break;
}
reinterpret_cast<CCfbModeEnc*>(m_crypto)->SetKeyWithIV(key, length, iv);
}
else {
switch (m_mode) {
case kCfb:
reinterpret_cast<CCfbModeDec*>(m_crypto)->SetKeyWithIV(key, length, iv);
break;
}
reinterpret_cast<CCfbModeDec*>(m_crypto)->SetKeyWithIV(key, length, iv);
}
}

View File

@ -17,11 +17,17 @@
#pragma once
#include "ECryptoMode.h"
#include "CString.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtautological-compare"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-function"
#include <cryptopp562/gcm.h>
#include <cryptopp562/modes.h>
#include <cryptopp562/aes.h>
#include "ECryptoMode.h"
#include "CString.h"
#pragma GCC diagnostic pop
//! Encapsulation of modes
/*!

View File

@ -21,8 +21,8 @@
CCryptoOptions::CCryptoOptions(
const CString& modeString,
const CString& pass) :
m_mode(parseMode(modeString)),
m_pass(pass)
m_pass(pass),
m_mode(parseMode(modeString))
{
}

View File

@ -20,9 +20,14 @@
#include "BasicTypes.h"
#include "CStreamFilter.h"
#include "CCryptoMode.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#include <cryptopp562/osrng.h>
#include <cryptopp562/sha.h>
#pragma GCC diagnostic pop
class CCryptoOptions;
#define CRYPTO_IV_SIZE CryptoPP::AES::BLOCKSIZE

View File

@ -25,10 +25,9 @@
//
CStreamFilter::CStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
IStream(events),
m_events(events),
m_stream(stream),
m_adopted(adoptStream)
m_adopted(adoptStream),
m_events(events)
{
// replace handlers for m_stream
m_events->removeHandlers(m_stream->getEventTarget());

View File

@ -34,7 +34,7 @@ Defines the interface for all streams.
*/
class IStream : public IInterface {
public:
IStream(IEventQueue* events) : m_events(events) { }
IStream() { }
//! @name manipulators
//@{
@ -116,9 +116,6 @@ public:
virtual UInt32 getSize() const = 0;
//@}
private:
IEventQueue* m_events;
};
}

View File

@ -28,8 +28,8 @@
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
m_serverAddress(CNetworkAddress(IPC_HOST, IPC_PORT)),
m_server(nullptr),
m_socket(events, socketMultiplexer),
m_server(nullptr),
m_events(events)
{
init();
@ -37,8 +37,8 @@ CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexe
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
m_serverAddress(CNetworkAddress(IPC_HOST, port)),
m_server(nullptr),
m_socket(events, socketMultiplexer),
m_server(nullptr),
m_events(events)
{
init();

View File

@ -32,17 +32,17 @@
//
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
m_events(events),
m_socket(events, socketMultiplexer),
m_address(CNetworkAddress(IPC_HOST, IPC_PORT))
m_address(CNetworkAddress(IPC_HOST, IPC_PORT)),
m_events(events)
{
init();
}
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
m_events(events),
m_socket(events, socketMultiplexer),
m_address(CNetworkAddress(IPC_HOST, port))
m_address(CNetworkAddress(IPC_HOST, port)),
m_events(events)
{
init();
}

View File

@ -29,8 +29,8 @@
//
CIpcServerProxy::CIpcServerProxy(synergy::IStream& stream, IEventQueue* events) :
m_events(events),
m_stream(stream)
m_stream(stream),
m_events(events)
{
m_events->adoptHandler(m_events->forIStream().inputReady(),
stream.getEventTarget(),

View File

@ -37,9 +37,9 @@
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
IDataSocket(events),
m_events(events),
m_mutex(),
m_flushed(&m_mutex, true),
m_events(events),
m_socketMultiplexer(socketMultiplexer)
{
try {
@ -54,10 +54,10 @@ CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexe
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, CArchSocket socket) :
IDataSocket(events),
m_events(events),
m_mutex(),
m_socket(socket),
m_flushed(&m_mutex, true),
m_events(events),
m_socketMultiplexer(socketMultiplexer)
{
assert(m_socket != NULL);

View File

@ -37,7 +37,7 @@ public:
CString m_what;
};
IDataSocket(IEventQueue* events) : IStream(events) { }
IDataSocket(IEventQueue* events) { }
//! @name manipulators
//@{

View File

@ -24,8 +24,8 @@
NSMutableString* m_dropTarget;
}
-(CFStringRef)getDropTarget;
-(void)clearDropTarget;
- (CFStringRef)getDropTarget;
- (void)clearDropTarget;
@end

View File

@ -21,6 +21,10 @@
@implementation COSXDragView
@dynamic draggingFormation;
@dynamic animatesToDestination;
@dynamic numberOfValidItemsForDrop;
- (id)
initWithFrame:(NSRect)frame
{
@ -69,13 +73,13 @@ namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
return nil;
}
-(NSDragOperation)
- (NSDragOperation)
draggingSourceOperationMaskForLocal:(BOOL)flag
{
return NSDragOperationCopy;
}
-(CFStringRef)
- (CFStringRef)
getDropTarget
{
NSMutableString* string;
@ -84,12 +88,69 @@ getDropTarget
return (CFStringRef)string;
}
-(void)
- (void)
clearDropTarget
{
[m_dropTarget setString:@""];
}
- (NSWindow *)
draggingDestinationWindow
{
return nil;
}
- (NSDragOperation)
draggingSourceOperationMask
{
return NSDragOperationNone;
}
- (NSPoint)draggingLocation
{
NSPoint point;
return point;
}
- (NSPoint)draggedImageLocation
{
NSPoint point;
return point;
}
- (NSImage *)draggedImage
{
return nil;
}
- (NSPasteboard *)draggingPasteboard
{
return nil;
}
- (id)draggingSource
{
return nil;
}
- (NSInteger)draggingSequenceNumber
{
return nil;
}
- (void)slideDraggedImageTo:(NSPoint)screenPoint
{
}
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
{
return NSDragOperationNone;
}
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block
{
}
@end
#endif

View File

@ -31,8 +31,8 @@ class CEventQueueTimer { };
//
COSXEventQueueBuffer::COSXEventQueueBuffer(IEventQueue* events) :
m_eventQueue(events),
m_event(NULL),
m_eventQueue(events),
m_carbonEventQueue(NULL)
{
// do nothing

View File

@ -70,11 +70,10 @@ bool COSXScreen::s_hasGHOM = false;
COSXScreen::COSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCursor) :
CPlatformScreen(events),
m_events(events),
MouseButtonEventMap(NumButtonIDs),
m_isPrimary(isPrimary),
m_isOnScreen(m_isPrimary),
m_cursorPosValid(false),
MouseButtonEventMap(NumButtonIDs),
m_cursorHidden(false),
m_dragNumButtonsDown(0),
m_dragTimer(NULL),
@ -90,16 +89,17 @@ COSXScreen::COSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCur
m_pmMutex(new CMutex),
m_pmWatchThread(NULL),
m_pmThreadReady(new CCondVar<bool>(m_pmMutex, false)),
m_pmRootPort(0),
m_activeModifierHotKey(0),
m_activeModifierHotKeyMask(0),
m_eventTapPort(nullptr),
m_eventTapRLSR(nullptr),
m_lastSingleClick(0),
m_lastDoubleClick(0),
m_lastSingleClickXCursor(0),
m_lastSingleClickYCursor(0),
m_autoShowHideCursor(autoShowHideCursor),
m_eventTapRLSR(nullptr),
m_eventTapPort(nullptr),
m_pmRootPort(0),
m_events(events),
m_getDropTargetThread(NULL)
{
try {
@ -444,11 +444,12 @@ void
COSXScreen::constructMouseButtonEventMap()
{
const CGEventType source[NumButtonIDs][3] = {
kCGEventLeftMouseUp,kCGEventLeftMouseDragged,kCGEventLeftMouseDown,
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown,
kCGEventRightMouseUp,kCGEventRightMouseDragged,kCGEventRightMouseDown,
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown,
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown};
{kCGEventLeftMouseUp, kCGEventLeftMouseDragged, kCGEventLeftMouseDown},
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown},
{kCGEventRightMouseUp, kCGEventRightMouseDragged, kCGEventRightMouseDown},
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown},
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown}
};
for (UInt16 button = 0; button < NumButtonIDs; button++) {
MouseButtonEventMapType new_map;
@ -746,9 +747,15 @@ COSXScreen::showCursor()
// appears to fix "mouse randomly not showing" bug
CGAssociateMouseAndMouseCursorPosition(true);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// CGCursorIsVisible is probably deprecated because its unreliable.
if (!CGCursorIsVisible()) {
LOG((CLOG_WARN "cursor may not be visible"));
}
#pragma GCC diagnostic pop
m_cursorHidden = false;
}
@ -775,9 +782,15 @@ COSXScreen::hideCursor()
// appears to fix "mouse randomly not hiding" bug
CGAssociateMouseAndMouseCursorPosition(true);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// CGCursorIsVisible is probably deprecated because its unreliable.
if (CGCursorIsVisible()) {
LOG((CLOG_WARN "cursor may be still visible"));
}
#pragma GCC diagnostic pop
m_cursorHidden = true;
}
@ -871,7 +884,13 @@ COSXScreen::enter()
showCursor();
if (m_isPrimary) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
CGSetLocalEventsSuppressionInterval(0.0);
#pragma GCC diagnostic pop
// enable global hotkeys
//setGlobalHotKeysEnabled(true);
@ -891,6 +910,9 @@ COSXScreen::enter()
IOObjectRelease(entry);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// avoid suppression of local hardware events
// stkamp@users.sourceforge.net
CGSetLocalEventsFilterDuringSupressionState(
@ -900,6 +922,9 @@ COSXScreen::enter()
(kCGEventFilterMaskPermitLocalKeyboardEvents |
kCGEventFilterMaskPermitSystemDefinedEvents),
kCGEventSupressionStateRemoteMouseDrag);
#pragma GCC diagnostic pop
}
// now on screen
@ -941,6 +966,9 @@ COSXScreen::leave()
// warp to center
//warpCursor(m_xCenter, m_yCenter);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// This used to be necessary to get smooth mouse motion on other screens,
// but now is just to avoid a hesitating cursor when transitioning to
// the primary (this) screen.
@ -948,6 +976,9 @@ COSXScreen::leave()
// disable global hotkeys
//setGlobalHotKeysEnabled(false);
#pragma GCC diagnostic pop
}
else {
// warp the mouse to the cursor center

View File

@ -22,15 +22,22 @@
#import "IEventQueue.h"
#import "IPrimaryScreen.h"
#import <string.h>
#import <sys/sysctl.h>
void
getProcessSerialNumber(const char* name, ProcessSerialNumber& psn);
bool
testProcessName(const char* name, const ProcessSerialNumber& psn);
//
// COSXScreenSaver
//
COSXScreenSaver::COSXScreenSaver(IEventQueue* events, void* eventTarget) :
m_events(events),
m_eventTarget(eventTarget),
m_enabled(true)
m_enabled(true),
m_events(events)
{
m_autoReleasePool = screenSaverUtilCreatePool();
m_screenSaverController = screenSaverUtilCreateController();
@ -51,29 +58,9 @@ COSXScreenSaver::COSXScreenSaver(IEventQueue* events, void* eventTarget) :
m_screenSaverPSN.highLongOfPSN = 0;
m_screenSaverPSN.lowLongOfPSN = 0;
// test if screensaver is running and find process number
if (isActive()) {
ProcessInfoRec procInfo;
Str31 procName; // pascal string. first byte holds length.
memset(&procInfo, 0, sizeof(procInfo));
procInfo.processName = procName;
procInfo.processInfoLength = sizeof(ProcessInfoRec);
ProcessSerialNumber psn;
OSErr err = GetNextProcess(&psn);
while (err == 0) {
memset(procName, 0, sizeof(procName));
err = GetProcessInformation(&psn, &procInfo);
if (err != 0) {
break;
}
if (strcmp("ScreenSaverEngine", (const char*)&procName[1]) == 0) {
m_screenSaverPSN = psn;
break;
}
err = GetNextProcess(&psn);
}
getProcessSerialNumber("ScreenSaverEngine", m_screenSaverPSN);
}
}
@ -119,10 +106,7 @@ COSXScreenSaver::isActive() const
void
COSXScreenSaver::processLaunched(ProcessSerialNumber psn)
{
CFStringRef processName;
OSStatus err = CopyProcessName(&psn, &processName);
if (err == 0 && CFEqual(CFSTR("ScreenSaverEngine"), processName)) {
if (testProcessName("ScreenSaverEngine", psn)) {
m_screenSaverPSN = psn;
LOG((CLOG_DEBUG1 "ScreenSaverEngine launched. Enabled=%d", m_enabled));
if (m_enabled) {
@ -178,3 +162,41 @@ COSXScreenSaver::launchTerminationCallback(
}
return (CallNextEventHandler(nextHandler, theEvent));
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void
getProcessSerialNumber(const char* name, ProcessSerialNumber& psn)
{
ProcessInfoRec procInfo;
Str31 procName; // pascal string. first byte holds length.
memset(&procInfo, 0, sizeof(procInfo));
procInfo.processName = procName;
procInfo.processInfoLength = sizeof(ProcessInfoRec);
ProcessSerialNumber checkPsn;
OSErr err = GetNextProcess(&checkPsn);
while (err == 0) {
memset(procName, 0, sizeof(procName));
err = GetProcessInformation(&checkPsn, &procInfo);
if (err != 0) {
break;
}
if (strcmp(name, (const char*)&procName[1]) == 0) {
psn = checkPsn;
break;
}
err = GetNextProcess(&checkPsn);
}
}
bool
testProcessName(const char* name, const ProcessSerialNumber& psn)
{
CFStringRef processName;
OSStatus err = CopyProcessName(&psn, &processName);
return (err == 0 && CFEqual(CFSTR("ScreenSaverEngine"), processName));
}
#pragma GCC diagnostic pop

View File

@ -84,7 +84,6 @@ public:
virtual void screensaver(bool activate) = 0;
virtual void resetOptions() = 0;
virtual void setOptions(const COptionsList& options) = 0;
virtual void cryptoIv(const UInt8* iv) = 0;
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize) = 0;
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize) = 0;

View File

@ -358,13 +358,6 @@ CClientProxy1_0::mouseWheel(SInt32, SInt32 yDelta)
CProtocolUtil::writef(getStream(), kMsgDMouseWheel1_0, yDelta);
}
void
CClientProxy1_0::cryptoIv(const UInt8* iv)
{
// ignore -- not supported in protocol 1.0
LOG((CLOG_DEBUG "cryptoIv not supported"));
}
void
CClientProxy1_0::draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize)
{

View File

@ -59,7 +59,6 @@ public:
virtual void screensaver(bool activate);
virtual void resetOptions();
virtual void setOptions(const COptionsList& options);
virtual void cryptoIv(const UInt8* iv);
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize);
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize);

View File

@ -30,9 +30,9 @@
CClientProxy1_3::CClientProxy1_3(const CString& name, synergy::IStream* stream, IEventQueue* events) :
CClientProxy1_2(name, stream, events),
m_events(events),
m_keepAliveRate(kKeepAliveRate),
m_keepAliveTimer(NULL)
m_keepAliveTimer(NULL),
m_events(events)
{
setHeartbeatRate(kKeepAliveRate, kKeepAliveRate * kKeepAlivesUntilDeath);
}

View File

@ -39,11 +39,11 @@
//
CClientProxyUnknown::CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server, IEventQueue* events) :
m_events(events),
m_stream(stream),
m_proxy(NULL),
m_ready(false),
m_server(server)
m_server(server),
m_events(events)
{
assert(m_server != NULL);

View File

@ -31,9 +31,9 @@
//
CConfig::CConfig(IEventQueue* events) :
m_events(events),
m_inputFilter(events),
m_hasLockToScreenAction(false),
m_inputFilter(events)
m_events(events)
{
// do nothing
}

View File

@ -53,20 +53,20 @@ CInputFilter::CCondition::disablePrimary(CPrimaryClient*)
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
IEventQueue* events, IPlatformScreen::CKeyInfo* info) :
m_events(events),
m_id(0),
m_key(info->m_key),
m_mask(info->m_mask)
m_mask(info->m_mask),
m_events(events)
{
free(info);
}
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
IEventQueue* events, KeyID key, KeyModifierMask mask) :
m_events(events),
m_id(0),
m_key(key),
m_mask(mask)
m_mask(mask),
m_events(events)
{
// do nothing
}
@ -143,18 +143,18 @@ CInputFilter::CKeystrokeCondition::disablePrimary(CPrimaryClient* primary)
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
IEventQueue* events, IPlatformScreen::CButtonInfo* info) :
m_events(events),
m_button(info->m_button),
m_mask(info->m_mask)
m_mask(info->m_mask),
m_events(events)
{
free(info);
}
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
IEventQueue* events, ButtonID button, KeyModifierMask mask) :
m_events(events),
m_button(button),
m_mask(mask)
m_mask(mask),
m_events(events)
{
// do nothing
}
@ -227,8 +227,8 @@ CInputFilter::CMouseButtonCondition::match(const CEvent& event)
CInputFilter::CScreenConnectedCondition::CScreenConnectedCondition(
IEventQueue* events, const CString& screen) :
m_events(events),
m_screen(screen)
m_screen(screen),
m_events(events)
{
// do nothing
}
@ -279,8 +279,8 @@ CInputFilter::CAction::~CAction()
CInputFilter::CLockCursorToScreenAction::CLockCursorToScreenAction(
IEventQueue* events, Mode mode) :
m_events(events),
m_mode(mode)
m_mode(mode),
m_events(events)
{
// do nothing
}
@ -324,8 +324,8 @@ CInputFilter::CLockCursorToScreenAction::perform(const CEvent& event)
CInputFilter::CSwitchToScreenAction::CSwitchToScreenAction(
IEventQueue* events, const CString& screen) :
m_events(events),
m_screen(screen)
m_screen(screen),
m_events(events)
{
// do nothing
}
@ -370,8 +370,8 @@ CInputFilter::CSwitchToScreenAction::perform(const CEvent& event)
CInputFilter::CSwitchInDirectionAction::CSwitchInDirectionAction(
IEventQueue* events, EDirection direction) :
m_events(events),
m_direction(direction)
m_direction(direction),
m_events(events)
{
// do nothing
}
@ -414,8 +414,8 @@ CInputFilter::CSwitchInDirectionAction::perform(const CEvent& event)
CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(
IEventQueue* events, Mode mode) :
m_events(events),
m_mode(mode)
m_mode(mode),
m_events(events)
{
// do nothing
}
@ -424,9 +424,9 @@ CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(
IEventQueue* events,
Mode mode,
const std::set<CString>& screens) :
m_events(events),
m_mode(mode),
m_screens(IKeyState::CKeyInfo::join(screens))
m_screens(IKeyState::CKeyInfo::join(screens)),
m_events(events)
{
// do nothing
}
@ -486,9 +486,9 @@ CInputFilter::CKeyboardBroadcastAction::perform(const CEvent& event)
CInputFilter::CKeystrokeAction::CKeystrokeAction(
IEventQueue* events, IPlatformScreen::CKeyInfo* info, bool press) :
m_events(events),
m_keyInfo(info),
m_press(press)
m_press(press),
m_events(events)
{
// do nothing
}
@ -574,9 +574,9 @@ CInputFilter::CKeystrokeAction::formatName() const
CInputFilter::CMouseButtonAction::CMouseButtonAction(
IEventQueue* events, IPlatformScreen::CButtonInfo* info, bool press) :
m_events(events),
m_buttonInfo(info),
m_press(press)
m_press(press),
m_events(events)
{
// do nothing
}
@ -887,16 +887,16 @@ CInputFilter::CRule::getAction(bool onActivation, UInt32 index) const
// Input Filter Class
// -----------------------------------------------------------------------------
CInputFilter::CInputFilter(IEventQueue* events) :
m_events(events),
m_primaryClient(NULL)
m_primaryClient(NULL),
m_events(events)
{
// do nothing
}
CInputFilter::CInputFilter(const CInputFilter& x) :
m_events(x.m_events),
m_ruleList(x.m_ruleList),
m_primaryClient(NULL)
m_primaryClient(NULL),
m_events(x.m_events)
{
setPrimaryClient(x.m_primaryClient);
}

View File

@ -28,8 +28,7 @@
CPrimaryClient::CPrimaryClient(const CString& name, CScreen* screen) :
CBaseClientProxy(name),
m_screen(screen),
m_fakeInputCount(0),
m_mock(false)
m_fakeInputCount(0)
{
// all clipboards are clean
for (UInt32 i = 0; i < kClipboardEnd; ++i) {

View File

@ -39,7 +39,7 @@ public:
~CPrimaryClient();
#ifdef TEST_ENV
CPrimaryClient() : CBaseClientProxy(""), m_mock(true) { }
CPrimaryClient() : CBaseClientProxy("") { }
#endif
//! @name manipulators
@ -151,7 +151,6 @@ private:
CScreen* m_screen;
bool m_clipboardDirty[kClipboardEnd];
SInt32 m_fakeInputCount;
bool m_mock;
};
#endif

View File

@ -48,7 +48,6 @@
//
CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen, IEventQueue* events, bool enableDragDrop) :
m_events(events),
m_mock(false),
m_primaryClient(primaryClient),
m_active(primaryClient),
@ -75,6 +74,7 @@ CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen
m_keyboardBroadcasting(false),
m_lockedToScreen(false),
m_screen(screen),
m_events(events),
m_sendFileThread(NULL),
m_writeToDropDirThread(NULL),
m_ignoreFileTransfer(false),
@ -190,7 +190,6 @@ CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen
m_inputFilter->setPrimaryClient(m_primaryClient);
// Determine if scroll lock is already set. If so, lock the cursor to the primary screen
int keyValue = m_primaryClient->getToggleMask();
if (m_primaryClient->getToggleMask() & KeyModifierScrollLock) {
LOG((CLOG_DEBUG "scroll lock on initially. locked to screen"));
m_lockedToScreen = true;

View File

@ -52,14 +52,14 @@
CApp* CApp::s_instance = nullptr;
CApp::CApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, CArgsBase* args) :
m_events(events),
m_createTaskBarReceiver(createTaskBarReceiver),
m_args(args),
m_bye(&exit),
m_taskBarReceiver(NULL),
m_suspended(false),
m_ipcClient(nullptr),
m_appUtil(events)
m_events(events),
m_args(args),
m_createTaskBarReceiver(createTaskBarReceiver),
m_appUtil(events),
m_ipcClient(nullptr)
{
assert(s_instance == nullptr);
s_instance = this;
@ -289,7 +289,12 @@ CApp::run(int argc, char** argv)
#if MAC_OS_X_VERSION_10_7
// dock hide only supported on lion :(
ProcessSerialNumber psn = { 0, kCurrentProcess };
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
GetCurrentProcess(&psn);
#pragma GCC diagnostic pop
TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
#endif

View File

@ -33,11 +33,11 @@ m_disableXInitThreads(false),
m_backend(false),
m_restartable(true),
m_noHooks(false),
m_disableTray(false),
m_pname(NULL),
m_logFilter(NULL),
m_logFile(NULL),
m_display(NULL),
m_disableTray(false),
m_enableIpc(false),
m_enableDragDrop(false)
{

View File

@ -29,8 +29,8 @@
//
CClientTaskBarReceiver::CClientTaskBarReceiver(IEventQueue* events) :
m_events(events),
m_state(kNotRunning)
m_state(kNotRunning),
m_events(events)
{
// do nothing
}

View File

@ -78,12 +78,12 @@ winMainLoopStatic(int, const char**)
#endif
CDaemonApp::CDaemonApp() :
m_events(nullptr),
m_ipcServer(nullptr),
m_ipcLogOutputter(nullptr)
m_ipcLogOutputter(nullptr),
#if SYSAPI_WIN32
,m_watchdog(nullptr)
m_watchdog(nullptr),
#endif
m_events(nullptr)
{
s_instance = this;
}

View File

@ -33,7 +33,7 @@ This class provides a keyboard mapping.
class CKeyMap {
public:
CKeyMap();
~CKeyMap();
virtual ~CKeyMap();
//! KeyID synthesis info
/*!

View File

@ -384,20 +384,20 @@ static const KeyID s_numpadTable[] = {
CKeyState::CKeyState(IEventQueue* events) :
IKeyState(events),
m_events(events),
m_mask(0),
m_keyMapPtr(new CKeyMap()),
m_keyMap(*m_keyMapPtr)
m_keyMap(*m_keyMapPtr),
m_mask(0),
m_events(events)
{
init();
}
CKeyState::CKeyState(IEventQueue* events, CKeyMap& keyMap) :
IKeyState(events),
m_events(events),
m_mask(0),
m_keyMapPtr(0),
m_keyMap(keyMap)
m_keyMap(keyMap),
m_mask(0),
m_events(events)
{
init();
}

View File

@ -29,9 +29,9 @@
CPacketStreamFilter::CPacketStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
CStreamFilter(events, stream, adoptStream),
m_events(events),
m_size(0),
m_inputShutdown(false)
m_inputShutdown(false),
m_events(events)
{
// do nothing
}

View File

@ -28,8 +28,8 @@
//
CPortableTaskBarReceiver::CPortableTaskBarReceiver(IEventQueue* events) :
m_events(events),
m_state(kNotRunning)
m_state(kNotRunning),
m_events(events)
{
// do nothing
}

View File

@ -29,13 +29,13 @@
//
CScreen::CScreen(IPlatformScreen* platformScreen, IEventQueue* events) :
m_events(events),
m_screen(platformScreen),
m_isPrimary(platformScreen->isPrimary()),
m_enabled(false),
m_entered(m_isPrimary),
m_screenSaverSync(true),
m_fakeInput(false),
m_events(events),
m_mock(false),
m_enableDragDrop(false)
{

View File

@ -886,13 +886,6 @@ CServerApp::foregroundStartup(int argc, char** argv)
return mainLoop();
}
static
int
mainLoopStatic()
{
return CServerApp::instance().mainLoop();
}
const char*
CServerApp::daemonName() const
{

View File

@ -29,8 +29,8 @@
//
CServerTaskBarReceiver::CServerTaskBarReceiver(IEventQueue* events) :
m_events(events),
m_state(kNotRunning)
m_state(kNotRunning),
m_events(events)
{
// do nothing
}

View File

@ -25,8 +25,7 @@
// IKeyState
//
IKeyState::IKeyState(IEventQueue* events) :
m_events(events)
IKeyState::IKeyState(IEventQueue* events)
{
}

View File

@ -165,9 +165,6 @@ public:
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0;
//@}
private:
IEventQueue* m_events;
};
#endif

View File

@ -26,7 +26,7 @@ class IEventQueue;
class CMockStream : public synergy::IStream
{
public:
CMockStream() : synergy::IStream(NULL) { }
CMockStream() { }
MOCK_METHOD0(close, void());
MOCK_METHOD2(read, UInt32(void*, UInt32));
MOCK_METHOD2(write, void(const void*, UInt32));