[Issue#] N/A
[Bug] Compilation warnings
[Cause] N/A
[Solution] Removed KW comments, renamed table from SettignsList to SettingsList, removed factory_widget and related methods, error codes, exceptions.
[Verification] See compilation warnings. Build wrt-commons. Test dao and dpl.
Change-Id: Ia6d5eaec165b7c5cc57e68ee0b75cc07c996ed58
17 files changed:
SET(DPL_3RDPARTY_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/3rdparty)
SET(DPL_3RDPARTY_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/3rdparty)
# Set names of binaries being created
SET(TARGET_DPL_EFL "lib${PROJECT_NAME}-efl")
SET(TARGET_DPL_DBUS_EFL "lib${PROJECT_NAME}-dbus-efl")
# Set names of binaries being created
SET(TARGET_DPL_EFL "lib${PROJECT_NAME}-efl")
SET(TARGET_DPL_DBUS_EFL "lib${PROJECT_NAME}-dbus-efl")
)
CREATE_TABLE(AutoSaveSubmitFormElement)
)
CREATE_TABLE(AutoSaveSubmitFormElement)
- COLUMN_NOT_NULL(address, VARCHAR(256))
+ COLUMN_NOT_NULL(address, VARCHAR(256),)
COLUMN_NOT_NULL(key, TEXT,)
COLUMN_NOT_NULL(value, TEXT,)
CREATE_TABLE_END()
COLUMN_NOT_NULL(key, TEXT,)
COLUMN_NOT_NULL(value, TEXT,)
CREATE_TABLE_END()
Atomic::ValueType Atomic::ExchangeAndAdd(ValueType value)
{
Atomic::ValueType Atomic::ExchangeAndAdd(ValueType value)
{
- return g_atomic_int_exchange_and_add(&m_value, value);
+ return g_atomic_int_exchange_and_add(const_cast<gint* >(&m_value), value);
}
bool Atomic::CompareAndExchange(ValueType oldValue, ValueType newValue)
{
}
bool Atomic::CompareAndExchange(ValueType oldValue, ValueType newValue)
{
- return g_atomic_int_compare_and_exchange(&m_value, oldValue, newValue);
+ return g_atomic_int_compare_and_exchange(const_cast<gint* >(&m_value), oldValue, newValue);
}
bool Atomic::operator--()
{
}
bool Atomic::operator--()
{
- return g_atomic_int_dec_and_test(&m_value) != TRUE;
+ return g_atomic_int_dec_and_test(const_cast<gint* >(&m_value)) != TRUE;
}
void Atomic::operator++()
{
}
void Atomic::operator++()
{
- g_atomic_int_inc(&m_value);
+ g_atomic_int_inc(const_cast<gint* >(&m_value));
}
Atomic::operator ValueType() const
{
}
Atomic::operator ValueType() const
{
- return g_atomic_int_get(&m_value);
+ return g_atomic_int_get(const_cast<gint* >(&m_value));
+ virtual ~CompareBinaryColumn() {}
+
virtual std::string GetString() const
{
std::string statement;
virtual std::string GetString() const
{
std::string statement;
void SetColumnData(ColumnIndex columnIndex, ColumnType data)
{
typedef CustomColumn<ColumnType> Type;
void SetColumnData(ColumnIndex columnIndex, ColumnType data)
{
typedef CustomColumn<ColumnType> Type;
- Assert(columnIndex >= 0 && columnIndex < m_columns.size());
+ Assert(columnIndex < m_columns.size());
Type* pColumn = dynamic_cast<Type*>(m_columns.at(columnIndex));
Assert(pColumn);
pColumn->SetColumnData(data);
Type* pColumn = dynamic_cast<Type*>(m_columns.at(columnIndex));
Assert(pColumn);
pColumn->SetColumnData(data);
{
typedef CustomColumn<typename ColumnData::ColumnType> Type;
ColumnIndex index = CustomRowUtil<ColumnList>::GetColumnIndex(ColumnData::GetColumnName());
{
typedef CustomColumn<typename ColumnData::ColumnType> Type;
ColumnIndex index = CustomRowUtil<ColumnList>::GetColumnIndex(ColumnData::GetColumnName());
- Assert(index >= 0 && index < m_columns.size());
+ Assert(index < m_columns.size());
Type* pColumn = dynamic_cast<Type*>(m_columns.at(index));
Assert(pColumn);
return pColumn->GetColumnData();
Type* pColumn = dynamic_cast<Type*>(m_columns.at(index));
Assert(pColumn);
return pColumn->GetColumnData();
typedef TYPE ColumnType; \
static const char* GetTableName() { return GetName(); } \
static const char* GetColumnName() { return STRINGIFY(FIELD); } \
typedef TYPE ColumnType; \
static const char* GetTableName() { return GetName(); } \
static const char* GetColumnName() { return STRINGIFY(FIELD); } \
- static void SetRowField(Row& row, const TYPE& value) { row.Set_##FIELD(value);} \
+ static void SetRowField(Row& row, const TYPE& _value) { row.Set_##FIELD(_value);} \
#define VARCHAR(x) DPL::String
#define TEXT DPL::String
#define VARCHAR(x) DPL::String
#define TEXT DPL::String
-#define SQL(args...)
-#define TABLE_CONSTRAINTS(args...)
+#define SQL(...)
+#define TABLE_CONSTRAINTS(...)
#define OPTIONAL(type) DPL::Optional< type >
#define DATABASE_START(db_name) \
namespace db_name \
#define OPTIONAL(type) DPL::Optional< type >
#define DATABASE_START(db_name) \
namespace db_name \
class RowBase; \
inline std::ostream& operator<<(std::ostream& ostr, const RowBase& row); \
}
class RowBase; \
inline std::ostream& operator<<(std::ostream& ostr, const RowBase& row); \
}
-#define COLUMN_NOT_NULL(name, type, args...)
-#define COLUMN(name, type, args...)
+#define COLUMN_NOT_NULL(name, type, ...)
+#define COLUMN(name, type, ...)
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class RowBase { \
public: friend std::ostream& operator<<(std::ostream&, const RowBase&);
#define CREATE_TABLE(name) namespace name { class RowBase { \
public: friend std::ostream& operator<<(std::ostream&, const RowBase&);
-#define COLUMN_NOT_NULL(name, type, args...) \
+#define COLUMN_NOT_NULL(name, type, ...) \
protected: type name; bool m_##name##_set; \
protected: type name; bool m_##name##_set; \
- public: void Set_##name(const type& value) { \
+ public: void Set_##name(const type& _value) { \
} \
public: type Get_##name() const { \
if ( !m_##name##_set ) { \
} \
public: type Get_##name() const { \
if ( !m_##name##_set ) { \
-#define COLUMN(name, type, args...) \
+#define COLUMN(name, type, ...) \
protected: OPTIONAL(type) name; bool m_##name##_set; \
protected: OPTIONAL(type) name; bool m_##name##_set; \
- public: void Set_##name(const OPTIONAL(type)& value) { \
+ public: void Set_##name(const OPTIONAL(type)& _value) { \
} \
public: OPTIONAL(type) Get_##name() const { \
if ( !m_##name##_set ) { \
} \
public: OPTIONAL(type) Get_##name() const { \
if ( !m_##name##_set ) { \
// RowBase ostream operator<<
#define CREATE_TABLE(name) std::ostream& name::operator<<(std::ostream& ostr, const RowBase& row) { using ::operator<< ; ostr << STRINGIFY(name) << " (";
// RowBase ostream operator<<
#define CREATE_TABLE(name) std::ostream& name::operator<<(std::ostream& ostr, const RowBase& row) { using ::operator<< ; ostr << STRINGIFY(name) << " (";
-#define COLUMN_NOT_NULL(name, type, args...) ostr << " '" << row.name << "'" ;
-#define COLUMN(name, type, args...) ostr << " '" << row.name << "'" ;
+#define COLUMN_NOT_NULL(name, type, ...) ostr << " '" << row.name << "'" ;
+#define COLUMN(name, type, ...) ostr << " '" << row.name << "'" ;
#define CREATE_TABLE_END() ostr << " )" ; return ostr; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() ostr << " )" ; return ostr; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class RowBase2 : public RowBase { \
public: bool operator==(const RowBase2& row) const { return true
#define CREATE_TABLE(name) namespace name { class RowBase2 : public RowBase { \
public: bool operator==(const RowBase2& row) const { return true
-#define COLUMN_NOT_NULL(name, type, args...) && (this->name == row.name)
-#define COLUMN(name, type, args...) && (this->name == row.name)
+#define COLUMN_NOT_NULL(name, type, ...) && (this->name == row.name)
+#define COLUMN(name, type, ...) && (this->name == row.name)
#define CREATE_TABLE_END() ; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() ; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class RowBase3 : public RowBase2 { \
public: bool operator<(const RowBase3& row) const {
#define CREATE_TABLE(name) namespace name { class RowBase3 : public RowBase2 { \
public: bool operator<(const RowBase3& row) const {
-#define COLUMN_NOT_NULL(name, type, args...) if (this->name < row.name) { return true; } if (this->name > row.name) { return false; }
-#define COLUMN(name, type, args...) if (this->name < row.name) { return true; } if (this->name > row.name) { return false; }
+#define COLUMN_NOT_NULL(name, type, ...) if (this->name < row.name) { return true; } if (this->name > row.name) { return false; }
+#define COLUMN(name, type, ...) if (this->name < row.name) { return true; } if (this->name > row.name) { return false; }
#define CREATE_TABLE_END() return false; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() return false; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class RowBase4 : public RowBase3 { \
public: bool IsSignatureMatching(const RowBase4& row) const { return true
#define CREATE_TABLE(name) namespace name { class RowBase4 : public RowBase3 { \
public: bool IsSignatureMatching(const RowBase4& row) const { return true
-#define COLUMN_NOT_NULL(name, type, args...) && (this->m_##name##_set == row.m_##name##_set)
-#define COLUMN(name, type, args...) && (this->m_##name##_set == row.m_##name##_set)
+#define COLUMN_NOT_NULL(name, type, ...) && (this->m_##name##_set == row.m_##name##_set)
+#define COLUMN(name, type, ...) && (this->m_##name##_set == row.m_##name##_set)
#define CREATE_TABLE_END() ; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() ; } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class RowBase5 : public RowBase4 { \
public: RowBase5() {
#define CREATE_TABLE(name) namespace name { class RowBase5 : public RowBase4 { \
public: RowBase5() {
-#define COLUMN_NOT_NULL(name, type, args...) m_##name##_set = false;
-#define COLUMN(name, type, args...) m_##name##_set = false;
+#define COLUMN_NOT_NULL(name, type, ...) m_##name##_set = false;
+#define COLUMN(name, type, ...) m_##name##_set = false;
#define CREATE_TABLE_END() } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { class Row : public RowBase5 { \
public: template<typename Visitor> \
void VisitColumns(Visitor& visitor) const {
#define CREATE_TABLE(name) namespace name { class Row : public RowBase5 { \
public: template<typename Visitor> \
void VisitColumns(Visitor& visitor) const {
-#define COLUMN_NOT_NULL(name, type, args...) visitor.Visit(STRINGIFY(name), this->name, this->m_##name##_set);
-#define COLUMN(name, type, args...) visitor.Visit(STRINGIFY(name), this->name, this->m_##name##_set);
+#define COLUMN_NOT_NULL(name, type, ...) visitor.Visit(STRINGIFY(name), this->name, this->m_##name##_set);
+#define COLUMN(name, type, ...) visitor.Visit(STRINGIFY(name), this->name, this->m_##name##_set);
#define CREATE_TABLE_END() } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() } }; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE(name) namespace name { \
static const char* GetName() { return STRINGIFY(name); }
#define CREATE_TABLE(name) namespace name { \
static const char* GetName() { return STRINGIFY(name); }
-#define COLUMN_NOT_NULL(name, type, args...) DECLARE_COLUMN(name, type)
-#define COLUMN(name, type, args...) DECLARE_COLUMN(name, OPTIONAL(type))
+#define COLUMN_NOT_NULL(name, type, ...) DECLARE_COLUMN(name, type)
+#define COLUMN(name, type, ...) DECLARE_COLUMN(name, OPTIONAL(type))
#define CREATE_TABLE_END() }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
// ColumnList typedef
#define CREATE_TABLE(name) namespace name { typedef DPL::TypeListDecl<
// ColumnList typedef
#define CREATE_TABLE(name) namespace name { typedef DPL::TypeListDecl<
-#define COLUMN_NOT_NULL(name, type, args...) name,
-#define COLUMN(name, type, args...) name,
+#define COLUMN_NOT_NULL(name, type, ...) name,
+#define COLUMN(name, type, ...) name,
#define CREATE_TABLE_END() DPL::TypeListGuard>::Type ColumnList; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END() DPL::TypeListGuard>::Type ColumnList; }
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
-#define COLUMN_NOT_NULL(name, type, args...)
-#define COLUMN(name, type, args...)
+#define COLUMN_NOT_NULL(name, type, ...)
+#define COLUMN(name, type, ...)
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
typedef Delete<TableDefinition> Delete; \
typedef Update<TableDefinition> Update; \
}
typedef Delete<TableDefinition> Delete; \
typedef Update<TableDefinition> Update; \
}
-#define COLUMN_NOT_NULL(name, type, args...)
-#define COLUMN(name, type, args...)
+#define COLUMN_NOT_NULL(name, type, ...)
+#define COLUMN(name, type, ...)
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
#define CREATE_TABLE_END()
#include ORM_GENERATOR_DATABASE_NAME_LOCAL
//Do not include this file directly! It is used only for SQL code generation.
#define CREATE_TABLE(name) CREATE TABLE name (
//Do not include this file directly! It is used only for SQL code generation.
#define CREATE_TABLE(name) CREATE TABLE name (
-#define COLUMN(name, type, args...) name type args ,
-#define COLUMN_NOT_NULL(name, type, args...) name type args not null,
-#define SQL(args...) args
-#define TABLE_CONSTRAINTS(args...) args ,
+#define COLUMN(name, type, ...) name type __VA_ARGS__ ,
+#define COLUMN_NOT_NULL(name, type, ...) name type __VA_ARGS__ not null,
+#define SQL(...) __VA_ARGS__
+#define TABLE_CONSTRAINTS(...) __VA_ARGS__ ,
#define CREATE_TABLE_END() CHECK(1) );
#define DATABASE_START(db_name)
#define DATABASE_END()
#define CREATE_TABLE_END() CHECK(1) );
#define DATABASE_START(db_name)
#define DATABASE_END()
* that need that switched do CRW
*/
RW = SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
* that need that switched do CRW
*/
RW = SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
- CRW = RW | SQLITE_OPEN_CREATE,
+ CRW = RW | SQLITE_OPEN_CREATE
struct ObjectRegistration
{
struct ObjectRegistration
{
- ObjectRegistration(guint registrationId, const ObjectPtr& object)
- : registrationId(registrationId),
- object(object)
+ ObjectRegistration(guint _registrationId, const ObjectPtr& _object)
+ : registrationId(_registrationId),
+ object(_object)
ThrowMsg(ResourceDecryptor::Exception::GetDecKeyFailed,
"Failed to get decryption key");
}
ThrowMsg(ResourceDecryptor::Exception::GetDecKeyFailed,
"Failed to get decryption key");
}
- fread(m_decKey, 1, sizeof(AES_KEY),fp);
+ size_t resultSize =fread(m_decKey, 1, sizeof(AES_KEY),fp);
+ if (resultSize!= sizeof(AES_KEY))
+ ThrowMsg(ResourceDecryptor::Exception::GetDecKeyFailed,
+ "Failed to get AES key");
+
}
if (req.find(LOCALE_PREFIX) == 0) {
req.erase(0, LOCALE_PREFIX.length());
}
if (req.find(LOCALE_PREFIX) == 0) {
req.erase(0, LOCALE_PREFIX.length());
- int position = req.find('/');
+ size_t position = req.find('/');
// should always be >0 as correct locales path is
// always locales/xx/ or locales/xx-XX/
if (position != std::string::npos && position > 0) {
// should always be >0 as correct locales path is
// always locales/xx/ or locales/xx-XX/
if (position != std::string::npos && position > 0) {
DECLARE_EXCEPTION_TYPE(DPL::Exception, RemoveDirectoryException)
bool FileExists(const DPL::String& absolutePath);
DECLARE_EXCEPTION_TYPE(DPL::Exception, RemoveDirectoryException)
bool FileExists(const DPL::String& absolutePath);
+bool DirectoryExists(const DPL::String& absolutePath);
/**
* Creates specified path recursively.
/**
* Creates specified path recursively.
* @param mode Mode for the non-existing parts of the path (e.g. 0755).
* @throw DPL::CommonException::::InternalError If sth bad happens.
*/
* @param mode Mode for the non-existing parts of the path (e.g. 0755).
* @throw DPL::CommonException::::InternalError If sth bad happens.
*/
-void MakePath(const std::string& path,
- mode_t mode);
+void MakePath(const std::string& path, mode_t mode);
/**
* Removes specified directory recursively.
/**
* Removes specified directory recursively.
* @throw FileUtils::DirectoryRemoveException If an error occured.
*/
void RemoveDir(const std::string& path);
* @throw FileUtils::DirectoryRemoveException If an error occured.
*/
void RemoveDir(const std::string& path);
+
+} // namespace FileUtils
template<typename... Rest>
struct Pre;
template<typename... Rest>
struct Pre;
template<typename Postfix, typename... Rest>
struct Pre<Postfix, Rest...>
{
template<typename Postfix, typename... Rest>
struct Pre<Postfix, Rest...>
{
- static const double value = Pre<Rest...>::value * stepSize;
+ static const double value;
static std::string printSize(double fileSize)
{
if(fileSize >= Pre<Rest...>::value) {
static std::string printSize(double fileSize)
{
if(fileSize >= Pre<Rest...>::value) {
const double Pre<>::value = 1.0;
const double Pre<>::value = 1.0;
+template<typename Postfix, typename... Params> const double Pre<Postfix, Params...>::value(Pre<>::value * stepSize);
+
typedef Pre<PrefixGB, PrefixMB, PrefixKB, PrefixB> FolderSizeToStringType;
typedef Pre<PrefixGB, PrefixMB, PrefixKB, PrefixB> FolderSizeToStringType;
Settings()
: isEmulator(false), testModes(0)
Settings()
: isEmulator(false), testModes(0)
#include <libxml/xmlstring.h>
namespace WrtDB {
#include <libxml/xmlstring.h>
namespace WrtDB {
+bool IsSpace(const xmlChar* str);
+bool CopyChar(xmlChar* out, xmlChar* in);
+
bool IsSpace(const xmlChar* str)
{
bool IsSpace(const xmlChar* str)
{
case 0xa9:
case 0xaf:
return true;
case 0xa9:
case 0xaf:
return true;
+ default:
+ return false;
}
case 0x81:
if (*(str + 2) == 0x9f) {
}
case 0x81:
if (*(str + 2) == 0x9f) {
wrt::FeatureParam::Row featureParam;
featureParam.Set_widget_feature_id(widgetFeatureID);
wrt::FeatureParam::Row featureParam;
featureParam.Set_widget_feature_id(widgetFeatureID);
- ConfigParserData::ParamsList::const_iterator iter;
-
FOREACH(iter, pWidgetFeature->paramsList)
{
featureParam.Set_name(iter->name);
FOREACH(iter, pWidgetFeature->paramsList)
{
featureParam.Set_name(iter->name);
{
APP_TYPE_UNKNOWN = 0, // unknown
APP_TYPE_WAC20, // WAC 2.0
{
APP_TYPE_UNKNOWN = 0, // unknown
APP_TYPE_WAC20, // WAC 2.0
- APP_TYPE_TIZENWEBAPP, // Tizen webapp
+ APP_TYPE_TIZENWEBAPP // Tizen webapp
{
PKG_TYPE_UNKNOWN = 0, // unknown
PKG_TYPE_TIZEN_WEBAPP, // Tizen webapp
{
PKG_TYPE_UNKNOWN = 0, // unknown
PKG_TYPE_TIZEN_WEBAPP, // Tizen webapp
- PKG_TYPE_TIZEN_WITHSVCAPP, // Tizen webapp with C++ service app
+ PKG_TYPE_TIZEN_WITHSVCAPP // Tizen webapp with C++ service app
- Param(const DPL::String& name) : name(name)
+ Param(const DPL::String& _name) : name(_name)
- Feature(const DPL::String& name,
- bool required = true) : name(name),
- required(required)
+ Feature(const DPL::String& _name,
+ bool _required = true) : name(_name),
+ required(_required)
- Icon(const DPL::String& src) : src(src)
+ Icon(const DPL::String& _src) : src(_src)
- Preference(const DPL::String& name,
- bool readonly = false) :
- name(name),
+ Preference(const DPL::String& _name,
+ bool _readonly = false) :
+ name(_name),