c++: use explicit keyword for secure code. 28/78428/1
authorHermet Park <hermet@hermet.pe.kr>
Tue, 5 Jul 2016 11:44:27 +0000 (20:44 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Tue, 5 Jul 2016 11:44:27 +0000 (20:44 +0900)
to prevent the implicit casting by a mistake,
we use this keyword for more secure.

Change-Id: I91a5e9cf51cd1727944ce090a907396968f94895

16 files changed:
src/include/efl/UiBaseKeyListener.h
src/include/efl/UiBaseOverlay.h
src/include/efl/UiBaseView.h
src/include/efl/UiBaseViewmgr.h
src/include/efl/mobile/UiKeyListener.h
src/include/efl/mobile/UiMenu.h
src/include/efl/mobile/UiPopup.h
src/include/efl/mobile/UiStandardView.h
src/include/efl/mobile/UiView.h
src/include/efl/mobile/UiViewmgr.h
src/include/interface/UiIfaceOverlay.h
src/include/interface/UiIfaceRotatable.h
src/include/interface/UiIfaceView.h
src/lib/efl/mobile/UiStandardView.cpp
src/lib/efl/mobile/UiView.cpp
src/lib/interface/UiIfaceViewmgr.cpp

index 77cfc71..1e66bb0 100644 (file)
@@ -40,7 +40,7 @@ protected:
         *
         *  @param viewmgr The instance of UiBaseViewmgr.
         */
-       UiBaseKeyListener(UiBaseViewmgr *viewmgr);
+       explicit UiBaseKeyListener(UiBaseViewmgr *viewmgr);
 
        ///Destructor.
        virtual ~UiBaseKeyListener();
index ce8a413..125e985 100644 (file)
@@ -40,7 +40,7 @@ protected:
         *
         *  @param view The instance of UiBaseView.
         */
-       UiBaseOverlay(UiBaseView *view);
+       explicit UiBaseOverlay(UiBaseView *view);
 
        ///Destructor.
        virtual ~UiBaseOverlay();
index ea2d9a1..a268766 100644 (file)
@@ -36,7 +36,7 @@ public:
         *
         *  @param name view name.
         */
-       UiBaseView(const char *name = NULL);
+       explicit UiBaseView(const char *name = NULL);
 
        ///Destructor.
        virtual ~UiBaseView();
index 25b4e13..688bf8f 100644 (file)
@@ -199,7 +199,7 @@ protected:
         *
         *  @param pkg The name of package.
         */
-       UiBaseViewmgr(const char *pkg);
+       explicit UiBaseViewmgr(const char *pkg);
 
        ///Destructor.
        virtual ~UiBaseViewmgr();
index f1ec8e6..bff6289 100644 (file)
@@ -37,7 +37,7 @@ public:
         *
         *  @param The instance of UiViewmgr.
         */
-       UiKeyListener(UiViewmgr *viewmgr);
+       explicit UiKeyListener(UiViewmgr *viewmgr);
 
        /**
         *  @brief Init H/W key listener to grab key event(menu key).
index 09b1c06..0fd484a 100644 (file)
@@ -105,7 +105,7 @@ protected:
         *
         *  @param The instance of UiView.
         */
-       UiMenu(UiView *view);
+       explicit UiMenu(UiView *view);
 
        ///Destructor.
        virtual ~UiMenu();
index 40dcff7..dd83573 100644 (file)
@@ -43,7 +43,7 @@ public:
         *
         *  @param The instance of UiView.
         */
-       UiPopup(UiView *view);
+       explicit UiPopup(UiView *view);
 
        ///Destructor.
        virtual ~UiPopup();
index f04bc6d..96381bf 100644 (file)
@@ -41,7 +41,7 @@ public:
         *
         *  @param name view name.
         */
-       UiStandardView(const char *name = NULL);
+       explicit UiStandardView(const char *name = NULL);
 
        ///Destructor.
        virtual ~UiStandardView();
index fdc89c6..ff82bc4 100644 (file)
@@ -43,7 +43,7 @@ public:
         *
         *  @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name()
         */
-       UiView(const char *name = NULL);
+       explicit UiView(const char *name = NULL);
 
        ///Destructor.
        virtual ~UiView();
index f613ba3..722f1e7 100644 (file)
@@ -41,7 +41,7 @@ protected:
         *
         *  @param pkg The name of package.
         */
-       UiViewmgr(const char *pkg);
+       explicit UiViewmgr(const char *pkg);
 
        ///Destructor.
        virtual ~UiViewmgr();
index 377affe..a1d7170 100644 (file)
@@ -114,7 +114,7 @@ protected:
         *
         *  @param view The instance of UiIfaceView.
         */
-       UiIfaceOverlay(UiIfaceView *view);
+       explicit UiIfaceOverlay(UiIfaceView *view);
 
        ///Destructor.
        virtual ~UiIfaceOverlay();
index 97a8150..f3688c3 100644 (file)
@@ -30,6 +30,15 @@ namespace ui_viewmanager
  */
 class UiIfaceRotatable
 {
+
+public:
+       /**
+        *  @brief Get current view's degree.
+        *
+        *  @return Current rotation degree, -1 if it fails to get degree information.
+        */
+       virtual int getDegree() { return 0; }
+
 protected:
        /**
         *  @brief View portrait state.
@@ -62,14 +71,6 @@ protected:
         *  @see on_landscpae()
         */
        virtual void onRotate(int degree) {}
-
-public:
-       /**
-        *  @brief Get current view's degree.
-        *
-        *  @return Current rotation degree, -1 if it fails to get degree information.
-        */
-       virtual int getDegree() { return 0; }
 };
 
 }
index e9b2776..f1c642e 100644 (file)
@@ -47,7 +47,7 @@ public:
         *
         *  @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name()
         */
-       UiIfaceView(const char *name = NULL);
+       explicit UiIfaceView(const char *name = NULL);
 
        ///Destructor.
        virtual ~UiIfaceView();
index b37c080..e343e0c 100644 (file)
@@ -41,7 +41,7 @@ private:
        bool _destroyLayout();
 
 public:
-       UiStandardViewImpl(UiStandardView *view);
+       explicit UiStandardViewImpl(UiStandardView *view);
        ~UiStandardViewImpl();
 
        bool setContent(Evas_Object *content, const char *title = NULL);
index ee74d31..ba37119 100644 (file)
@@ -51,7 +51,7 @@ protected:
        bool onBack();
 
 public:
-       UiViewImpl(UiView *view);
+       explicit UiViewImpl(UiView *view);
        ~UiViewImpl();
 
        const UiMenu *getMenu()
index f7d0f15..9fcb674 100644 (file)
@@ -59,7 +59,7 @@ public:
        UiIfaceView *getLastView();
        int getViewIndex(const UiIfaceView *view);
 
-       UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
+       explicit UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
        ~UiIfaceViewmgrImpl();
 
        bool activate();