Commit 113dee4b authored by Ronan's avatar Ronan

fix(core): clean code, remove useless includes

parent 0d025669
......@@ -19,10 +19,6 @@
#ifndef _CLONABLE_OBJECT_H_
#define _CLONABLE_OBJECT_H_
#include <string>
#include "linphone/utils/general.h"
#include "property-container.h"
// =============================================================================
......
......@@ -21,8 +21,6 @@
#include <unordered_map>
#include "linphone/utils/general.h"
#include "variant/variant.h"
// =============================================================================
......
......@@ -21,16 +21,15 @@
#include <memory>
#include "linphone/utils/general.h"
#include "property-container.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class LINPHONE_PUBLIC Object : public std::enable_shared_from_this<Object>, public PropertyContainer {
class LINPHONE_PUBLIC Object :
public std::enable_shared_from_this<Object>,
public PropertyContainer {
public:
virtual ~Object ();
......
......@@ -19,10 +19,6 @@
#ifndef _PROPERTY_CONTAINER_H_
#define _PROPERTY_CONTAINER_H_
#include <string>
#include "linphone/utils/general.h"
#include "variant/variant.h"
// =============================================================================
......
......@@ -26,7 +26,7 @@
LINPHONE_BEGIN_NAMESPACE
template<class T>
class Singleton : public Object {
class LINPHONE_PUBLIC Singleton : public Object {
public:
virtual ~Singleton () = default;
......
......@@ -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) \
......
......@@ -81,7 +81,7 @@ public:
Variant (const std::string &value);
// void* constructor. Must be explicitly called.
template<typename T, typename = typename std::enable_if<std::is_same<T, void *>::value> >
template<typename T, typename = typename std::enable_if<std::is_same<T, void *>::value>>
Variant (T value) : Variant (Variant::createGeneric(value)) {}
~Variant ();
......@@ -98,7 +98,7 @@ public:
template<typename T>
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<typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment