chore: remove StdExcept and include stdexcept directly where needed

remove _NOEXCEPT define and just use throw()
This commit is contained in:
sithlord48 2025-03-20 19:35:21 -04:00 committed by Nick Bolton
parent 1798d7e4e6
commit 45b6ff19e7
19 changed files with 35 additions and 46 deletions

View file

@ -8,7 +8,8 @@
#pragma once #pragma once
#include "common/Common.h" #include "common/Common.h"
#include "common/StdExcept.h"
#include <stdexcept>
#include <string> #include <string>
//! Generic thread exception //! Generic thread exception
@ -57,7 +58,7 @@ public:
XArchEval() XArchEval()
{ {
} }
virtual ~XArchEval() _NOEXCEPT virtual ~XArchEval() throw()
{ {
} }
@ -75,7 +76,7 @@ public:
XArch(const std::string &msg) : std::runtime_error(msg) XArch(const std::string &msg) : std::runtime_error(msg)
{ {
} }
virtual ~XArch() _NOEXCEPT virtual ~XArch() throw()
{ {
} }
}; };

View file

@ -16,7 +16,7 @@ public:
XArchEvalUnix(int error) : m_error(error) XArchEvalUnix(int error) : m_error(error)
{ {
} }
virtual ~XArchEvalUnix() _NOEXCEPT virtual ~XArchEvalUnix() throw()
{ {
} }

View file

