Browse Source

Cleanup of auto_ptr and some other warnings

master
Artyom Beilis 7 years ago
parent
commit
d1de6e5074
50 changed files with 83 additions and 62 deletions
  1. +1
    -1
      booster/booster/aio/io_service.h
  2. +1
    -1
      booster/booster/aio/reactor.h
  3. +21
    -0
      booster/booster/auto_ptr_inc.h
  4. +1
    -1
      booster/booster/callback.h
  5. +12
    -0
      booster/booster/config.h
  6. +1
    -1
      booster/booster/locale/generator.h
  7. +1
    -1
      booster/booster/locale/localization_backend.h
  8. +1
    -1
      booster/booster/locale/message.h
  9. +3
    -3
      booster/booster/log.h
  10. +1
    -1
      booster/booster/nowide/fstream.h
  11. +1
    -1
      booster/booster/shared_ptr.h
  12. +1
    -1
      booster/booster/smart_ptr/shared_count.h
  13. +1
    -1
      booster/booster/smart_ptr/sp_counted_impl.h
  14. +1
    -1
      booster/booster/streambuf.h
  15. +3
    -3
      booster/booster/system_error.h
  16. +1
    -1
      booster/booster/weak_ptr.h
  17. +0
    -1
      booster/lib/aio/src/stream_socket.cpp
  18. +1
    -1
      booster/lib/locale/src/encoding/codepage.cpp
  19. +1
    -1
      booster/lib/locale/src/icu/codecvt.h
  20. +1
    -1
      booster/lib/locale/src/icu/date_time.cpp
  21. +1
    -1
      booster/lib/locale/src/icu/formatter.h
  22. +1
    -1
      booster/lib/locale/src/icu/predefined_formatters.h
  23. +1
    -1
      booster/lib/locale/src/icu/time_zone.cpp
  24. +1
    -1
      booster/lib/locale/src/icu/uconv.h
  25. +1
    -1
      booster/lib/locale/src/posix/codecvt.h
  26. +0
    -11
      booster/lib/locale/src/shared/mo_lambda.cpp
  27. +1
    -1
      booster/lib/locale/src/shared/mo_lambda.h
  28. +1
    -1
      booster/lib/locale/src/util/codecvt_converter.cpp
  29. +1
    -1
      booster/lib/locale/src/util/gregorian.cpp
  30. +1
    -1
      booster/lib/thread/src/pthread.cpp
  31. +1
    -1
      cppcms/applications_pool.h
  32. +1
    -1
      cppcms/archive_traits.h
  33. +1
    -1
      cppcms/base_view.h
  34. +1
    -1
      cppcms/crypto.h
  35. +1
    -1
      cppcms/service.h
  36. +1
    -1
      cppcms/session_cookies.h
  37. +1
    -1
      cppcms/session_dual.h
  38. +1
    -1
      cppcms/session_interface.h
  39. +1
    -1
      cppcms/session_pool.h
  40. +1
    -1
      cppcms/views_pool.h
  41. +1
    -1
      private/fastcgi_api.h
  42. +1
    -1
      private/http_api.h
  43. +1
    -1
      private/prefork_acceptor.h
  44. +1
    -1
      private/scgi_api.h
  45. +1
    -1
      private/service_impl.h
  46. +1
    -1
      src/cache_storage.cpp
  47. +1
    -1
      src/session_win32_file_storage.cpp
  48. +1
    -1
      tests/cache_backend_test.cpp
  49. +1
    -1
      tests/cache_performance_test.cpp
  50. +1
    -1
      tests/storage_test.cpp

+ 1
- 1
booster/booster/aio/io_service.h View File

@@ -17,7 +17,7 @@
#include <booster/callback.h>
#include <booster/noncopyable.h>
#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace booster {
class ptime;


+ 1
- 1
booster/booster/aio/reactor.h View File

