From 113dee4b8d05572f5f704d6c09e24903855ae8b8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Sep 2017 17:37:56 +0200 Subject: [PATCH] fix(core): clean code, remove useless includes --- src/object/clonable-object.h | 4 ---- src/object/object-p.h | 2 -- src/object/object.h | 7 +++---- src/object/property-container.h | 4 ---- src/object/singleton.h | 2 +- src/utils/utils.cpp | 8 ++++---- src/variant/variant.h | 4 ++-- 7 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/object/clonable-object.h b/src/object/clonable-object.h index 89fe66b3f..b2162706e 100644 --- a/src/object/clonable-object.h +++ b/src/object/clonable-object.h @@ -19,10 +19,6 @@ #ifndef _CLONABLE_OBJECT_H_ #define _CLONABLE_OBJECT_H_ -#include - -#include "linphone/utils/general.h" - #include "property-container.h" // ============================================================================= diff --git a/src/object/object-p.h b/src/object/object-p.h index 74ac5b953..0b3cf57a2 100644 --- a/src/object/object-p.h +++ b/src/object/object-p.h @@ -21,8 +21,6 @@ #include -#include "linphone/utils/general.h" - #include "variant/variant.h" // ============================================================================= diff --git a/src/object/object.h b/src/object/object.h index a09cbc6e0..ede98e862 100644 --- a/src/object/object.h +++ b/src/object/object.h @@ -21,16 +21,15 @@ #include -#include "linphone/utils/general.h" - #include "property-container.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE -class LINPHONE_PUBLIC Object : public std::enable_shared_from_this, public PropertyContainer { - +class LINPHONE_PUBLIC Object : + public std::enable_shared_from_this, + public PropertyContainer { public: virtual ~Object (); diff --git a/src/object/property-container.h b/src/object/property-container.h index 67dab6034..5b8dbd540 100644 --- a/src/object/property-container.h +++ b/src/object/property-container.h @@ -19,10 +19,6 @@ #ifndef _PROPERTY_CONTAINER_H_ #define _PROPERTY_CONTAINER_H_ -#include - -#include "linphone/utils/general.h" - #include "variant/variant.h" // ============================================================================= diff --git a/src/object/singleton.h b/src/object/singleton.h index 667f71f9b..44b6715b0 100644 --- a/src/object/singleton.h +++ b/src/object/singleton.h @@ -26,7 +26,7 @@ LINPHONE_BEGIN_NAMESPACE template -class Singleton : public Object { +class LINPHONE_PUBLIC Singleton : public Object { public: virtual ~Singleton () = default; diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index 0ff383c5f..471d0d1b4 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -93,10 +93,10 @@ string Utils::toString (const void *val) { // ----------------------------------------------------------------------------- #define STRING_TO_NUMBER_IMPL(TYPE, SUFFIX) \ - TYPE Utils::sto ## SUFFIX (const string &str, size_t *idx, int base) { \ + TYPE Utils::sto ## SUFFIX(const string &str, size_t * idx, int base) { \ return sto ## SUFFIX(str.c_str(), idx, base); \ } \ - TYPE Utils::sto ## SUFFIX (const char *str, size_t *idx, int base) { \ + TYPE Utils::sto ## SUFFIX(const char *str, size_t * idx, int base) { \ char *p; \ TYPE v = strto ## SUFFIX(str, &p, base); \ if (idx) \ @@ -105,10 +105,10 @@ string Utils::toString (const void *val) { } \ #define STRING_TO_NUMBER_IMPL_BASE_LESS(TYPE, SUFFIX) \ - TYPE Utils::sto ## SUFFIX (const string &str, size_t *idx) { \ + TYPE Utils::sto ## SUFFIX(const string &str, size_t * idx) { \ return sto ## SUFFIX(str.c_str(), idx); \ } \ - TYPE Utils::sto ## SUFFIX (const char *str, size_t *idx) { \ + TYPE Utils::sto ## SUFFIX(const char *str, size_t * idx) { \ char *p; \ TYPE v = strto ## SUFFIX(str, &p); \ if (idx) \ diff --git a/src/variant/variant.h b/src/variant/variant.h index ac15d2969..0506ef2c1 100644 --- a/src/variant/variant.h +++ b/src/variant/variant.h @@ -81,7 +81,7 @@ public: Variant (const std::string &value); // void* constructor. Must be explicitly called. - template::value> > + template::value>> Variant (T value) : Variant (Variant::createGeneric(value)) {} ~Variant (); @@ -98,7 +98,7 @@ public: template void setValue (const T &value) { // Yeah, I'm crazy but it's useful to avoid code duplication. - new (this) Variant(value); + new(this) Variant(value); } template