diff --git a/cppcms/cache_interface.h b/cppcms/cache_interface.h index a5c6ae2..356e1fb 100644 --- a/cppcms/cache_interface.h +++ b/cppcms/cache_interface.h @@ -342,7 +342,7 @@ namespace cppcms { booster::intrusive_ptr cache_module_; uint32_t page_compression_used_ : 1; - uint32_t reserved : 31; + CPPCMS_UNUSED_MEMBER uint32_t reserved : 31; }; diff --git a/cppcms/defs.h b/cppcms/defs.h index 8363079..8dfd6b8 100644 --- a/cppcms/defs.h +++ b/cppcms/defs.h @@ -45,4 +45,17 @@ #define CPPCMS_DEPRECATED #endif +#if defined __GNUC__ || defined __clang__ +#define CPPCMS_UNUSED __attribute__((unused)) +#else +#define CPPCMS_UNUSED +#endif + +#if defined __clang__ +#define CPPCMS_UNUSED_MEMBER __attribute__((unused)) +#else +#define CPPCMS_UNUSED_MEMBER +#endif + + #endif /// CPPCMS_DEFS_H diff --git a/cppcms/form.h b/cppcms/form.h index d6f42ca..33e5a6b 100644 --- a/cppcms/form.h +++ b/cppcms/form.h @@ -153,8 +153,8 @@ namespace cppcms { uint32_t html_list_type_; uint32_t widget_part_type_; std::ostream *output_; - uint32_t reserved_1; - uint32_t reserved_2; + CPPCMS_UNUSED_MEMBER uint32_t reserved_1; + CPPCMS_UNUSED_MEMBER uint32_t reserved_2; struct _data; booster::hold_ptr<_data> d; @@ -703,7 +703,7 @@ namespace cppcms { uint32_t has_message_ : 1; uint32_t has_error_ : 1; uint32_t has_help_ : 1; - uint32_t reserverd_ : 24; + CPPCMS_UNUSED_MEMBER uint32_t reserverd_ : 24; struct _data; booster::hold_ptr<_data> d; @@ -1324,7 +1324,7 @@ namespace cppcms { uint32_t selected : 1; uint32_t need_translation : 1; uint32_t original_select : 1; - uint32_t reserved : 29; + CPPCMS_UNUSED_MEMBER uint32_t reserved : 29; std::string id; std::string str_option; locale::message tr_option; @@ -1411,7 +1411,7 @@ namespace cppcms { ~element(); uint32_t need_translation : 1; - uint32_t reserved : 31; + CPPCMS_UNUSED_MEMBER uint32_t reserved : 31; std::string id; std::string str_option; locale::message tr_option; @@ -1432,7 +1432,7 @@ namespace cppcms { int default_selected_; uint32_t non_empty_ : 1; - uint32_t reserverd : 32; + CPPCMS_UNUSED_MEMBER uint32_t reserverd : 32; }; /// @@ -1474,7 +1474,7 @@ namespace cppcms { private: uint32_t vertical_ : 1; - uint32_t reserved_ : 31; + CPPCMS_UNUSED_MEMBER uint32_t reserved_ : 31; struct _data; booster::hold_ptr<_data> d; @@ -1573,7 +1573,7 @@ namespace cppcms { uint32_t check_charset_ : 1; uint32_t check_non_empty_ : 1; - uint32_t reserved_ : 30; + CPPCMS_UNUSED_MEMBER uint32_t reserved_ : 30; booster::shared_ptr file_; diff --git a/cppcms/http_content_filter.h b/cppcms/http_content_filter.h index 73b79b5..f28c8f7 100644 --- a/cppcms/http_content_filter.h +++ b/cppcms/http_content_filter.h @@ -17,7 +17,7 @@ namespace cppcms { namespace impl { - class cached_settings; + struct cached_settings; } namespace http { diff --git a/cppcms/http_cookie.h b/cppcms/http_cookie.h index 315b7ff..627c43e 100644 --- a/cppcms/http_cookie.h +++ b/cppcms/http_cookie.h @@ -165,7 +165,7 @@ private: uint32_t secure_ : 1; uint32_t has_age_ : 1; uint32_t has_expiration_: 1; - uint32_t reserved_ : 29; + CPPCMS_UNUSED_MEMBER uint32_t reserved_ : 29; }; diff --git a/private/basic_allocator.h b/private/basic_allocator.h index d1ec2ed..96c9924 100644 --- a/private/basic_allocator.h +++ b/private/basic_allocator.h @@ -69,7 +69,7 @@ public : { return true; } - bool operator!=(basic_allocator const& a) const + bool operator!=(basic_allocator const&) const { return false; } diff --git a/private/buddy_allocator.h b/private/buddy_allocator.h index ba88477..a0628f6 100644 --- a/private/buddy_allocator.h +++ b/private/buddy_allocator.h @@ -8,6 +8,7 @@ #ifndef CPPCMS_PRIVATE_BUDDY_ALLOCATOR_H #define CPPCMS_PRIVATE_BUDDY_ALLOCATOR_H +#include #include #include #include @@ -314,7 +315,7 @@ private: page *free_list_[sizeof(void*)*8]; // 16 always size_t memory_size_; int max_bit_size_; // at least sizeof(size_t) - size_t padding_for_alignment_[2]; + CPPCMS_UNUSED_MEMBER size_t padding_for_alignment_[2]; }; } // impl } // cppcms diff --git a/private/session_posix_file_storage.h b/private/session_posix_file_storage.h index d7142e6..f5e2c75 100644 --- a/private/session_posix_file_storage.h +++ b/private/session_posix_file_storage.h @@ -29,7 +29,7 @@ namespace sessions { virtual void remove(std::string const &sid); virtual bool is_blocking(); private: - struct locked_file; + class locked_file; struct _data; bool read_timestamp(int fd); bool read_from_file(int fd,time_t &timeout,std::string &data); @@ -54,7 +54,7 @@ namespace sessions { std::vector mutexes_; // friends - friend struct locked_file; + friend class locked_file; friend class session_file_storage_factory; }; diff --git a/tests/pool_test.cpp b/tests/pool_test.cpp index a0e685e..99e7190 100644 --- a/tests/pool_test.cpp +++ b/tests/pool_test.cpp @@ -214,8 +214,7 @@ public: }; sender(cppcms::service &srv,pools *p) : cppcms::application(srv), - pools_(p), - first_time_(true) + pools_(p) { } @@ -265,7 +264,6 @@ public: } private: pools *pools_; - bool first_time_; }; int main(int argc,char **argv)