@@ -9,7 +9,7 @@
#define BOOSTER_AIO_REACTOR_H
#include <booster/config.h>
#include <booster/aio/types.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>
namespace booster {
namespace aio {


+ 21
- 0
booster/booster/auto_ptr_inc.h View File

@@ -0,0 +1,21 @@
//
// Copyright (C) 2009-2017 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOSTER_AUTO_PTR_INC_H
#define BOOSTER_AUTO_PTR_INC_H

#include <functional>
#if defined __GLIBCXX__
# include <bits/c++config.h>
# ifdef _GLIBCXX_DEPRECATED
# undef _GLIBCXX_DEPRECATED
# define _GLIBCXX_DEPRECATED
# endif
#endif
#include <memory>

#endif // BOOSTER_AUTO_PTR_INC_H

+ 1
- 1
booster/booster/callback.h View File

@@ -9,7 +9,7 @@
#define BOOSTER_CALLBACK_H

#include <booster/backtrace.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <booster/intrusive_ptr.h>
#include <booster/refcounted.h>



+ 12
- 0
booster/booster/config.h View File

@@ -73,5 +73,17 @@
# define BOOST_NO_SWPRINTF
#endif

#if defined __GNUC__ || defined __clang__
#define BOOSTER_UNUSED __attribute__((unused))
#else
#define BOOSTER_UNUSED
#endif

#if defined __clang__
#define BOOSTER_UNUSED_MEMBER __attribute__((unused))
#else
#define BOOSTER_UNUSED_MEMBER
#endif


#endif /// BOOSTER_CONFIG_H

+ 1
- 1
booster/booster/locale/generator.h View File

@@ -15,7 +15,7 @@
#endif
#include <string>
#include <locale>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace booster {



+ 1
- 1
booster/booster/locale/localization_backend.h View File

@@ -16,7 +16,7 @@
#include <string>
#include <locale>
#include <vector>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace booster {
namespace locale {


+ 1
- 1
booster/booster/locale/message.h View File

@@ -17,7 +17,7 @@
#include <string>
#include <vector>
#include <set>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <booster/locale/formatting.h>




+ 3
- 3
booster/booster/log.h View File

@@ -10,7 +10,7 @@

#include <booster/config.h>
#include <iosfwd>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>
#include <booster/copy_ptr.h>
#include <booster/hold_ptr.h>
@@ -338,8 +338,8 @@ namespace log {
std::string format_file(std::string const &,int);

unsigned max_files_;
size_t max_size_;
size_t current_size_;
BOOSTER_UNUSED_MEMBER size_t max_size_;
BOOSTER_UNUSED_MEMBER size_t current_size_;
bool opened_;
bool append_;
bool use_local_time_;


+ 1
- 1
booster/booster/nowide/fstream.h View File

@@ -4,7 +4,7 @@
#include <booster/config.h>
#include <booster/nowide/convert.h>
#include <fstream>
#include <memory>
#include <booster/auto_ptr_inc.h>

#if defined BOOSTER_WIN_NATIVE || defined BOOSTER_WORKAROUND_BROKEN_GCC_ON_DARWIN
#include <booster/streambuf.h>


+ 1
- 1
booster/booster/shared_ptr.h View File

@@ -16,7 +16,7 @@

#include <booster/config.h> // for broken compiler workarounds

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <cassert>
#include <booster/backtrace.h>
#include <booster/checked_delete.h>


+ 1
- 1
booster/booster/smart_ptr/shared_count.h View File

@@ -20,7 +20,7 @@
#include <booster/bad_weak_ptr.h>
#include <booster/smart_ptr/sp_counted_base.h>
#include <booster/smart_ptr/sp_counted_impl.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <functional> // std::less
#include <new> // std::bad_alloc



+ 1
- 1
booster/booster/smart_ptr/sp_counted_impl.h View File

@@ -18,7 +18,7 @@
#include <booster/smart_ptr/sp_counted_base.h>

#if defined(BOOSTER_SP_USE_STD_ALLOCATOR)
#include <memory> // std::allocator
#include <booster/auto_ptr_inc.h> // std::allocator
#endif

#include <cstddef> // std::size_t


+ 1
- 1
booster/booster/streambuf.h View File

@@ -5,7 +5,7 @@
#include <streambuf>
#include <stdio.h>
#include <booster/hold_ptr.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <vector>

namespace booster {


+ 3
- 3
booster/booster/system_error.h View File

@@ -61,16 +61,16 @@ namespace system {
};

BOOSTER_API error_category const &get_system_category();
static const error_category &system_category = get_system_category();
BOOSTER_UNUSED static const error_category &system_category = get_system_category();
#ifdef BOOSTER_WIN32
BOOSTER_API error_category const &get_windows_category();
static const error_category &windows_category = get_system_category();
BOOSTER_UNUSED static const error_category &windows_category = get_system_category();
#endif

#ifdef BOOSTER_POSIX
BOOSTER_API error_category const &get_posix_category();
static const error_category &posix_category = get_system_category();
BOOSTER_UNUSED static const error_category &posix_category = get_system_category();
#endif




+ 1
- 1
booster/booster/weak_ptr.h View File

@@ -13,7 +13,7 @@
// See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation.
//

#include <memory> // boost.TR1 include order fix
#include <booster/auto_ptr_inc.h> // boost.TR1 include order fix
#include <booster/smart_ptr/shared_count.h>
#include <booster/shared_ptr.h>



+ 0
- 1
booster/lib/aio/src/stream_socket.cpp View File

@@ -410,7 +410,6 @@ namespace {
size_t count;
stream_socket *self;
io_handler h;
bool via_poll;
};

struct writer_all : public callable<void(system::error_code const &e)>


+ 1
- 1
booster/lib/locale/src/encoding/codepage.cpp View File

@@ -26,7 +26,7 @@

#include <string>
#include <cstring>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace booster {
namespace locale {


+ 1
- 1
booster/lib/locale/src/icu/codecvt.h View File

@@ -9,7 +9,7 @@
#define BOOSTER_LOCALE_IMPL_ICU_CODECVT_HPP
#include <booster/config.h>
#include <booster/locale/util.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
namespace booster {
namespace locale {
namespace impl_icu {


+ 1
- 1
booster/lib/locale/src/icu/date_time.cpp View File

@@ -16,7 +16,7 @@
#include <unicode/gregocal.h>
#include <unicode/utypes.h>

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <math.h>

#include "cdata.h"


+ 1
- 1
booster/lib/locale/src/icu/formatter.h View File

@@ -9,7 +9,7 @@
#define BOOSTER_LOCALE_FORMATTER_H_INCLUDED

#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <booster/cstdint.h>
#include <booster/config.h>
#include <unicode/locid.h>


+ 1
- 1
booster/lib/locale/src/icu/predefined_formatters.h View File

@@ -9,7 +9,7 @@
#define BOOSTER_LOCALE_PREDEFINED_FORMATTERS_H_INCLUDED

#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <booster/cstdint.h>
#include <booster/thread.h>
#include <booster/config.h>


+ 1
- 1
booster/lib/locale/src/icu/time_zone.cpp View File

@@ -32,7 +32,7 @@
#include <fstream>
#include <pthread.h>
#include <string.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#endif

namespace booster {


+ 1
- 1
booster/lib/locale/src/icu/uconv.h View File

@@ -16,7 +16,7 @@
#include <booster/locale/encoding.h>

#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include "icu_util.h"

namespace booster {


+ 1
- 1
booster/lib/locale/src/posix/codecvt.h View File

@@ -10,7 +10,7 @@
#include <booster/config.h>
#include <booster/locale/util.h>

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>

namespace booster {


+ 0
- 11
booster/lib/locale/src/shared/mo_lambda.cpp View File

@@ -217,17 +217,6 @@ namespace { // anon
}
}

plural_ptr un_factory(int value,plural_ptr op)
{
switch(value) {
case '!': return plural_ptr(new l_not(op));
case '~': return plural_ptr(new bin_not(op));
case '-': return plural_ptr(new minus(op));
default:
return plural_ptr();
}
}

static inline bool is_in(int v,int *p)
{
int len=*p;


+ 1
- 1
booster/lib/locale/src/shared/mo_lambda.h View File

@@ -8,7 +8,7 @@
#ifndef BOOSTER_SRC_LOCALE_MO_LAMBDA_H_INCLUDED
#define BOOSTER_SRC_LOCALE_MO_LAMBDA_H_INCLUDED

#include <memory>
#include <booster/auto_ptr_inc.h>

namespace booster {
namespace locale {


+ 1
- 1
booster/lib/locale/src/util/codecvt_converter.cpp View File

@@ -627,7 +627,7 @@ namespace util {

};

static const char ensure_mbstate_size_is_at_least_2[sizeof(mbstate_t) >= 2 ? 1 : -1] = {0};
BOOSTER_UNUSED static const char ensure_mbstate_size_is_at_least_2[sizeof(mbstate_t) >= 2 ? 1 : -1] = {0};
template<>
class code_converter<char> : public std::codecvt<char,char,mbstate_t>


+ 1
- 1
booster/lib/locale/src/util/gregorian.cpp View File

@@ -17,7 +17,7 @@
#include <booster/locale/date_time.h>
#include <stdlib.h>
#include <ctime>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <algorithm>
#include <limits>



+ 1
- 1
booster/lib/thread/src/pthread.cpp View File

@@ -11,7 +11,7 @@
#include <booster/system_error.h>
#include <errno.h>
#include <string.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <vector>
#include <stack>



+ 1
- 1
cppcms/applications_pool.h View File

@@ -16,7 +16,7 @@
#include <booster/weak_ptr.h>
#include <booster/enable_shared_from_this.h>

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>

namespace cppcms {


+ 1
- 1
cppcms/archive_traits.h View File

@@ -20,7 +20,7 @@
#include <booster/traits/enable_if.h>
#include <booster/traits/is_base_of.h>

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <iterator>
#include <map>
#include <vector>


+ 1
- 1
cppcms/base_view.h View File

@@ -15,7 +15,7 @@
#include <string>
#include <map>
#include <ctime>
#include <memory>
#include <booster/auto_ptr_inc.h>

#include <booster/hold_ptr.h>
#include <cppcms/base_content.h>


+ 1
- 1
cppcms/crypto.h View File

@@ -11,7 +11,7 @@
#include <cppcms/defs.h>
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>

namespace cppcms {


+ 1
- 1
cppcms/service.h View File

@@ -13,7 +13,7 @@
#include <booster/hold_ptr.h>
#include <booster/function.h>
#include <locale>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <cppcms/locale_fwd.h>
#include <cppcms/json.h>



+ 1
- 1
cppcms/session_cookies.h View File

@@ -10,7 +10,7 @@
#include <cppcms/session_api.h>
#include <booster/hold_ptr.h>
#include <booster/noncopyable.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <string>
namespace cppcms {
class session_interface;


+ 1
- 1
cppcms/session_dual.h View File

@@ -12,7 +12,7 @@
#include <cppcms/defs.h>
#include <booster/hold_ptr.h>
#include <booster/shared_ptr.h>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace cppcms {
namespace sessions {


+ 1
- 1
cppcms/session_interface.h View File

@@ -18,7 +18,7 @@
#include <string>
#include <map>
#include <set>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <sstream>
#include <typeinfo>



+ 1
- 1
cppcms/session_pool.h View File

@@ -13,7 +13,7 @@
#include <booster/hold_ptr.h>
#include <cppcms/session_api.h>

#include <memory>
#include <booster/auto_ptr_inc.h>

namespace cppcms {
class service;


+ 1
- 1
cppcms/views_pool.h View File

@@ -13,7 +13,7 @@
#include <cppcms/base_view.h>
#include <cppcms/cppcms_error.h>

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <map>
#include <vector>
#include <ostream>


+ 1
- 1
private/fastcgi_api.h View File

@@ -10,7 +10,7 @@

#include <cppcms/defs.h>
#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace cppcms {
class service;


+ 1
- 1
private/http_api.h View File

@@ -10,7 +10,7 @@

#include <cppcms/defs.h>
#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace cppcms {
class service;


+ 1
- 1
private/prefork_acceptor.h View File

@@ -21,7 +21,7 @@
#include <sys/socket.h>

#include <algorithm>
#include <memory>
#include <booster/auto_ptr_inc.h>

#include "cgi_api.h"



+ 1
- 1
private/scgi_api.h View File

@@ -10,7 +10,7 @@

#include <cppcms/defs.h>
#include <string>
#include <memory>
#include <booster/auto_ptr_inc.h>

namespace cppcms {
class service;


+ 1
- 1
private/service_impl.h View File

@@ -13,7 +13,7 @@
#include <booster/aio/io_service.h>
#include <booster/aio/stream_socket.h>
#include <booster/shared_ptr.h>
#include <memory>
#include <booster/auto_ptr_inc.h>


namespace cppcms {


+ 1
- 1
src/cache_storage.cpp View File

@@ -31,7 +31,7 @@
#include <string>
#include <list>
#include <limits>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <time.h>
#include <cppcms/cstdint.h>



+ 1
- 1
src/session_win32_file_storage.cpp View File

@@ -17,7 +17,7 @@

#include "crc32.h"

#include <memory>
#include <booster/auto_ptr_inc.h>
#include <time.h>




+ 1
- 1
tests/cache_backend_test.cpp View File

@@ -14,7 +14,7 @@
#include <cppcms/config.h>
#include "test.h"
#include <iostream>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <time.h>
#ifdef CPPCMS_WIN_NATIVE
#include <windows.h>


+ 1
- 1
tests/cache_performance_test.cpp View File

@@ -12,7 +12,7 @@
#include <booster/posix_time.h>
#include <cppcms/config.h>
#include <iostream>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <time.h>
#include <iomanip>
#include <stdlib.h>


+ 1
- 1
tests/storage_test.cpp View File

@@ -25,7 +25,7 @@
#include <booster/function.h>
#include <booster/backtrace.h>
#include <string.h>
#include <memory>
#include <booster/auto_ptr_inc.h>
#include <iostream>
#include <vector>
#include <stdio.h>


Loading…
Cancel
Save