Removed compilation warnings
authorJan Olszak <j.olszak@samsung.com>
Wed, 31 Oct 2012 09:18:03 +0000 (10:18 +0100)
committerJihoon Chung <jihoon.chung@samsung.com>
Tue, 13 Nov 2012 04:37:55 +0000 (13:37 +0900)
[Issue#] N/A
[Problem] Compilation warnings
[Cause] N/A
[Solution] Removed minor warnings. Left warnings connected to GUI, deprecation.
[Verification] Build wrt and run wrt tests.
[SCMRequest] N/A

Change-Id: Icfaaa348190945904bc1c3727152b9fc0688f924

src/view/common/view_logic_security_support.cpp
src/view/webkit/bundles/bundle_uri_handling.cpp
src/view/webkit/bundles/wrt-wk2-bundle.cpp
src/view/webkit/view_logic.cpp
src/view/webkit/view_logic_geolocation_support_webkit2.cpp
src/wrt-client/window_data.cpp [changed mode: 0755->0644]
src/wrt-client/window_data.h

index 7aee710..a4c0670 100644 (file)
@@ -33,9 +33,6 @@ namespace SecuritySupport {
 
 namespace {
 
-const char *SCHEME_TYPE_HTTP = "http";
-const char *SCHEME_TYPE_HTTPS = "https";
-
 const char *GEOLOCATION_DEV_CAP = "geolocation.position";
 const char *GEOLOCATION_PARAM_NAME = "param:enableHighAccuracy";
 const char *GEOLOCATION_PARAM_VALUE = "true";
index 2783c22..5917cac 100644 (file)
@@ -43,9 +43,6 @@ namespace {
 
 char const * const SCHEME_TYPE_FILE = "file";
 char const * const SCHEME_TYPE_WIDGET = "widget";
-const char *SCHEME_TYPE_HTTP = "http";
-const char *SCHEME_TYPE_HTTPS = "https";
-
 char const * const WARP_ERROR_MSG =
         "file:///usr/etc/wrt/warp_security_error.msg";
 char const * const PARAM_URL = "param:url";
index 5e1353d..ee9a36f 100644 (file)
@@ -86,8 +86,8 @@ Bundle::Bundle(WKBundleRef bundle) :
     m_scale(0),
     m_encodedBundle(""),
     m_theme(""),
-    m_resDec(NULL),
     m_encrypted(false),
+    m_resDec(NULL),
     m_widgetType(WrtDB::APP_TYPE_UNKNOWN)
 {
     WrtDB::WrtDatabase::attachToThreadRO();
@@ -191,6 +191,8 @@ void Bundle::didCreatePage(WKBundlePageRef page)
         0, /* willDestroyGlobalObjectForDOMWindowExtension */
         0, /* didFinishProgress */
         0, /* shouldForceUniversalAccessFromLocalURL */
+        0, /* didReceiveIntentForFrame */
+        0, /* registerIntentServiceForFrame */
     };
     WKBundlePageSetPageLoaderClient(page, &loaderClient);
 
@@ -626,7 +628,6 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
     LogDebug("willSendReq got " << toString(request).c_str());
     WKURLRef url = WKURLRequestCopyURL(request);
     WKStringRef urlStr = WKURLCopyString(url);
-    WKTypeRef retVal = NULL;
 
     bool is_xhr = true; // Webkit should inform if it's XHR
     DPL::String dplurl = DPL::FromUTF8String(toString(urlStr));
@@ -879,7 +880,13 @@ std::string Bundle::DecryptResource(std::string resource, int size)
             return std::string();
         }
 
-        fread(contents, sizeof(unsigned char), buf.st_size, fp);
+        size_t ret = fread(contents, sizeof(unsigned char), buf.st_size, fp);
+        if (ret <  static_cast<size_t>(buf.st_size) ){
+            LogDebug("Couldnot read file : " << filePath);
+            fclose(fp);
+            return std::string();
+        }
+
         fclose(fp);
 
         LogDebug("resource is encrypted. decrypting....");
@@ -928,5 +935,5 @@ extern "C"
             &Bundle::didReceiveMessageCallback
         };
         WKBundleSetClient(bundle, &client);
-    }
+}
 }
index b047adf..2224305 100644 (file)
@@ -194,7 +194,7 @@ void ViewLogic::showWidget()
     LogInfo("m_currentUri: " << m_currentUri);
 
     // load page
-    ewk_view_uri_set(m_currentEwkView, m_currentUri.c_str());
+    ewk_view_url_set(m_currentEwkView, m_currentUri.c_str());
 
     if (!m_cbs->bufferSet.empty()) {
         m_cbs->bufferSet(m_currentEwkView);
@@ -301,7 +301,7 @@ void ViewLogic::resetWidget()
                 m_theme.c_str(),
                 m_model->SettingList.Get().isEncrypted());
             // load page
-            ewk_view_uri_set(m_currentEwkView, m_currentUri.c_str());
+            ewk_view_url_set(m_currentEwkView, m_currentUri.c_str());
         }
     }
 
@@ -371,7 +371,7 @@ void ViewLogic::reloadStartPage()
     initializePluginLoading();
 
     // load page
