diff --git a/src/gui/src/Action.h b/src/gui/src/Action.h index 7cc0d16d8..0ccfcd654 100644 --- a/src/gui/src/Action.h +++ b/src/gui/src/Action.h @@ -165,6 +165,6 @@ private: static const char *m_LockCursorModeNames[]; }; -typedef QList ActionList; +using ActionList = QList; QTextStream &operator<<(QTextStream &outStream, const Action &action); diff --git a/src/gui/src/Hotkey.h b/src/gui/src/Hotkey.h index 7ffa216d7..96f9c8548 100644 --- a/src/gui/src/Hotkey.h +++ b/src/gui/src/Hotkey.h @@ -72,6 +72,6 @@ private: ActionList m_Actions; }; -typedef QList HotkeyList; +using HotkeyList = QList; QTextStream &operator<<(QTextStream &outStream, const Hotkey &hotkey); diff --git a/src/lib/arch/IArchMultithread.h b/src/lib/arch/IArchMultithread.h index 85b3f8ba0..c0fc54126 100644 --- a/src/lib/arch/IArchMultithread.h +++ b/src/lib/arch/IArchMultithread.h @@ -33,7 +33,7 @@ class ArchCondImpl; \brief Opaque condition variable type. An opaque type representing a condition variable. */ -typedef ArchCondImpl *ArchCond; +using ArchCond = ArchCondImpl *; /*! \class ArchMutexImpl @@ -47,7 +47,7 @@ class ArchMutexImpl; \brief Opaque mutex type. An opaque type representing a mutex. */ -typedef ArchMutexImpl *ArchMutex; +using ArchMutex = ArchMutexImpl *; /*! \class ArchThreadImpl @@ -61,7 +61,7 @@ class ArchThreadImpl; \brief Opaque thread type. An opaque type representing a thread. */ -typedef ArchThreadImpl *ArchThread; +using ArchThread = ArchThreadImpl *; //! Interface for architecture dependent multithreading /*! @@ -74,7 +74,7 @@ public: //! Type of thread entry point typedef void *(*ThreadFunc)(void *); //! Type of thread identifier - typedef unsigned int ThreadID; + using ThreadID = unsigned int; //! Types of signals /*! Not all platforms support all signals. Unsupported signals are diff --git a/src/lib/arch/IArchNetwork.h b/src/lib/arch/IArchNetwork.h index e7202b7ff..db57cf456 100644 --- a/src/lib/arch/IArchNetwork.h +++ b/src/lib/arch/IArchNetwork.h @@ -24,7 +24,7 @@ #include class ArchThreadImpl; -typedef ArchThreadImpl *ArchThread; +using ArchThread = ArchThreadImpl *; /*! \class ArchSocketImpl @@ -38,7 +38,7 @@ class ArchSocketImpl; \brief Opaque socket type. An opaque type representing a socket. */ -typedef ArchSocketImpl *ArchSocket; +using ArchSocket = ArchSocketImpl *; /*! \class ArchNetAddressImpl @@ -53,7 +53,7 @@ class ArchNetAddressImpl; \brief Opaque network address type. An opaque type representing a network address. */ -typedef ArchNetAddressImpl *ArchNetAddress; +using ArchNetAddress = ArchNetAddressImpl *; //! Interface for architecture dependent networking /*! diff --git a/src/lib/arch/IArchTaskBarReceiver.h b/src/lib/arch/IArchTaskBarReceiver.h index 2635378fa..903da8f5e 100644 --- a/src/lib/arch/IArchTaskBarReceiver.h +++ b/src/lib/arch/IArchTaskBarReceiver.h @@ -34,7 +34,7 @@ class IArchTaskBarReceiver : public IInterface { public: // Icon data is architecture dependent - typedef void *Icon; + using Icon = void *; //! @name manipulators //@{ diff --git a/src/lib/arch/unix/ArchMultithreadPosix.h b/src/lib/arch/unix/ArchMultithreadPosix.h index 5991b457b..c6a4915ae 100644 --- a/src/lib/arch/unix/ArchMultithreadPosix.h +++ b/src/lib/arch/unix/ArchMultithreadPosix.h @@ -106,7 +106,7 @@ private: static void *threadSignalHandler(void *vrep); private: - typedef std::list ThreadList; + using ThreadList = std::list; static ArchMultithreadPosix *s_instance; diff --git a/src/lib/arch/unix/ArchNetworkBSD.h b/src/lib/arch/unix/ArchNetworkBSD.h index 0a11b8a79..aed3ee2ed 100644 --- a/src/lib/arch/unix/ArchNetworkBSD.h +++ b/src/lib/arch/unix/ArchNetworkBSD.h @@ -41,7 +41,7 @@ struct sockaddr_storage #endif #if !HAVE_SOCKLEN_T -typedef int socklen_t; +using socklen_t = int; #endif #include @@ -52,7 +52,7 @@ typedef int socklen_t; // old systems may use char* for [gs]etsockopt()'s optval argument. // this should be void on modern systems but char is forwards // compatible so we always use it. -typedef char optval_t; +using optval_t = char; class ArchSocketImpl { diff --git a/src/lib/arch/win32/ArchDaemonWindows.cpp b/src/lib/arch/win32/ArchDaemonWindows.cpp index 17c8d6d57..6476f2242 100644 --- a/src/lib/arch/win32/ArchDaemonWindows.cpp +++ b/src/lib/arch/win32/ArchDaemonWindows.cpp @@ -385,8 +385,8 @@ void ArchDaemonWindows::setStatusError(DWORD error) void ArchDaemonWindows::serviceMain(DWORD argc, LPTSTR *argvIn) { - typedef std::vector ArgList; - typedef std::vector Arguments; + using ArgList = std::vector; + using Arguments = std::vector; const char **argv = const_cast(argvIn); // create synchronization objects diff --git a/src/lib/arch/win32/ArchMiscWindows.cpp b/src/lib/arch/win32/ArchMiscWindows.cpp index ea5df3e49..59a1f8b81 100644 --- a/src/lib/arch/win32/ArchMiscWindows.cpp +++ b/src/lib/arch/win32/ArchMiscWindows.cpp @@ -38,7 +38,7 @@ #ifndef ES_CONTINUOUS #define ES_CONTINUOUS ((DWORD)0x80000000) #endif -typedef DWORD EXECUTION_STATE; +using EXECUTION_STATE = DWORD; // // ArchMiscWindows @@ -467,4 +467,4 @@ void ArchMiscWindows::setInstanceWin32(HINSTANCE instance) { assert(instance != NULL); s_instanceWin32 = instance; -} \ No newline at end of file +} diff --git a/src/lib/arch/win32/ArchMiscWindows.h b/src/lib/arch/win32/ArchMiscWindows.h index 3e8cbe190..e9800aafc 100644 --- a/src/lib/arch/win32/ArchMiscWindows.h +++ b/src/lib/arch/win32/ArchMiscWindows.h @@ -190,7 +190,7 @@ private: static DWORD WINAPI dummySetThreadExecutionState(DWORD); private: - typedef std::set Dialogs; + using Dialogs = std::set; typedef DWORD(WINAPI *STES_t)(DWORD); static Dialogs *s_dialogs; diff --git a/src/lib/arch/win32/ArchMultithreadWindows.h b/src/lib/arch/win32/ArchMultithreadWindows.h index 4099adcdd..163826941 100644 --- a/src/lib/arch/win32/ArchMultithreadWindows.h +++ b/src/lib/arch/win32/ArchMultithreadWindows.h @@ -109,7 +109,7 @@ private: static unsigned int __stdcall threadFunc(void *vrep); private: - typedef std::list ThreadList; + using ThreadList = std::list; static ArchMultithreadWindows *s_instance; diff --git a/src/lib/arch/win32/ArchNetworkWinsock.h b/src/lib/arch/win32/ArchNetworkWinsock.h index f75acfa84..72fd170a6 100644 --- a/src/lib/arch/win32/ArchNetworkWinsock.h +++ b/src/lib/arch/win32/ArchNetworkWinsock.h @@ -106,7 +106,7 @@ private: void throwNameError(int); private: - typedef std::list EventList; + using EventList = std::list; ArchMutex m_mutex; EventList m_unblockEvents; diff --git a/src/lib/arch/win32/ArchTaskBarWindows.h b/src/lib/arch/win32/ArchTaskBarWindows.h index ac70d4624..e14fa2304 100644 --- a/src/lib/arch/win32/ArchTaskBarWindows.h +++ b/src/lib/arch/win32/ArchTaskBarWindows.h @@ -63,10 +63,10 @@ private: UINT m_id; }; - typedef std::map ReceiverToInfoMap; - typedef std::map CIDToReceiverMap; - typedef std::vector CIDStack; - typedef std::map Dialogs; + using ReceiverToInfoMap = std::map; + using CIDToReceiverMap = std::map; + using CIDStack = std::vector; + using Dialogs = std::map; UINT getNextID(); void recycleID(UINT); diff --git a/src/lib/base/Event.h b/src/lib/base/Event.h index 1babd8850..6d76189fa 100644 --- a/src/lib/base/Event.h +++ b/src/lib/base/Event.h @@ -39,7 +39,7 @@ A \c Event holds an event type and a pointer to event data. class Event { public: - typedef UInt32 Type; + using Type = UInt32; enum { kUnknown, //!< The event type is unknown @@ -49,7 +49,7 @@ public: kLast //!< Must be last }; - typedef UInt32 Flags; + using Flags = UInt32; enum { kNone = 0x00, //!< No flags diff --git a/src/lib/base/EventQueue.h b/src/lib/base/EventQueue.h index 8b7180240..309a60152 100644 --- a/src/lib/base/EventQueue.h +++ b/src/lib/base/EventQueue.h @@ -102,14 +102,14 @@ private: double m_time; }; - typedef std::set Timers; - typedef PriorityQueue TimerQueue; - typedef std::map EventTable; - typedef std::vector EventIDList; - typedef std::map TypeMap; - typedef std::map NameMap; - typedef std::map TypeHandlerTable; - typedef std::map HandlerTable; + using Timers = std::set; + using TimerQueue = PriorityQueue; + using EventTable = std::map; + using EventIDList = std::vector; + using TypeMap = std::map; + using NameMap = std::map; + using TypeHandlerTable = std::map; + using HandlerTable = std::map; int m_systemTarget; ArchMutex m_mutex; diff --git a/src/lib/base/Log.h b/src/lib/base/Log.h index 9337dcb77..45ea8284d 100644 --- a/src/lib/base/Log.h +++ b/src/lib/base/Log.h @@ -136,7 +136,7 @@ private: void output(ELevel priority, char *msg); private: - typedef std::list OutputterList; + using OutputterList = std::list; static Log *s_log; diff --git a/src/lib/base/PriorityQueue.h b/src/lib/base/PriorityQueue.h index de61c9b18..0577298eb 100644 --- a/src/lib/base/PriorityQueue.h +++ b/src/lib/base/PriorityQueue.h @@ -39,11 +39,11 @@ template < class PriorityQueue { public: - typedef typename Container::value_type value_type; - typedef typename Container::size_type size_type; - typedef typename Container::iterator iterator; - typedef typename Container::const_iterator const_iterator; - typedef Container container_type; + using value_type = Container::value_type; + using size_type = Container::size_type; + using iterator = Container::iterator; + using const_iterator = Container::const_iterator; + using container_type = Container; PriorityQueue() { diff --git a/src/lib/base/SimpleEventQueueBuffer.h b/src/lib/base/SimpleEventQueueBuffer.h index b4432682b..ac609276e 100644 --- a/src/lib/base/SimpleEventQueueBuffer.h +++ b/src/lib/base/SimpleEventQueueBuffer.h @@ -49,7 +49,7 @@ public: virtual void deleteTimer(EventQueueTimer *) const; private: - typedef std::deque EventDeque; + using EventDeque = std::deque; ArchMutex m_queueMutex; ArchCond m_queueReadyCond; diff --git a/src/lib/base/log_outputters.h b/src/lib/base/log_outputters.h index 24bb2ab81..03393c91c 100644 --- a/src/lib/base/log_outputters.h +++ b/src/lib/base/log_outputters.h @@ -137,10 +137,10 @@ This outputter records the last N log messages. class BufferedLogOutputter : public ILogOutputter { private: - typedef std::deque Buffer; + using Buffer = std::deque; public: - typedef Buffer::const_iterator const_iterator; + using const_iterator = Buffer::const_iterator; BufferedLogOutputter(UInt32 maxBufferSize); virtual ~BufferedLogOutputter(); diff --git a/src/lib/common/basic_types.h b/src/lib/common/basic_types.h index f11a199f5..90ec2c0f4 100644 --- a/src/lib/common/basic_types.h +++ b/src/lib/common/basic_types.h @@ -84,12 +84,12 @@ #if defined(__APPLE__) #include #else -typedef signed TYPE_OF_SIZE_1 SInt8; -typedef signed TYPE_OF_SIZE_2 SInt16; -typedef signed TYPE_OF_SIZE_4 SInt32; -typedef unsigned TYPE_OF_SIZE_1 UInt8; -typedef unsigned TYPE_OF_SIZE_2 UInt16; -typedef unsigned TYPE_OF_SIZE_4 UInt32; +using SInt8 = signed TYPE_OF_SIZE_1; +using SInt16 = signed TYPE_OF_SIZE_2; +using SInt32 = signed TYPE_OF_SIZE_4; +using UInt8 = unsigned TYPE_OF_SIZE_1; +using UInt16 = unsigned TYPE_OF_SIZE_2; +using UInt32 = unsigned TYPE_OF_SIZE_4; #endif #endif // diff --git a/src/lib/common/stdsstream.h b/src/lib/common/stdsstream.h index 08bdb65bf..82cfc8633 100644 --- a/src/lib/common/stdsstream.h +++ b/src/lib/common/stdsstream.h @@ -63,10 +63,10 @@ namespace std { class stringbuf : public streambuf { public: - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; + using char_type = char; + using int_type = int; + using pos_type = streampos; + using off_type = streamoff; explicit stringbuf(int which = ios::in | ios::out) : streambuf(), @@ -231,10 +231,10 @@ private: class istringstream : public istream { public: - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; + using char_type = char; + using int_type = int; + using pos_type = streampos; + using off_type = streamoff; explicit istringstream(int which = ios::in) : istream(&sb), sb(which | ios::in) { @@ -265,10 +265,10 @@ private: class ostringstream : public ostream { public: - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; + using char_type = char; + using int_type = int; + using pos_type = streampos; + using off_type = streamoff; explicit ostringstream(int which = ios::out) : ostream(&sb), sb(which | ios::out) { @@ -300,10 +300,10 @@ private: class stringstream : public iostream { public: - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; + using char_type = char; + using int_type = int; + using pos_type = streampos; + using off_type = streamoff; explicit stringstream(int which = ios::out | ios::in) : iostream(&sb), sb(which) { diff --git a/src/lib/deskflow/DragInformation.h b/src/lib/deskflow/DragInformation.h index 2d5caba6f..2121990be 100644 --- a/src/lib/deskflow/DragInformation.h +++ b/src/lib/deskflow/DragInformation.h @@ -22,7 +22,7 @@ #include "common/stdvector.h" class DragInformation; -typedef std::vector DragFileList; +using DragFileList = std::vector; class DragInformation { diff --git a/src/lib/deskflow/IClipboard.h b/src/lib/deskflow/IClipboard.h index 403f601fc..212125fa6 100644 --- a/src/lib/deskflow/IClipboard.h +++ b/src/lib/deskflow/IClipboard.h @@ -35,7 +35,7 @@ public: arbitrary starting time. Timestamps will wrap around to 0 after about 49 3/4 days. */ - typedef UInt32 Time; + using Time = UInt32; //! Clipboard formats /*! diff --git a/src/lib/deskflow/IKeyState.h b/src/lib/deskflow/IKeyState.h index 210cb3d50..0de9b265b 100644 --- a/src/lib/deskflow/IKeyState.h +++ b/src/lib/deskflow/IKeyState.h @@ -64,7 +64,7 @@ public: char m_screensBuffer[1]; }; - typedef std::set KeyButtonSet; + using KeyButtonSet = std::set; //! @name manipulators //@{ diff --git a/src/lib/deskflow/KeyMap.h b/src/lib/deskflow/KeyMap.h index 32729a41b..0cc49a3a1 100644 --- a/src/lib/deskflow/KeyMap.h +++ b/src/lib/deskflow/KeyMap.h @@ -76,7 +76,7 @@ public: any modifier keys unless the KeyID is a modifier, in which case it has exactly one KeyItem for the modifier itself. */ - typedef std::vector KeyItemList; + using KeyItemList = std::vector; //! A keystroke class Keystroke @@ -119,13 +119,13 @@ public: }; //! A sequence of keystrokes - typedef std::vector Keystrokes; + using Keystrokes = std::vector; //! A mapping of a modifier to keys for that modifier - typedef std::multimap ModifierToKeys; + using ModifierToKeys = std::multimap; //! A set of buttons - typedef std::map ButtonToKeyMap; + using ButtonToKeyMap = std::map; //! Callback type for \c foreachKey typedef void (*ForeachKeyCallback)(KeyID, SInt32 group, KeyItem &, void *userData); @@ -353,7 +353,7 @@ private: }; // A list of ways to synthesize a KeyID - typedef std::vector KeyEntryList; + using KeyEntryList = std::vector; // computes the number of groups SInt32 findNumGroups() const; @@ -440,7 +440,7 @@ private: static void initKeyNameMaps(); // Ways to synthesize a KeyID over multiple keyboard groups - typedef std::vector KeyGroupTable; + using KeyGroupTable = std::vector; void addGroupToKeystroke(Keystrokes &keys, SInt32 &group, const String &lang) const; @@ -454,25 +454,25 @@ private: private: // Table of KeyID to ways to synthesize that KeyID - typedef std::map KeyIDMap; + using KeyIDMap = std::map; // List of KeyItems that generate a particular modifier - typedef std::vector ModifierKeyItemList; + using ModifierKeyItemList = std::vector; // Map a modifier to the KeyItems that synthesize that modifier - typedef std::vector ModifierToKeyTable; + using ModifierToKeyTable = std::vector; // A set of keys - typedef std::set KeySet; + using KeySet = std::set; // A set of buttons - typedef std::set KeyButtonSet; + using KeyButtonSet = std::set; // Key maps for parsing/formatting - typedef std::map NameToKeyMap; - typedef std::map NameToModifierMap; - typedef std::map KeyToNameMap; - typedef std::map ModifierToNameMap; + using NameToKeyMap = std::map; + using NameToModifierMap = std::map; + using KeyToNameMap = std::map; + using ModifierToNameMap = std::map; // KeyID info KeyIDMap m_keyIDMap; diff --git a/src/lib/deskflow/KeyState.h b/src/lib/deskflow/KeyState.h index c87fa3265..71bafa1dd 100644 --- a/src/lib/deskflow/KeyState.h +++ b/src/lib/deskflow/KeyState.h @@ -89,7 +89,7 @@ public: } protected: - typedef deskflow::KeyMap::Keystroke Keystroke; + using Keystroke = deskflow::KeyMap::Keystroke; //! @name protected manipulators //@{ @@ -140,8 +140,8 @@ protected: //@} private: - typedef deskflow::KeyMap::Keystrokes Keystrokes; - typedef deskflow::KeyMap::ModifierToKeys ModifierToKeys; + using Keystrokes = deskflow::KeyMap::Keystrokes; + using ModifierToKeys = deskflow::KeyMap::ModifierToKeys; public: struct AddActiveModifierContext diff --git a/src/lib/deskflow/ServerTaskBarReceiver.h b/src/lib/deskflow/ServerTaskBarReceiver.h index 30e289d2b..5ae86dab6 100644 --- a/src/lib/deskflow/ServerTaskBarReceiver.h +++ b/src/lib/deskflow/ServerTaskBarReceiver.h @@ -61,7 +61,7 @@ public: virtual std::string getToolTip() const; protected: - typedef std::vector Clients; + using Clients = std::vector; enum EState { kNotRunning, diff --git a/src/lib/deskflow/clipboard_types.h b/src/lib/deskflow/clipboard_types.h index 2404f8eb0..6925ad499 100644 --- a/src/lib/deskflow/clipboard_types.h +++ b/src/lib/deskflow/clipboard_types.h @@ -24,7 +24,7 @@ /*! Type to hold a clipboard identifier. */ -typedef UInt8 ClipboardID; +using ClipboardID = UInt8; //! @name Clipboard identifiers //@{ diff --git a/src/lib/deskflow/key_types.h b/src/lib/deskflow/key_types.h index f623a5288..958fd7066 100644 --- a/src/lib/deskflow/key_types.h +++ b/src/lib/deskflow/key_types.h @@ -26,7 +26,12 @@ Type to hold a key symbol identifier. The encoding is UTF-32, using U+E000 through U+EFFF for the various control keys (e.g. arrow keys, function keys, modifier keys, etc). */ +// Typedef has to be used on mac os as this is used in objective-C +#if __APPLE__ typedef UInt32 KeyID; +#else +using KeyID = UInt32; +#endif //! Key Code /*! @@ -35,19 +40,31 @@ physical key on the keyboard. KeyButton 0 is reserved to be an invalid key; platforms that use 0 as a physical key identifier will have to remap that value to some arbitrary unused id. */ +#if __APPLE__ typedef UInt16 KeyButton; +#else +using KeyButton = UInt16; +#endif //! Modifier key mask /*! Type to hold a bitmask of key modifiers (e.g. shift keys). */ +#if __APPLE__ typedef UInt32 KeyModifierMask; +#else +using KeyModifierMask = UInt32; +#endif //! Modifier key ID /*! Type to hold the id of a key modifier (e.g. a shift key). */ +#if __APPLE__ typedef UInt32 KeyModifierID; +#else +using KeyModifierID = UInt32; +#endif //! @name Modifier key masks //@{ diff --git a/src/lib/deskflow/mouse_types.h b/src/lib/deskflow/mouse_types.h index c42ebcb87..bbfd5661e 100644 --- a/src/lib/deskflow/mouse_types.h +++ b/src/lib/deskflow/mouse_types.h @@ -24,7 +24,7 @@ /*! Type to hold a mouse button identifier. */ -typedef UInt8 ButtonID; +using ButtonID = UInt8; //! @name Mouse button identifiers //@{ diff --git a/src/lib/deskflow/option_types.h b/src/lib/deskflow/option_types.h index 69befca68..699d6cd13 100644 --- a/src/lib/deskflow/option_types.h +++ b/src/lib/deskflow/option_types.h @@ -25,16 +25,16 @@ /*! Type to hold an option identifier. */ -typedef UInt32 OptionID; +using OptionID = UInt32; //! Option Value /*! Type to hold an option value. */ -typedef SInt32 OptionValue; +using OptionValue = SInt32; // for now, options are just pairs of integers -typedef std::vector OptionsList; +using OptionsList = std::vector; // macro for packing 4 character strings into 4 byte integers #define OPTION_CODE(_s) \ diff --git a/src/lib/io/StreamBuffer.h b/src/lib/io/StreamBuffer.h index afe309eda..96ebe08f0 100644 --- a/src/lib/io/StreamBuffer.h +++ b/src/lib/io/StreamBuffer.h @@ -71,8 +71,8 @@ public: private: static const UInt32 kChunkSize; - typedef std::vector Chunk; - typedef std::list ChunkList; + using Chunk = std::vector; + using ChunkList = std::list; ChunkList m_chunks; UInt32 m_size; diff --git a/src/lib/ipc/IpcLogOutputter.h b/src/lib/ipc/IpcLogOutputter.h index a354489fc..8879cb182 100644 --- a/src/lib/ipc/IpcLogOutputter.h +++ b/src/lib/ipc/IpcLogOutputter.h @@ -98,7 +98,7 @@ private: bool isRunning(); private: - typedef std::deque Buffer; + using Buffer = std::deque; IpcServer &m_ipcServer; Buffer m_buffer; diff --git a/src/lib/ipc/IpcServer.h b/src/lib/ipc/IpcServer.h index 1bb1f9845..afa3009bf 100644 --- a/src/lib/ipc/IpcServer.h +++ b/src/lib/ipc/IpcServer.h @@ -77,7 +77,7 @@ private: void deleteClient(IpcClientProxy *proxy); private: - typedef std::list ClientList; + using ClientList = std::list; bool m_mock; IEventQueue *m_events; diff --git a/src/lib/net/SocketMultiplexer.h b/src/lib/net/SocketMultiplexer.h index 6b78738e3..9c71154ed 100644 --- a/src/lib/net/SocketMultiplexer.h +++ b/src/lib/net/SocketMultiplexer.h @@ -62,9 +62,9 @@ public: private: // list of jobs. we use a list so we can safely iterate over it // while other threads modify it. - typedef std::list SocketJobs; - typedef SocketJobs::iterator JobCursor; - typedef std::map SocketJobMap; + using SocketJobs = std::list; + using JobCursor = SocketJobs::iterator; + using SocketJobMap = std::map; // service sockets. the service thread will only access m_sockets // and m_update while m_pollable and m_polling are true. all other diff --git a/src/lib/platform/MSWindowsClipboard.h b/src/lib/platform/MSWindowsClipboard.h index 92a32b601..66f51eb0f 100644 --- a/src/lib/platform/MSWindowsClipboard.h +++ b/src/lib/platform/MSWindowsClipboard.h @@ -75,7 +75,7 @@ private: static UINT getOwnershipFormat(); private: - typedef std::vector ConverterList; + using ConverterList = std::vector; HWND m_window; mutable Time m_time; diff --git a/src/lib/platform/MSWindowsDesks.h b/src/lib/platform/MSWindowsDesks.h index eb225a381..05efee5ba 100644 --- a/src/lib/platform/MSWindowsDesks.h +++ b/src/lib/platform/MSWindowsDesks.h @@ -202,7 +202,7 @@ private: HWND m_foregroundWindow; bool m_lowLevel; }; - typedef std::map Desks; + using Desks = std::map; // initialization and shutdown operations HCURSOR createBlankCursor() const; diff --git a/src/lib/platform/MSWindowsKeyState.h b/src/lib/platform/MSWindowsKeyState.h index c0a6bf1dd..098e1c876 100644 --- a/src/lib/platform/MSWindowsKeyState.h +++ b/src/lib/platform/MSWindowsKeyState.h @@ -178,7 +178,7 @@ protected: virtual KeyModifierMask &getActiveModifiersRValue(); private: - typedef std::vector GroupList; + using GroupList = std::vector; // send ctrl+alt+del hotkey event on NT family static void ctrlAltDelThread(void *); @@ -198,8 +198,8 @@ private: MSWindowsKeyState &operator=(const MSWindowsKeyState &); private: - typedef std::map GroupMap; - typedef std::map KeyToVKMap; + using GroupMap = std::map; + using KeyToVKMap = std::map; void *m_eventTarget; MSWindowsDesks *m_desks; diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index 1a9852e16..d7284973f 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -260,10 +260,10 @@ private: UINT m_keycode; UINT m_mask; }; - typedef std::map HotKeyMap; - typedef std::vector HotKeyIDList; - typedef std::map HotKeyToIDMap; - typedef std::vector PrimaryKeyDownList; + using HotKeyMap = std::map; + using HotKeyIDList = std::vector; + using HotKeyToIDMap = std::map; + using PrimaryKeyDownList = std::vector; static HINSTANCE s_windowInstance; diff --git a/src/lib/platform/OSXClipboard.h b/src/lib/platform/OSXClipboard.h index 505b61a43..447f1a417 100644 --- a/src/lib/platform/OSXClipboard.h +++ b/src/lib/platform/OSXClipboard.h @@ -50,7 +50,7 @@ private: void clearConverters(); private: - typedef std::vector ConverterList; + using ConverterList = std::vector; mutable Time m_time; ConverterList m_converters; diff --git a/src/lib/platform/OSXKeyState.h b/src/lib/platform/OSXKeyState.h index 25251a148..226ca15ff 100644 --- a/src/lib/platform/OSXKeyState.h +++ b/src/lib/platform/OSXKeyState.h @@ -35,7 +35,7 @@ A key state for OS X. class OSXKeyState : public KeyState { public: - typedef std::vector KeyIDs; + using KeyIDs = std::vector; OSXKeyState(IEventQueue *events, std::vector layouts, bool isLangSyncEnabled); OSXKeyState(IEventQueue *events, deskflow::KeyMap &keyMap, std::vector layouts, bool isLangSyncEnabled); @@ -160,8 +160,8 @@ private: KeyButtonOffset = 1 }; - typedef std::map GroupMap; - typedef std::map VirtualKeyMap; + using GroupMap = std::map; + using VirtualKeyMap = std::map; VirtualKeyMap m_virtualKeyMap; mutable UInt32 m_deadKeyState; diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h index 90ccfe3a3..38d2eed80 100644 --- a/src/lib/platform/OSXScreen.h +++ b/src/lib/platform/OSXScreen.h @@ -36,7 +36,7 @@ extern "C" { - typedef int CGSConnectionID; + using CGSConnectionID = int; CGError CGSSetConnectionProperty(CGSConnectionID cid, CGSConnectionID targetCID, CFStringRef key, CFTypeRef value); int _CGSDefaultConnection(); } @@ -242,10 +242,10 @@ private: std::bitset m_buttons; }; - typedef std::map HotKeyMap; - typedef std::vector HotKeyIDList; - typedef std::map ModifierHotKeyMap; - typedef std::map HotKeyToIDMap; + using HotKeyMap = std::map; + using HotKeyIDList = std::vector; + using ModifierHotKeyMap = std::map; + using HotKeyToIDMap = std::map; // true if screen is being used as a primary screen, false otherwise bool m_isPrimary; @@ -272,7 +272,7 @@ private: Evil, and this should be moved to a place where it need not be mutable as soon as possible. */ mutable MouseButtonState m_buttonState; - typedef std::map MouseButtonEventMapType; + using MouseButtonEventMapType = std::map; std::vector MouseButtonEventMap; bool m_cursorHidden; diff --git a/src/lib/platform/OSXUchrKeyResource.h b/src/lib/platform/OSXUchrKeyResource.h index 487ef584d..45bff2cb4 100644 --- a/src/lib/platform/OSXUchrKeyResource.h +++ b/src/lib/platform/OSXUchrKeyResource.h @@ -22,7 +22,7 @@ #include -typedef TISInputSourceRef KeyLayout; +using KeyLayout = TISInputSourceRef; class OSXUchrKeyResource : public IOSXKeyResource { @@ -38,7 +38,7 @@ public: virtual KeyID getKey(UInt32 table, UInt32 button) const; private: - typedef std::vector KeySequence; + using KeySequence = std::vector; bool getDeadKey(KeySequence &keys, UInt16 index) const; bool getKeyRecord(KeySequence &keys, UInt16 index, UInt16 &state) const; diff --git a/src/lib/platform/XWindowsClipboard.cpp b/src/lib/platform/XWindowsClipboard.cpp index 7538a4806..57035af1c 100644 --- a/src/lib/platform/XWindowsClipboard.cpp +++ b/src/lib/platform/XWindowsClipboard.cpp @@ -680,7 +680,7 @@ void XWindowsClipboard::motifFillCache() auto formats = static_cast(static_cast(item.m_size + data.data())); // get the available formats - typedef std::map MotifFormatMap; + using MotifFormatMap = std::map; MotifFormatMap motifFormats; for (SInt32 i = 0; i < numFormats; ++i) { // get Motif format property from the root window diff --git a/src/lib/platform/XWindowsClipboard.h b/src/lib/platform/XWindowsClipboard.h index c65aa2bf5..7dbb4b337 100644 --- a/src/lib/platform/XWindowsClipboard.h +++ b/src/lib/platform/XWindowsClipboard.h @@ -258,9 +258,9 @@ protected: // index of next byte in m_data to send UInt32 m_ptr; }; - typedef std::list ReplyList; - typedef std::map ReplyMap; - typedef std::map ReplyEventMask; + using ReplyList = std::list; + using ReplyMap = std::map; + using ReplyEventMask = std::map; // ICCCM interoperability methods void icccmFillCache(); @@ -291,7 +291,7 @@ protected: Atom getTimestampData(String &, int *format) const; private: - typedef std::vector ConverterList; + using ConverterList = std::vector; Display *m_display; Window m_window; diff --git a/src/lib/platform/XWindowsEventQueueBuffer.h b/src/lib/platform/XWindowsEventQueueBuffer.h index 94e24e095..066b02f63 100644 --- a/src/lib/platform/XWindowsEventQueueBuffer.h +++ b/src/lib/platform/XWindowsEventQueueBuffer.h @@ -59,7 +59,7 @@ private: int getPendingCountLocked(); private: - typedef std::vector EventList; + using EventList = std::vector; Mutex m_mutex; Display *m_display; diff --git a/src/lib/platform/XWindowsKeyState.h b/src/lib/platform/XWindowsKeyState.h index 834fc0d60..b9041e719 100644 --- a/src/lib/platform/XWindowsKeyState.h +++ b/src/lib/platform/XWindowsKeyState.h @@ -45,7 +45,7 @@ A key state for X Windows. class XWindowsKeyState : public KeyState { public: - typedef std::vector KeycodeList; + using KeycodeList = std::vector; enum { kGroupPoll = -1, @@ -142,13 +142,13 @@ private: #ifdef TEST_ENV public: // yuck #endif - typedef std::vector KeyModifierMaskList; + using KeyModifierMaskList = std::vector; private: - typedef std::map KeyModifierToXMask; - typedef std::multimap KeyToKeyCodeMap; - typedef std::map NonXKBModifierMap; - typedef std::map XKBModifierMap; + using KeyModifierToXMask = std::map; + using KeyToKeyCodeMap = std::multimap; + using NonXKBModifierMap = std::map; + using XKBModifierMap = std::map; Display *m_display; #if HAVE_XKB_EXTENSION diff --git a/src/lib/platform/XWindowsScreen.h b/src/lib/platform/XWindowsScreen.h index e140d215e..a7f2c5348 100644 --- a/src/lib/platform/XWindowsScreen.h +++ b/src/lib/platform/XWindowsScreen.h @@ -172,11 +172,11 @@ private: int m_keycode; unsigned int m_mask; }; - typedef std::set FilteredKeycodes; - typedef std::vector> HotKeyList; - typedef std::map HotKeyMap; - typedef std::vector HotKeyIDList; - typedef std::map HotKeyToIDMap; + using FilteredKeycodes = std::set; + using HotKeyList = std::vector>; + using HotKeyMap = std::map; + using HotKeyIDList = std::vector; + using HotKeyToIDMap = std::map; // true if screen is being used as a primary screen, false otherwise bool m_isPrimary; diff --git a/src/lib/platform/XWindowsScreenSaver.h b/src/lib/platform/XWindowsScreenSaver.h index 2bff7e51b..a62847895 100644 --- a/src/lib/platform/XWindowsScreenSaver.h +++ b/src/lib/platform/XWindowsScreenSaver.h @@ -116,7 +116,7 @@ private: bool isDPMSActivated() const; private: - typedef std::map WatchList; + using WatchList = std::map; // the X display Display *m_display; diff --git a/src/lib/server/ClientListener.h b/src/lib/server/ClientListener.h index 55ec09242..05555cffe 100644 --- a/src/lib/server/ClientListener.h +++ b/src/lib/server/ClientListener.h @@ -89,9 +89,9 @@ private: void removeUnknownClient(ClientProxyUnknown *unknownClient); private: - typedef std::set NewClients; - typedef std::deque WaitingClients; - typedef std::set ClientSockets; + using NewClients = std::set; + using WaitingClients = std::deque; + using ClientSockets = std::set; IListenSocket *m_listen; ISocketFactory *m_socketFactory; diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp index a299c15c2..f78e29e21 100644 --- a/src/lib/server/Config.cpp +++ b/src/lib/server/Config.cpp @@ -1655,7 +1655,7 @@ std::ostream &operator<<(std::ostream &s, const Config &config) // aliases section (if there are any) if (config.m_map.size() != config.m_nameToCanonicalName.size()) { // map canonical to alias - typedef std::multimap CMNameMap; + using CMNameMap = std::multimap; CMNameMap aliases; for (Config::NameMap::const_iterator index = config.m_nameToCanonicalName.begin(); index != config.m_nameToCanonicalName.end(); ++index) { diff --git a/src/lib/server/Config.h b/src/lib/server/Config.h index 99402b232..8c6b6a140 100644 --- a/src/lib/server/Config.h +++ b/src/lib/server/Config.h @@ -40,11 +40,11 @@ class IEventQueue; namespace std { template <> struct iterator_traits { - typedef String value_type; - typedef ptrdiff_t difference_type; - typedef bidirectional_iterator_tag iterator_category; - typedef String *pointer; - typedef String &reference; + using value_type = String; + using difference_type = ptrdiff_t; + using iterator_category = bidirectional_iterator_tag; + using pointer = String *; + using reference = String &; }; }; // namespace std @@ -63,8 +63,8 @@ namespace and must be unique. class Config { public: - typedef std::map ScreenOptions; - typedef std::pair Interval; + using ScreenOptions = std::map; + using Interval = std::pair; class CellEdge { @@ -119,10 +119,10 @@ private: class Cell { private: - typedef std::map EdgeLinks; + using EdgeLinks = std::map; public: - typedef EdgeLinks::const_iterator const_iterator; + using const_iterator = EdgeLinks::const_iterator; bool add(const CellEdge &src, const CellEdge &dst); void remove(EDirection side); @@ -147,13 +147,13 @@ private: public: ScreenOptions m_options; }; - typedef std::map CellMap; - typedef std::map NameMap; + using CellMap = std::map; + using NameMap = std::map; public: - typedef Cell::const_iterator link_const_iterator; - typedef CellMap::const_iterator internal_const_iterator; - typedef NameMap::const_iterator all_const_iterator; + using link_const_iterator = Cell::const_iterator; + using internal_const_iterator = CellMap::const_iterator; + using all_const_iterator = NameMap::const_iterator; class const_iterator : std::iterator_traits { public: @@ -522,7 +522,7 @@ Maintains a context when reading a configuration from a stream. class ConfigReadContext { public: - typedef std::vector ArgList; + using ArgList = std::vector; ConfigReadContext(std::istream &, SInt32 firstLine = 1); ~ConfigReadContext(); diff --git a/src/lib/server/InputFilter.h b/src/lib/server/InputFilter.h index 63c4467ee..770a5565a 100644 --- a/src/lib/server/InputFilter.h +++ b/src/lib/server/InputFilter.h @@ -354,7 +354,7 @@ public: void copy(const Rule &); private: - typedef std::vector ActionList; + using ActionList = std::vector; Condition *m_condition; ActionList m_activateActions; @@ -364,7 +364,7 @@ public: // ------------------------------------------------------------------------- // Input Filter Class // ------------------------------------------------------------------------- - typedef std::vector RuleList; + using RuleList = std::vector; InputFilter(IEventQueue *events); InputFilter(const InputFilter &); diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index e5f513e15..7d4c27583 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -2112,7 +2112,7 @@ void Server::closeClients(const ServerConfig &config) { // collect the clients that are connected but are being dropped // from the configuration (or who's canonical name is changing). - typedef std::set RemovedClients; + using RemovedClients = std::set; RemovedClients removed; for (ClientList::iterator index = m_clients.begin(); index != m_clients.end(); ++index) { if (!config.isCanonicalName(index->first)) { diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h index 38aa01b6c..9a7445420 100644 --- a/src/lib/server/Server.h +++ b/src/lib/server/Server.h @@ -436,13 +436,13 @@ private: PrimaryClient *m_primaryClient; // all clients (including the primary client) indexed by name - typedef std::map ClientList; - typedef std::set ClientSet; + using ClientList = std::map; + using ClientSet = std::set; ClientList m_clients; ClientSet m_clientSet; // all old connections that we're waiting to hangup - typedef std::map OldClients; + using OldClients = std::map; OldClients m_oldClients; // the client with focus diff --git a/src/test/mock/deskflow/MockKeyState.h b/src/test/mock/deskflow/MockKeyState.h index 417439761..ca46b25c9 100644 --- a/src/test/mock/deskflow/MockKeyState.h +++ b/src/test/mock/deskflow/MockKeyState.h @@ -50,6 +50,6 @@ public: typedef ::testing::NiceMock KeyStateImpl; -typedef UInt32 KeyID; +using KeyID = UInt32; typedef void (*ForeachKeyCallback)(KeyID, SInt32 group, deskflow::KeyMap::KeyItem &, void *userData);