From f734363ee32eea222e3cdb6b8493d740924f1ad3 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 23 Feb 2014 14:52:19 +0400 Subject: [PATCH] Removed register storage specifier as it causes warnings on newer clang versions. --- .../boost/log/attributes/attribute_set.hpp | 2 +- .../log/attributes/attribute_value_set.hpp | 2 +- include/boost/log/attributes/counter.hpp | 4 ++-- .../log/detail/attachable_sstream_buf.hpp | 8 +++---- include/boost/log/detail/light_function.hpp | 4 ++-- .../boost/log/detail/light_function_pp.hpp | 4 ++-- include/boost/log/detail/locking_ptr.hpp | 2 +- include/boost/log/detail/snprintf.hpp | 8 +++---- include/boost/log/detail/spin_mutex.hpp | 4 ++-- include/boost/log/detail/threadsafe_queue.hpp | 2 +- .../expressions/formatters/c_decorator.hpp | 2 +- include/boost/log/sinks/async_frontend.hpp | 2 +- include/boost/log/utility/string_literal.hpp | 11 +++++----- .../boost/log/utility/type_info_wrapper.hpp | 2 +- src/atomic_queue.hpp | 22 +++++++++---------- src/attribute_set_impl.hpp | 8 +++---- src/attribute_value_set.cpp | 6 ++--- src/core.cpp | 6 ++--- src/named_scope.cpp | 12 +++++----- src/record_ostream.cpp | 6 ++--- src/syslog_backend.cpp | 2 +- src/text_ostream_backend.cpp | 4 ++-- 22 files changed, 61 insertions(+), 62 deletions(-) diff --git a/include/boost/log/attributes/attribute_set.hpp b/include/boost/log/attributes/attribute_set.hpp index 80bd9da..5481c09 100644 --- a/include/boost/log/attributes/attribute_set.hpp +++ b/include/boost/log/attributes/attribute_set.hpp @@ -285,7 +285,7 @@ public: */ void swap(attribute_set& that) BOOST_NOEXCEPT { - register implementation* const p = m_pImpl; + implementation* const p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } diff --git a/include/boost/log/attributes/attribute_value_set.hpp b/include/boost/log/attributes/attribute_value_set.hpp index fe5fc4a..0ca6359 100644 --- a/include/boost/log/attributes/attribute_value_set.hpp +++ b/include/boost/log/attributes/attribute_value_set.hpp @@ -311,7 +311,7 @@ public: */ void swap(attribute_value_set& that) BOOST_NOEXCEPT { - register implementation* const p = m_pImpl; + implementation* const p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } diff --git a/include/boost/log/attributes/counter.hpp b/include/boost/log/attributes/counter.hpp index 41accd4..a472271 100644 --- a/include/boost/log/attributes/counter.hpp +++ b/include/boost/log/attributes/counter.hpp @@ -128,8 +128,8 @@ public: attribute_value get_value() { - register unsigned long next_counter = static_cast< unsigned long >(++m_Counter); - register value_type next = static_cast< value_type >(m_Initial + (next_counter * m_Step)); + const unsigned long next_counter = static_cast< unsigned long >(++m_Counter); + value_type next = static_cast< value_type >(m_Initial + (next_counter * m_Step)); return make_attribute_value(next); } }; diff --git a/include/boost/log/detail/attachable_sstream_buf.hpp b/include/boost/log/detail/attachable_sstream_buf.hpp index ce40956..35ba841 100644 --- a/include/boost/log/detail/attachable_sstream_buf.hpp +++ b/include/boost/log/detail/attachable_sstream_buf.hpp @@ -82,8 +82,8 @@ public: //! Clears the buffer to the initial state void clear() { - register char_type* pBase = this->pbase(); - register char_type* pPtr = this->pptr(); + char_type* pBase = this->pbase(); + char_type* pPtr = this->pptr(); if (pBase != pPtr) this->pbump(static_cast< int >(pBase - pPtr)); } @@ -113,8 +113,8 @@ protected: int sync() { BOOST_ASSERT(m_Storage != 0); - register char_type* pBase = this->pbase(); - register char_type* pPtr = this->pptr(); + char_type* pBase = this->pbase(); + char_type* pPtr = this->pptr(); if (pBase != pPtr) { m_Storage->append(pBase, pPtr); diff --git a/include/boost/log/detail/light_function.hpp b/include/boost/log/detail/light_function.hpp index 75de85d..a85e450 100644 --- a/include/boost/log/detail/light_function.hpp +++ b/include/boost/log/detail/light_function.hpp @@ -258,7 +258,7 @@ public: void swap(this_type& that) BOOST_NOEXCEPT { - register impl_base* p = m_pImpl; + impl_base* p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } @@ -458,7 +458,7 @@ public: void swap(this_type& that) BOOST_NOEXCEPT { - register impl_base* p = m_pImpl; + impl_base* p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } diff --git a/include/boost/log/detail/light_function_pp.hpp b/include/boost/log/detail/light_function_pp.hpp index d75bce3..0b1aaa7 100644 --- a/include/boost/log/detail/light_function_pp.hpp +++ b/include/boost/log/detail/light_function_pp.hpp @@ -203,7 +203,7 @@ public: void swap(this_type& that) BOOST_NOEXCEPT { - register impl_base* p = m_pImpl; + impl_base* p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } @@ -405,7 +405,7 @@ public: void swap(this_type& that) BOOST_NOEXCEPT { - register impl_base* p = m_pImpl; + impl_base* p = m_pImpl; m_pImpl = that.m_pImpl; that.m_pImpl = p; } diff --git a/include/boost/log/detail/locking_ptr.hpp b/include/boost/log/detail/locking_ptr.hpp index 9633c12..04f4f43 100644 --- a/include/boost/log/detail/locking_ptr.hpp +++ b/include/boost/log/detail/locking_ptr.hpp @@ -127,7 +127,7 @@ public: void swap(locking_ptr& that) { m_pElement.swap(that.m_pElement); - register locking_ptr_counter_base* p = m_pLock; + locking_ptr_counter_base* p = m_pLock; m_pLock = that.m_pLock; that.m_pLock = p; } diff --git a/include/boost/log/detail/snprintf.hpp b/include/boost/log/detail/snprintf.hpp index 8b01570..29cc7d0 100644 --- a/include/boost/log/detail/snprintf.hpp +++ b/include/boost/log/detail/snprintf.hpp @@ -68,7 +68,7 @@ inline int vswprintf(wchar_t* buf, std::size_t size, const wchar_t* format, std: // MSVC prior to 2005 had a non-conforming extension _vsnprintf, that sometimes did not put a terminating '\0' inline int vsnprintf(char* buf, std::size_t size, const char* format, std::va_list args) { - register int n = _vsnprintf(buf, size - 1, format, args); + int n = _vsnprintf(buf, size - 1, format, args); buf[size - 1] = '\0'; return n; } @@ -76,7 +76,7 @@ inline int vsnprintf(char* buf, std::size_t size, const char* format, std::va_li # ifdef BOOST_LOG_USE_WCHAR_T inline int vswprintf(wchar_t* buf, std::size_t size, const wchar_t* format, std::va_list args) { - register int n = _vsnwprintf(buf, size - 1, format, args); + int n = _vsnwprintf(buf, size - 1, format, args); buf[size - 1] = L'\0'; return n; } @@ -88,7 +88,7 @@ inline int snprintf(char* buf, std::size_t size, const char* format, ...) { std::va_list args; va_start(args, format); - register int n = vsnprintf(buf, size, format, args); + int n = vsnprintf(buf, size, format, args); va_end(args); return n; } @@ -98,7 +98,7 @@ inline int swprintf(wchar_t* buf, std::size_t size, const wchar_t* format, ...) { std::va_list args; va_start(args, format); - register int n = vswprintf(buf, size, format, args); + int n = vswprintf(buf, size, format, args); va_end(args); return n; } diff --git a/include/boost/log/detail/spin_mutex.hpp b/include/boost/log/detail/spin_mutex.hpp index fc46fe8..727d6d1 100644 --- a/include/boost/log/detail/spin_mutex.hpp +++ b/include/boost/log/detail/spin_mutex.hpp @@ -120,14 +120,14 @@ public: void lock() { #if defined(BOOST_LOG_PAUSE_OP) - register unsigned int pause_count = initial_pause; + unsigned int pause_count = initial_pause; #endif while (!try_lock()) { #if defined(BOOST_LOG_PAUSE_OP) if (pause_count < max_pause) { - for (register unsigned int i = 0; i < pause_count; ++i) + for (unsigned int i = 0; i < pause_count; ++i) { BOOST_LOG_PAUSE_OP; } diff --git a/include/boost/log/detail/threadsafe_queue.hpp b/include/boost/log/detail/threadsafe_queue.hpp index 008ef46..a1e7824 100644 --- a/include/boost/log/detail/threadsafe_queue.hpp +++ b/include/boost/log/detail/threadsafe_queue.hpp @@ -246,7 +246,7 @@ public: threadsafe_queue_impl::node_base *dealloc, *destr; if (m_pImpl->try_pop(dealloc, destr)) { - register node* p = static_cast< node* >(destr); + node* p = static_cast< node* >(destr); auto_deallocate guard(static_cast< base_type* >(this), static_cast< node* >(dealloc), p); value = boost::move(p->value()); return true; diff --git a/include/boost/log/expressions/formatters/c_decorator.hpp b/include/boost/log/expressions/formatters/c_decorator.hpp index 2d0d5cf..eea835f 100644 --- a/include/boost/log/expressions/formatters/c_decorator.hpp +++ b/include/boost/log/expressions/formatters/c_decorator.hpp @@ -90,7 +90,7 @@ struct c_decorator_traits< wchar_t > static std::size_t print_escaped(wchar_t (&buf)[N], wchar_t c) { const wchar_t* format; - register unsigned int val; + unsigned int val; if (sizeof(wchar_t) == 1) { format = L"\\x%0.2X"; diff --git a/include/boost/log/sinks/async_frontend.hpp b/include/boost/log/sinks/async_frontend.hpp index be3a13e..2925a91 100644 --- a/include/boost/log/sinks/async_frontend.hpp +++ b/include/boost/log/sinks/async_frontend.hpp @@ -436,7 +436,7 @@ private: while (!m_StopRequested) { record_view rec; - register bool dequeued = false; + bool dequeued = false; if (!m_FlushRequested) dequeued = queue_base_type::try_dequeue_ready(rec); else diff --git a/include/boost/log/utility/string_literal.hpp b/include/boost/log/utility/string_literal.hpp index 7864d01..ae81ad8 100644 --- a/include/boost/log/utility/string_literal.hpp +++ b/include/boost/log/utility/string_literal.hpp @@ -332,11 +332,11 @@ public: */ void swap(this_type& that) BOOST_NOEXCEPT { - register const_pointer p = m_pStart; + const_pointer p = m_pStart; m_pStart = that.m_pStart; that.m_pStart = p; - register size_type l = m_Len; + size_type l = m_Len; m_Len = that.m_Len; that.m_Len = l; } @@ -392,7 +392,7 @@ public: if (pos > m_Len) BOOST_THROW_EXCEPTION(std::out_of_range("basic_string_literal::copy: the position is out of range")); - register size_type len = m_Len - pos; + size_type len = m_Len - pos; if (len > n) len = n; traits_type::copy(str, m_pStart + pos, len); @@ -417,7 +417,7 @@ public: if (pos > m_Len) BOOST_THROW_EXCEPTION(std::out_of_range("basic_string_literal::compare: the position is out of range")); - register size_type compare_size = m_Len - pos; + size_type compare_size = m_Len - pos; if (compare_size > len) compare_size = len; if (compare_size > n) @@ -498,8 +498,7 @@ private: { if (pLeft != pRight) { - register const int result = traits_type::compare( - pLeft, pRight, (LeftLen < RightLen ? LeftLen : RightLen)); + const int result = traits_type::compare(pLeft, pRight, (LeftLen < RightLen ? LeftLen : RightLen)); if (result != 0) return result; } diff --git a/include/boost/log/utility/type_info_wrapper.hpp b/include/boost/log/utility/type_info_wrapper.hpp index d8713fc..3c0d9dc 100644 --- a/include/boost/log/utility/type_info_wrapper.hpp +++ b/include/boost/log/utility/type_info_wrapper.hpp @@ -108,7 +108,7 @@ public: */ void swap(type_info_wrapper& that) { - register std::type_info const* temp = info; + std::type_info const* temp = info; info = that.info; that.info = temp; } diff --git a/src/atomic_queue.hpp b/src/atomic_queue.hpp index 964d7ce..a64105a 100644 --- a/src/atomic_queue.hpp +++ b/src/atomic_queue.hpp @@ -140,10 +140,10 @@ public: //! Destructor. Destroys all contained elements, if any. ~atomic_queue() { - register node* p = m_Impl.m_pLast; + node* p = m_Impl.m_pLast; while (p != NULL) { - register node* prev = p->m_pPrev; + node* prev = p->m_pPrev; delete p; p = prev; } @@ -154,15 +154,15 @@ public: { #if !defined(BOOST_LOG_CAS_PTR) - register node* p = new node(val); + node* p = new node(val); lock_guard< spin_mutex > _(m_Impl.m_Mutex); p->m_pPrev = m_Impl.m_pLast; m_Impl.m_pLast = p; #else // !defined(BOOST_LOG_CAS_PTR) - register node* p = new node(val); - register node* last; + node* p = new node(val); + node* last; do { last = static_cast< node* volatile& >(m_Impl.m_pLast); @@ -181,7 +181,7 @@ public: unique_lock< spin_mutex > lock(m_Impl.m_Mutex, try_to_lock); if (lock) { - register node* p = new node(val); + node* p = new node(val); p->m_pPrev = m_Impl.m_pLast; m_Impl.m_pLast = p; return true; @@ -192,11 +192,11 @@ public: #else // !defined(BOOST_LOG_CAS_PTR) /* - register node* p = new node(val); - register node* last; + node* p = new node(val); + node* last; last = static_cast< node* volatile& >(m_Impl.m_pLast); p->m_pPrev = last; - register bool done = BOOST_LOG_CAS_PTR(last, p, &m_Impl.m_pLast); + bool done = BOOST_LOG_CAS_PTR(last, p, &m_Impl.m_pLast); if (!done) delete p; return done; @@ -212,7 +212,7 @@ public: //! Removes all elements from the queue and returns a reference to the first element. std::pair< node*, node* > eject_nodes() { - register node* p; + node* p; #if !defined(BOOST_LOG_CAS_PTR) @@ -236,7 +236,7 @@ public: std::pair< node*, node* > res(static_cast< node* >(NULL), p); if (p) { - for (register node* prev = p->m_pPrev; prev != NULL; prev = p->m_pPrev) + for (node* prev = p->m_pPrev; prev != NULL; prev = p->m_pPrev) { prev->m_pNext = p; p = prev; diff --git a/src/attribute_set_impl.hpp b/src/attribute_set_impl.hpp index e825493..3a6f32b 100644 --- a/src/attribute_set_impl.hpp +++ b/src/attribute_set_impl.hpp @@ -93,7 +93,7 @@ public: ~pool_allocator() { - for (register size_type i = 0; i < m_PooledCount; ++i) + for (size_type i = 0; i < m_PooledCount; ++i) { base_type::deallocate(m_Pool[i], 1); } @@ -264,7 +264,7 @@ public: BOOST_ASSERT(!!key); bucket& b = get_bucket(key.id()); - register node* p = b.first; + node* p = b.first; if (p) { // The bucket is not empty, search among the elements @@ -335,7 +335,7 @@ public: iterator find(key_type key) { bucket& b = get_bucket(key.id()); - register node* p = b.first; + node* p = b.first; if (p) { // The bucket is not empty, search among the elements @@ -363,7 +363,7 @@ private: typedef node_list::value_traits value_traits; // All elements within the bucket are sorted to speedup the search. - register node* p = b.first; + node* p = b.first; while (p != b.last && p->m_Value.first.id() < key.id()) { p = value_traits::to_value_ptr(node_traits::get_next(p)); diff --git a/src/attribute_value_set.cpp b/src/attribute_value_set.cpp index f524b8e..6397f59 100644 --- a/src/attribute_value_set.cpp +++ b/src/attribute_value_set.cpp @@ -267,7 +267,7 @@ public: { // First try to find an acquired element bucket& b = get_bucket(key.id()); - register node* p = b.first; + node* p = b.first; if (p) { // The bucket is not empty, search among the elements @@ -330,7 +330,7 @@ private: typedef node_list::value_traits value_traits; // All elements within the bucket are sorted to speedup the search. - register node* p = b.first; + node* p = b.first; while (p != b.last && p->m_Value.first.id() < key.id()) { p = value_traits::to_value_ptr(node_traits::get_next(p)); @@ -423,7 +423,7 @@ private: { key_type key = it->first; bucket& b = get_bucket(key.id()); - register node* p = b.first; + node* p = b.first; if (p) { p = find_in_bucket(key, b); diff --git a/src/core.cpp b/src/core.cpp index d1b38da..a148374 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -602,7 +602,7 @@ BOOST_LOG_API void core::push_record_move(record& rec) typedef std::vector< shared_ptr< sinks::sink > > accepting_sinks_t; accepting_sinks_t accepting_sinks(data->accepting_sink_count()); shared_ptr< sinks::sink >* const begin = &*accepting_sinks.begin(); - register shared_ptr< sinks::sink >* end = begin; + shared_ptr< sinks::sink >* end = begin; // Lock sinks that are willing to consume the record record_view::private_data::sink_list weak_sinks = data->get_accepting_sinks(); @@ -618,11 +618,11 @@ BOOST_LOG_API void core::push_record_move(record& rec) } bool shuffled = (end - begin) <= 1; - register shared_ptr< sinks::sink >* it = begin; + shared_ptr< sinks::sink >* it = begin; while (true) try { // First try to distribute load between different sinks - register bool all_locked = true; + bool all_locked = true; while (it != end) { if (it->get()->try_consume(rec_view)) diff --git a/src/named_scope.cpp b/src/named_scope.cpp index ece3a06..f1cf41c 100644 --- a/src/named_scope.cpp +++ b/src/named_scope.cpp @@ -49,7 +49,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { //! The method pushes the scope to the back of the list BOOST_FORCEINLINE void push_back(const_reference entry) BOOST_NOEXCEPT { - register aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; + aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; entry._m_pPrev = top; entry._m_pNext = &this->m_RootNode; @@ -63,7 +63,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { //! The method removes the top scope entry from the list BOOST_FORCEINLINE void pop_back() BOOST_NOEXCEPT { - register aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; + aux::named_scope_list_node* top = this->m_RootNode._m_pPrev; top->_m_pPrev->_m_pNext = top->_m_pNext; top->_m_pNext->_m_pPrev = top->_m_pPrev; --this->m_Size; @@ -157,9 +157,9 @@ struct BOOST_SYMBOL_VISIBLE named_scope::impl : scope_list& get_scope_list() { #if defined(BOOST_LOG_USE_COMPILER_TLS) - register scope_list* p = pScopesCache; + scope_list* p = pScopesCache; #else - register scope_list* p = pScopes.get(); + scope_list* p = pScopes.get(); #endif if (!p) { @@ -207,8 +207,8 @@ BOOST_LOG_API named_scope_list::named_scope_list(named_scope_list const& that) : if (m_Size > 0) { // Copy the container contents - register pointer p = allocator_type::allocate(that.size()); - register aux::named_scope_list_node* prev = &m_RootNode; + pointer p = allocator_type::allocate(that.size()); + aux::named_scope_list_node* prev = &m_RootNode; for (const_iterator src = that.begin(), end = that.end(); src != end; ++src, ++p) { allocator_type::construct(p, *src); // won't throw diff --git a/src/record_ostream.cpp b/src/record_ostream.cpp index 37153c2..5d9e95f 100644 --- a/src/record_ostream.cpp +++ b/src/record_ostream.cpp @@ -99,7 +99,7 @@ public: ~stream_compound_pool() { - register stream_compound_t* p = NULL; + stream_compound_t* p = NULL; while ((p = m_Top) != NULL) { m_Top = p->next; @@ -111,7 +111,7 @@ public: static stream_compound_pool& get() { tls_ptr_type& ptr = base_type::get(); - register this_type* p = ptr.get(); + this_type* p = ptr.get(); if (!p) { std::auto_ptr< this_type > pNew(new this_type()); @@ -135,7 +135,7 @@ stream_provider< CharT >::allocate_compound(record& rec) stream_compound_pool< char_type >& pool = stream_compound_pool< char_type >::get(); if (pool.m_Top) { - register stream_compound* p = pool.m_Top; + stream_compound* p = pool.m_Top; pool.m_Top = p->next; p->next = NULL; p->stream.attach_record(rec); diff --git a/src/syslog_backend.cpp b/src/syslog_backend.cpp index 1bcb410..75bcadf 100644 --- a/src/syslog_backend.cpp +++ b/src/syslog_backend.cpp @@ -271,7 +271,7 @@ private: LOG_LOCAL7 }; - register std::size_t n = static_cast< unsigned int >(fac) / 8U; + std::size_t n = static_cast< unsigned int >(fac) / 8U; BOOST_ASSERT(n < sizeof(native_facilities) / sizeof(*native_facilities)); return native_facilities[n]; } diff --git a/src/text_ostream_backend.cpp b/src/text_ostream_backend.cpp index 7ddd871..f55df12 100644 --- a/src/text_ostream_backend.cpp +++ b/src/text_ostream_backend.cpp @@ -94,7 +94,7 @@ BOOST_LOG_API void basic_text_ostream_backend< CharT >::consume(record_view cons it = m_pImpl->m_Streams.begin(), end = m_pImpl->m_Streams.end(); for (; it != end; ++it) { - register stream_type* const strm = it->get(); + stream_type* const strm = it->get(); if (strm->good()) { strm->write(p, static_cast< std::streamsize >(s)); @@ -114,7 +114,7 @@ BOOST_LOG_API void basic_text_ostream_backend< CharT >::flush() it = m_pImpl->m_Streams.begin(), end = m_pImpl->m_Streams.end(); for (; it != end; ++it) { - register stream_type* const strm = it->get(); + stream_type* const strm = it->get(); if (strm->good()) strm->flush(); }