Fix warnings in compilation of wrt-plugins-common
authorGrzegorz Rynkowski <g.rynkowski@samsung.com>
Wed, 13 Feb 2013 15:22:50 +0000 (16:22 +0100)
committerGrzegorz Rynkowski <g.rynkowski@samsung.com>
Mon, 18 Feb 2013 09:35:38 +0000 (10:35 +0100)
[Issue#] N/A
[Problem] Compilation warnings appearing, part 2.
[Cause] Incorrect code.

[Solution] Make some changes. Most of the changes are related to warning
"type qualifiers ignored on function return type". It is generated by
returning a constant pointer from function. I removed unnecessary consts
related with warnings.

[Verification] Build wrt-plugins-common and look at logs of the building.
There should be only two warnings:
 - "Warning: mmap_min_addr is != 0. If programs fail at mmap this could
be the reason"
 - "warning: 'WrtDB::PropertyDAOReadOnly::WidgetPreferenceList
WrtDB::PropertyDAOReadOnly::GetPropertyList(WrtDB::DbWidgetHandle)'
is deprecated (declared at
/usr/include/dpl-efl/dpl/wrt-dao-ro/property_dao_read_only.h:79)" at
wrt-plugins-common-0.3.72/src/modules/tizen/WidgetInterfaceDAO/WidgetInterfaceDAO.cpp:112:71

Change-Id: I262c6e5197e84ae83bffef8f23d1ea52295e3adb

14 files changed:
src/js-overlay/JSClass/JSSoftKeyboardChangeEvent.cpp
src/js-overlay/JSClass/JSSoftKeyboardChangeEvent.h
src/js-overlay/JSClass/JSStorageEvent.cpp
src/js-overlay/JSClass/JSStorageEvent.h
src/js-overlay/JSClass/JSTizenServiceEvent.cpp
src/js-overlay/JSClass/JSTizenServiceEvent.h
src/modules/tizen/Widget/Widget.cpp
src/plugins-api-support/IObject.h
src/plugins-api-support/PluginRegistry.cpp
src/standards/W3C/Widget/JSPreferences.cpp
src/standards/W3C/Widget/JSPreferences.h
src/standards/W3C/Widget/JSWidget.cpp
src/standards/W3C/Widget/JSWidget.h
tests/dao/TestInit.cpp

index a140219..7bd26e2 100644 (file)
@@ -93,7 +93,7 @@ JSStaticValue JSSoftKeyboardChangeEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSSoftKeyboardChangeEvent::getClassRef()
+JSClassRef JSSoftKeyboardChangeEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
index 7471abf..49da22f 100644 (file)
@@ -41,7 +41,7 @@ class JSSoftKeyboardChangeEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
index 0e50100..489656e 100644 (file)
@@ -104,7 +104,7 @@ JSStaticValue JSStorageEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSStorageEvent::getClassRef()
+JSClassRef JSStorageEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -233,7 +233,7 @@ JSValueRef JSStorageEvent::getUrl(
 
 JSValueRef JSStorageEvent::getStorageArea(
     JSContextRef context,
-    JSObjectRef object,
+    JSObjectRef /*object*/,
     JSStringRef /*propertyName*/,
     JSValueRef* exception)
 {
index e1bb899..0460f39 100644 (file)
@@ -40,7 +40,7 @@ class JSStorageEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
index 6fdc6d6..516d189 100644 (file)
@@ -95,7 +95,7 @@ JSStaticValue JSTizenServiceEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSTizenServiceEvent::getClassRef()
+JSClassRef JSTizenServiceEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
index 1c34075..a079dc5 100644 (file)
@@ -40,7 +40,7 @@ class JSTizenServiceEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
index 383ca91..d250452 100644 (file)
@@ -146,7 +146,7 @@ unsigned int Widget::getHeight() const
     checkWidgetId();
 
     if (!m_height.isValid()) {
-        m_height.setValue(Commons::String::toInt(
+        m_height.setValue(Commons::String::convertTo<int>(
                               getProperty(ConfigAttribute::HEIGHT)));
     }
     return m_height.getValue();
@@ -157,7 +157,7 @@ unsigned int Widget::getWidth() const
     checkWidgetId();
 
     if (!m_width.isValid()) {
-        m_width.setValue(Commons::String::toInt(
+        m_width.setValue(Commons::String::convertTo<int>(
                              getProperty(ConfigAttribute::WIDTH)));
     }
     return m_width.getValue();
index 31b644a..4148d91 100644 (file)
@@ -26,7 +26,7 @@
 #include <list>
 
 extern "C" {
-typedef struct OpaqueJSClass* const (*ClassRef)();
+typedef struct OpaqueJSClass* (*ClassRef)();
 }
 
 namespace WrtPluginsApi {
index 5c6b8e1..af9cc2d 100644 (file)
 #include <dpl/log/log.h>
 #include <dpl/foreach.h>
 
-namespace {
-const char* DLL_ENTRY_POINT_NAME = "dll_api";
-}
-
 namespace WrtPluginsApi {
 void PluginRegistry::AddPlugin(const std::string& libraryName,
                                Plugin& plugin)
index 629ba76..2f962f0 100644 (file)
@@ -205,7 +205,7 @@ JSStaticValue JSPreferences::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSPreferences::getClassRef()
+JSClassRef JSPreferences::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
index 62edf7b..b86bae8 100644 (file)
@@ -42,7 +42,7 @@ class JSPreferences
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
index 3081bed..384347a 100644 (file)
@@ -218,7 +218,7 @@ JSStaticValue JSWidget::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSWidget::getClassRef()
+JSClassRef JSWidget::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
index b8ac2af..c0bf403 100644 (file)
@@ -36,7 +36,7 @@ class JSWidget
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
index 77c4f52..ddea164 100644 (file)
@@ -30,9 +30,12 @@ int main (int argc, char *argv[])
 {
     int ret = system("/usr/bin/widgetdb_tests_prepare_db.sh start");
 
-    if (!WIFEXITED(ret)) {      //unexpected termiate
+    if (!WIFEXITED(ret)) {      //unexpected terminate
         LogDebug("Fail while preparing database. Restoring");
-        system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+        ret = system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+        if (ret != 0)
+            LogError("Finalization script has return error: " << ret);
+
         return -1;
     } else if (WEXITSTATUS(ret)) { //wrong script command, nothing done
         LogError("Preparation script has return error: " << ret
@@ -49,6 +52,11 @@ int main (int argc, char *argv[])
 
     WrtDB::WrtDatabase::detachFromThread();
 
-    system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+    ret = system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+    if (ret != 0) {
+        LogError("Finalization script has return error: " << ret);
+        return -1;
+    }
+
     return status;
 }