-    ewk_view_uri_set(m_currentEwkView, m_currentUri.c_str());
+    ewk_view_url_set(m_currentEwkView, m_currentUri.c_str());
 
     // show ewkView
     if (!m_cbs->bufferSet.empty()) {
@@ -1545,12 +1545,11 @@ bool ViewLogic::askUserForDatabaseExceedPermission(
         exceededQuota);
     char databaseUseAskTitle[180];
 
-    snprintf(databaseUseAskTitle,
-        sizeof(databaseUseAskTitle),
-        "Do you want to allow %s to use up to %dMB of storage?",
-        ewk_security_origin_host_get(origin),
-        ewk_context_web_database_exceeded_quota_expected_usage_get(
-            exceededQuota)/(1024*1024));
+    snprintf(databaseUseAskTitle, sizeof(databaseUseAskTitle),
+            "Do you want to allow %s to use up to %dMB of storage?",
+            ewk_security_origin_host_get(origin),
+            static_cast<int>(ewk_context_web_database_exceeded_quota_expected_usage_get(
+                    exceededQuota) / (1024 * 1024)));
 
     return Wrt::PopupInvoker().askYesNo(
         DATABASE_USE_ASK_TITLE,
index 8087c8a..bbbdeb0 100644 (file)
@@ -28,7 +28,6 @@
 namespace {
 DPL::String s_tizenId;
 const double GEOLOCATION_POSITION_ACCURACY = 0.0;
-Eina_Bool g_is_location_manager_valid = EINA_FALSE;
 } // anonymous namespace
 
 namespace ViewModule {
old mode 100755 (executable)
new mode 100644 (file)
index d25a14d..a59b500
@@ -48,9 +48,10 @@ char const* const FLOATBACKWARD_BUTTON_STYLE = "wrt/backward";
 } // anonymous namespace
 
 WindowData::WindowData(unsigned long pid, bool manualInit) :
-    m_win(NULL), m_naviBackButton(NULL),
-    m_toolbarTimer(NULL),
-    m_debugMode(false)
+    m_debugMode(false),
+    m_win(NULL),
+    m_naviBackButton(NULL),
+    m_toolbarTimer(NULL)
 {
     m_win = createWindow(pid);
 
@@ -155,8 +156,11 @@ void WindowData::createToolbar(CtxMenuItems ctxMenuItems)
                 EVAS_HINT_EXPAND);
 
         Evas_Object *ic = elm_icon_add(toolbar);
-         snprintf(buf, sizeof(buf), (*itor).icon.c_str());
-         elm_icon_file_set(ic, buf, NULL);
+
+        // (*itor).icon.c_str() guarantied not to have format specifiers
+        snprintf(buf, sizeof(buf), (*itor).icon.c_str());
+
+        elm_icon_file_set(ic, buf, NULL);
         evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
         elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
         elm_object_part_content_set(toolbarButton, "icon", ic);
@@ -420,26 +424,22 @@ void WindowData::changeViewModeCallback(void *data,
 }
 
 void WindowData::controlHiddenOptionCallback(void *data,
-        Evas_Object */*obj*/,
-        const char */*emission*/,
-        const char */*source*/)
+        Evas_Object * /*obj*/,
+        const char * /*emission*/,
+        const char * /*source*/)
 {
     LogDebug("controlHiddenOptionCallback");
     WindowData* This = static_cast<WindowData *>(data);
-    Elm_Object_Item *naviIt = elm_naviframe_top_item_get(This->m_navigation);
+    const char* state = edje_object_part_state_get(
+            elm_layout_edje_get(This->m_user_layout), "elm.swallow.toolbar",
+            NULL);
 
-        const char* state = edje_object_part_state_get(
-                elm_layout_edje_get(This->m_user_layout),
-                "elm.swallow.toolbar",
-                NULL);
-
-        if (state && !strncmp(state, "default", strlen("default"))) {
-            This->showToolbar();
-            This->hideHiddenOption(This->m_user_layout);
-        }
-        else {
-            This->initFullViewMode();
-        }
+    if (state && !strncmp(state, "default", strlen("default"))) {
+        This->showToolbar();
+        This->hideHiddenOption(This->m_user_layout);
+    } else {
+        This->initFullViewMode();
+    }
 }
 
 Eina_Bool WindowData::hideToolbarCallback(void *data)
@@ -469,16 +469,15 @@ void WindowData::toggleFullscreen(bool fullscreen)
     alreadyFullscreen = !alreadyFullscreen;
 }
 
-
-
 void WindowData::winProfileChangedCallback(void *data,
-        Evas_Object * obj,
-        void *event_info)
+                                           Evas_Object* /*obj*/,
+                                           void* /*eventInfo*/)
 {
     LogDebug("winProfileChangedCallback");
-    if (data == NULL) return;
+    if (data == NULL) {
+        return;
+    }
     WindowData* This = static_cast<WindowData *>(data);
-
     const char *profile = elm_config_profile_get();
 
     if (!strcmp(profile, "desktop")) {
index cc7891c..a6f30d9 100755 (executable)
@@ -72,10 +72,10 @@ class WindowData : private DPL::Noncopyable
     typedef std::vector<EventWithFunction> EventWithFunctionVector;
 
   public:
+    bool m_debugMode;
     Evas_Object* m_win;
     Evas_Object* m_user_layout;
 
-    bool m_debugMode;
 
     struct CtxMenuItem
     {