From 5a073db9fee6650738c5d4e109630b55acf9cd30 Mon Sep 17 00:00:00 2001 From: sjn Date: Wed, 2 Feb 2022 19:35:37 -0800 Subject: [PATCH] cleaned up namespaces --- src/json/json_spirit_reader.cpp | 48 ++++++++++++++++----------------- src/qt/qtipcserver.cpp | 22 +++++++-------- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/src/json/json_spirit_reader.cpp b/src/json/json_spirit_reader.cpp index aa4f637..bf79bb4 100644 --- a/src/json/json_spirit_reader.cpp +++ b/src/json/json_spirit_reader.cpp @@ -8,128 +8,128 @@ using namespace json_spirit; -bool json_spirit::read( const std::string& s, Value& value ) +bool json_spirit::read( const std::string& s, json_spirit::Value& value ) { return read_string( s, value ); } -void json_spirit::read_or_throw( const std::string& s, Value& value ) +void json_spirit::read_or_throw( const std::string& s, json_spirit::Value& value ) { read_string_or_throw( s, value ); } -bool json_spirit::read( std::istream& is, Value& value ) +bool json_spirit::read( std::istream& is, json_spirit::Value& value ) { return read_stream( is, value ); } -void json_spirit::read_or_throw( std::istream& is, Value& value ) +void json_spirit::read_or_throw( std::istream& is, json_spirit::Value& value ) { read_stream_or_throw( is, value ); } -bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) +bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::Value& value ) { return read_range( begin, end, value ); } -void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) +void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::Value& value ) { begin = read_range_or_throw( begin, end, value ); } #ifndef BOOST_NO_STD_WSTRING -bool json_spirit::read( const std::wstring& s, wValue& value ) +bool json_spirit::read( const std::wstring& s, json_spirit::wValue& value ) { return read_string( s, value ); } -void json_spirit::read_or_throw( const std::wstring& s, wValue& value ) +void json_spirit::read_or_throw( const std::wstring& s, json_spirit::wValue& value ) { read_string_or_throw( s, value ); } -bool json_spirit::read( std::wistream& is, wValue& value ) +bool json_spirit::read( std::wistream& is, json_spirit::wValue& value ) { return read_stream( is, value ); } -void json_spirit::read_or_throw( std::wistream& is, wValue& value ) +void json_spirit::read_or_throw( std::wistream& is, json_spirit::wValue& value ) { read_stream_or_throw( is, value ); } -bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) +bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wValue& value ) { return read_range( begin, end, value ); } -void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) +void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wValue& value ) { begin = read_range_or_throw( begin, end, value ); } #endif -bool json_spirit::read( const std::string& s, mValue& value ) +bool json_spirit::read( const std::string& s, json_spirit::mValue& value ) { return read_string( s, value ); } -void json_spirit::read_or_throw( const std::string& s, mValue& value ) +void json_spirit::read_or_throw( const std::string& s, json_spirit::mValue& value ) { read_string_or_throw( s, value ); } -bool json_spirit::read( std::istream& is, mValue& value ) +bool json_spirit::read( std::istream& is, json_spirit::mValue& value ) { return read_stream( is, value ); } -void json_spirit::read_or_throw( std::istream& is, mValue& value ) +void json_spirit::read_or_throw( std::istream& is, json_spirit::mValue& value ) { read_stream_or_throw( is, value ); } -bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) +bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::mValue& value ) { return read_range( begin, end, value ); } -void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) +void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::mValue& value ) { begin = read_range_or_throw( begin, end, value ); } #ifndef BOOST_NO_STD_WSTRING -bool json_spirit::read( const std::wstring& s, wmValue& value ) +bool json_spirit::read( const std::wstring& s, json_spirit::wmValue& value ) { return read_string( s, value ); } -void json_spirit::read_or_throw( const std::wstring& s, wmValue& value ) +void json_spirit::read_or_throw( const std::wstring& s, json_spirit::wmValue& value ) { read_string_or_throw( s, value ); } -bool json_spirit::read( std::wistream& is, wmValue& value ) +bool json_spirit::read( std::wistream& is, json_spirit::wmValue& value ) { return read_stream( is, value ); } -void json_spirit::read_or_throw( std::wistream& is, wmValue& value ) +void json_spirit::read_or_throw( std::wistream& is, json_spirit::wmValue& value ) { read_stream_or_throw( is, value ); } -bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) +bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wmValue& value ) { return read_range( begin, end, value ); } -void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) +void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wmValue& value ) { begin = read_range_or_throw( begin, end, value ); } diff --git a/src/qt/qtipcserver.cpp b/src/qt/qtipcserver.cpp index 392d015..4bd0195 100644 --- a/src/qt/qtipcserver.cpp +++ b/src/qt/qtipcserver.cpp @@ -22,10 +22,6 @@ #warning Compiling without BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME and BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME uncommented in boost/interprocess/detail/tmp_dir_helpers.hpp or using a boost version before 1.49 may have unintended results see svn.boost.org/trac/boost/ticket/5392 #endif -using namespace boost; -using namespace boost::interprocess; -using namespace boost::posix_time; - #if defined MAC_OSX || defined __FreeBSD__ // URI handling not implemented on OSX yet @@ -93,14 +89,14 @@ static void ipcThread2(void* pArg) { printf("ipcThread started\n"); - message_queue* mq = (message_queue*)pArg; + boost::interprocess::message_queue* mq = (boost::interprocess::message_queue*)pArg; char buffer[MAX_URI_LENGTH + 1] = ""; size_t nSize = 0; unsigned int nPriority = 0; while (true) { - ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(100); + boost::posix_time::ptime d = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::millisec(100); if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d)) { uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize)); @@ -112,25 +108,25 @@ static void ipcThread2(void* pArg) } // Remove message queue - message_queue::remove(curecoinURI_QUEUE_NAME); + boost::interprocess::message_queue::remove(curecoinURI_QUEUE_NAME); // Cleanup allocated memory delete mq; } void ipcInit(int argc, char *argv[]) { - message_queue* mq = NULL; + boost::interprocess::message_queue* mq = NULL; char buffer[MAX_URI_LENGTH + 1] = ""; size_t nSize = 0; unsigned int nPriority = 0; try { - mq = new message_queue(open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH); + mq = new boost::interprocess::message_queue(boost::interprocess::open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH); // Make sure we don't lose any curecoin: URIs for (int i = 0; i < 2; i++) { - ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(1); + boost::posix_time::ptime d = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::millisec(1); if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d)) { uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize)); @@ -140,12 +136,12 @@ void ipcInit(int argc, char *argv[]) } // Make sure only one curecoin instance is listening - message_queue::remove(curecoinURI_QUEUE_NAME); + boost::interprocess::message_queue::remove(curecoinURI_QUEUE_NAME); delete mq; - mq = new message_queue(open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH); + mq = new boost::interprocess::message_queue(boost::interprocess::open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH); } - catch (interprocess_exception &ex) { + catch (boost::interprocess::interprocess_exception &ex) { printf("ipcInit() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what()); return; }