@ -26,12 +26,12 @@ XBase::XBase(const std::string &msg) : std::runtime_error(msg)
// do nothing // do nothing
} }
XBase::~XBase() _NOEXCEPT XBase::~XBase() throw()
{ {
// do nothing // do nothing
} }
const char *XBase::what() const _NOEXCEPT const char *XBase::what() const throw()
{ {
if (const char *what = std::runtime_error::what(); what != nullptr && what[0] != '\0') { if (const char *what = std::runtime_error::what(); what != nullptr && what[0] != '\0') {
return what; return what;

View file

@ -7,7 +7,7 @@
#pragma once #pragma once
#include "common/StdExcept.h" #include <stdexcept>
#include <string> #include <string>
//! Exception base class //! Exception base class
@ -21,10 +21,10 @@ public:
XBase(); XBase();
//! Use \c msg as the result of what() //! Use \c msg as the result of what()
XBase(const std::string &msg); XBase(const std::string &msg);
virtual ~XBase() _NOEXCEPT; virtual ~XBase() throw();
//! Reason for exception //! Reason for exception
virtual const char *what() const _NOEXCEPT; virtual const char *what() const throw();
protected: protected:
//! Get a human readable string describing the exception //! Get a human readable string describing the exception
@ -61,7 +61,7 @@ declared.
name_(const std::string &msg) : super_(msg) \ name_(const std::string &msg) : super_(msg) \
{ \ { \
} \ } \
virtual ~name_() _NOEXCEPT \ virtual ~name_() throw() \
{ \ { \
} \ } \
} }
@ -82,7 +82,7 @@ implemented.
name_(const std::string &msg) : super_(msg) \ name_(const std::string &msg) : super_(msg) \
{ \ { \
} \ } \
virtual ~name_() _NOEXCEPT \ virtual ~name_() throw() \
{ \ { \
} \ } \
\ \
@ -116,11 +116,11 @@ c'tor.
name_(const std::string &msg) : super_(msg), m_state(kFirst) \ name_(const std::string &msg) : super_(msg), m_state(kFirst) \
{ \ { \
} \ } \
virtual ~name_() _NOEXCEPT \ virtual ~name_() throw() \
{ \ { \
} \ } \
\ \
virtual const char *what() const _NOEXCEPT \ virtual const char *what() const throw() \
{ \ { \
if (m_state == kFirst) { \ if (m_state == kFirst) { \
m_state = kFormat; \ m_state = kFormat; \

View file

@ -14,7 +14,6 @@
#include "base/TMethodEventJob.h" #include "base/TMethodEventJob.h"
#include "base/TMethodJob.h" #include "base/TMethodJob.h"
#include "client/ServerProxy.h" #include "client/ServerProxy.h"
#include "common/StdExcept.h"
#include "deskflow/AppUtil.h" #include "deskflow/AppUtil.h"
#include "deskflow/DropHelper.h" #include "deskflow/DropHelper.h"
#include "deskflow/FileChunk.h" #include "deskflow/FileChunk.h"
@ -39,6 +38,7 @@
#include <iterator> #include <iterator>
#include <memory> #include <memory>
#include <sstream> #include <sstream>
#include <stdexcept>
using namespace deskflow::client; using namespace deskflow::client;

View file

@ -6,7 +6,6 @@ configure_file(Constants.h.in Constants.h @ONLY)
add_library(common STATIC add_library(common STATIC
Common.h Common.h
IInterface.h IInterface.h
StdExcept.h
Settings.h Settings.h
Settings.cpp Settings.cpp
QSettingsProxy.cpp QSettingsProxy.cpp

View file

@ -1,14 +0,0 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2014 - 2016 Symless Ltd.
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#pragma once
#include <stdexcept>
// apple declares _NOEXCEPT
#ifndef _NOEXCEPT
#define _NOEXCEPT throw()
#endif

View file

@ -7,11 +7,12 @@
#pragma once #pragma once
#include "common/StdExcept.h"
#include "deskflow/ClientArgs.h" #include "deskflow/ClientArgs.h"
#include "deskflow/DragInformation.h" #include "deskflow/DragInformation.h"
#include "deskflow/IPlatformScreen.h" #include "deskflow/IPlatformScreen.h"
#include <stdexcept>
//! Base screen implementation //! Base screen implementation
/*! /*!
This screen implementation is the superclass of all other screen This screen implementation is the superclass of all other screen

View file

@ -12,7 +12,6 @@
#include "base/Log.h" #include "base/Log.h"
#include "base/Stopwatch.h" #include "base/Stopwatch.h"
#include "base/String.h" #include "base/String.h"
#include "common/StdExcept.h"
#include "deskflow/ClipboardChunk.h" #include "deskflow/ClipboardChunk.h"
#include "deskflow/FileChunk.h" #include "deskflow/FileChunk.h"
#include "deskflow/ProtocolTypes.h" #include "deskflow/ProtocolTypes.h"
@ -20,6 +19,7 @@
#include "mt/Mutex.h" #include "mt/Mutex.h"
#include <fstream> #include <fstream>
#include <stdexcept>
using namespace std; using namespace std;

View file

@ -66,7 +66,7 @@ class XDuplicateClient : public XDeskflow
{ {
public: public:
XDuplicateClient(const std::string &name); XDuplicateClient(const std::string &name);
virtual ~XDuplicateClient() _NOEXCEPT virtual ~XDuplicateClient() throw()
{ {
} }
@ -94,7 +94,7 @@ class XUnknownClient : public XDeskflow
{ {
public: public:
XUnknownClient(const std::string &name); XUnknownClient(const std::string &name);
virtual ~XUnknownClient() _NOEXCEPT virtual ~XUnknownClient() throw()
{ {
} }
@ -123,7 +123,7 @@ class XExitApp : public XDeskflow
{ {
public: public:
XExitApp(int code); XExitApp(int code);
virtual ~XExitApp() _NOEXCEPT virtual ~XExitApp() throw()
{ {
} }

View file

@ -34,7 +34,7 @@ XScreenUnavailable::XScreenUnavailable(double timeUntilRetry) : m_timeUntilRetry
// do nothing // do nothing
} }
XScreenUnavailable::~XScreenUnavailable() _NOEXCEPT XScreenUnavailable::~XScreenUnavailable() throw()
{ {
// do nothing // do nothing
} }

View file

@ -37,7 +37,7 @@ public:
trying to open the screen again. trying to open the screen again.
*/ */
XScreenUnavailable(double timeUntilRetry); XScreenUnavailable(double timeUntilRetry);
virtual ~XScreenUnavailable() _NOEXCEPT; virtual ~XScreenUnavailable() throw();
//! @name manipulators //! @name manipulators
//@{ //@{

View file

@ -12,9 +12,10 @@
// XSocketAddress // XSocketAddress
// //
XSocketAddress::XSocketAddress(EError error, const std::string &hostname, int port) _NOEXCEPT : m_error(error), XSocketAddress::XSocketAddress(EError error, const std::string &hostname, int port) throw()
m_hostname(hostname), : m_error(error),
m_port(port) m_hostname(hostname),
m_port(port)
{ {
// do nothing // do nothing
} }

View file

@ -31,8 +31,8 @@ public:
kBadPort //!< The port is invalid kBadPort //!< The port is invalid
}; };
XSocketAddress(EError, const std::string &hostname, int port) _NOEXCEPT; XSocketAddress(EError, const std::string &hostname, int port) throw();
virtual ~XSocketAddress() _NOEXCEPT virtual ~XSocketAddress() throw()
{ {
} }

View file

@ -2114,7 +2114,7 @@ XConfigRead::XConfigRead(const ConfigReadContext &context, const char *errorFmt,
// do nothing // do nothing
} }
XConfigRead::~XConfigRead() _NOEXCEPT XConfigRead::~XConfigRead() throw()
{ {
// do nothing // do nothing
} }

View file

@ -563,7 +563,7 @@ class XConfigRead : public XBase
public: public:
XConfigRead(const ConfigReadContext &context, const std::string &); XConfigRead(const ConfigReadContext &context, const std::string &);
XConfigRead(const ConfigReadContext &context, const char *errorFmt, const std::string &arg); XConfigRead(const ConfigReadContext &context, const char *errorFmt, const std::string &arg);
virtual ~XConfigRead() _NOEXCEPT; virtual ~XConfigRead() throw();
protected: protected:
// XBase overrides // XBase overrides

View file

@ -12,7 +12,6 @@
#include "base/Log.h" #include "base/Log.h"
#include "base/TMethodEventJob.h" #include "base/TMethodEventJob.h"
#include "base/TMethodJob.h" #include "base/TMethodJob.h"
#include "common/StdExcept.h"
#include "deskflow/AppUtil.h" #include "deskflow/AppUtil.h"
#include "deskflow/DropHelper.h" #include "deskflow/DropHelper.h"
#include "deskflow/FileChunk.h" #include "deskflow/FileChunk.h"
@ -35,6 +34,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include <stdexcept>
using namespace deskflow::server; using namespace deskflow::server;

View file

@ -14,7 +14,6 @@
#include "base/TMethodEventJob.h" #include "base/TMethodEventJob.h"
#include "base/TMethodJob.h" #include "base/TMethodJob.h"
#include "client/Client.h" #include "client/Client.h"
#include "common/StdExcept.h"
#include "deskflow/FileChunk.h" #include "deskflow/FileChunk.h"
#include "deskflow/StreamChunker.h" #include "deskflow/StreamChunker.h"
#include "mt/Thread.h" #include "mt/Thread.h"
@ -33,6 +32,7 @@
#include <fstream> #include <fstream>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <iostream> #include <iostream>
#include <stdexcept>
#include <stdio.h> #include <stdio.h>
using namespace std; using namespace std;

View file

@ -7,7 +7,8 @@
#include "test/shared/TestEventQueue.h" #include "test/shared/TestEventQueue.h"
#include "base/TMethodEventJob.h" #include "base/TMethodEventJob.h"
#include "common/StdExcept.h"
#include <stdexcept>
void TestEventQueue::raiseQuitEvent() void TestEventQueue::raiseQuitEvent()
{ {