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 77cfc71f157c8c0fa69f7155180d94b079557e17..1e66bb030dde45998cbf3a684ffad64fee01674a 100644 (file)
@@ -40,7 +40,7 @@ protected:
         *
         *  @param viewmgr The instance of UiBaseViewmgr.
         */
-       UiBaseKeyListener(UiBaseViewmgr *viewmgr);
+       explicit UiBaseKeyListener(UiBaseViewmgr *viewmgr);
 
        ///Destructor.
        virtual ~UiBaseKeyListener();
index ce8a413e1b7cd7e3bd0216d1456e398cb274faf6..125e98526935ac3860aecb19a35cd6705ab39dfb 100644 (file)
@@ -40,7 +40,7 @@ protected:
         *
         *  @param view The instance of UiBaseView.
         */
-       UiBaseOverlay(UiBaseView *view);
+       explicit UiBaseOverlay(UiBaseView *view);
 
        ///Destructor.
        virtual ~UiBaseOverlay();
index ea2d9a197032451077bf57b426729ed6ee33b709..a268766d95c5c357630aac80555e5b3dbefb6b7d 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 25b4e13b7c9c93464194e9a5206e5e14ca429587..688bf8f864c5f72fa18866607fbac409f91efcbb 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 f1ec8e647af784e159e48ddfde06624661e120c8..bff62893447214220241ee976a0a92c286d05d72 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 09b1c0655f2dadd06e6d0d077feee54409a448b1..0fd484a3aa6b8018a2c36bc942f09da7cc5ceb0f 100644 (file)
@@ -105,7 +105,7 @@ protected:
         *
         *  @param The instance of UiView.
         */
-       UiMenu(UiView *view);
+       explicit UiMenu(UiView *view);
 
        ///Destructor.
        virtual ~UiMenu();
index 40dcff7a50b1c046363b7cbe43f803245aef81f6..dd83573c642c954e54a34b84874e8c7511c13509 100644 (file)
@@ -43,7 +43,7 @@ public:
         *
         *  @param The instance of UiView.
         */
-       UiPopup(UiView *view);
+       explicit UiPopup(UiView *view);
 
        ///Destructor.
        virtual ~UiPopup();
index f04bc6d23cd302e51ebda4529c27f8236a230479..96381bf28e09993fc7bdb29822a61c70521912e0 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 fdc89c6d69879d7d6805296ffae8fb4b694f75f3..ff82bc4421879a468911cc7adc03830e701bc801 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 f613ba38b33947c2f2c749b1031b6a94fcd59d53..722f1e7ae002e0c8495341562d57bf831139dd28 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 377affe9fe04855cd4a39ff8d2dda33f444e68d2..a1d717017bcc76e2a5f4b42fd39cc1f0a04a887b 100644 (file)
@@ -114,7 +114,7 @@ protected:
         *
         *  @param view The instance of UiIfaceView.
         */
-       UiIfaceOverlay(UiIfaceView *view);
+       explicit UiIfaceOverlay(UiIfaceView *view);
 
        ///Destructor.
        virtual ~UiIfaceOverlay();
index 97a815045d9056d909699d5ae8cec3b59b269306..f3688c31489319e2779c2d8becea46dfec7c6b3e 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 e9b27760700b9fcc627a149e2568a83979ff8ad5..f1c642ed2f200dcebd89e1b2ec405cc100ac6e1d 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 b37c0807e3795ff7b78e330aa0d6dc5ae2ef508e..e343e0cea4e5e0dcc2414ecfb0e2d5cedd456b35 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 ee74d314f5ce2c2aad6838eca1577aa4fb3c345e..ba37119bf78eb90e62525898a30eccdbd314ac5d 100644 (file)
@@ -51,7 +51,7 @@ protected:
        bool onBack();
 
 public:
-       UiViewImpl(UiView *view);
+       explicit UiViewImpl(UiView *view);
        ~UiViewImpl();
 
        const UiMenu *getMenu()
index f7d0f15c49ce078c072041db73c108c836adfc8d..9fcb674aae644bee0593705cf3d99889ebf0cb47 100644 (file)
@@ -59,7 +59,7 @@ public:
        UiIfaceView *getLastView();
        int getViewIndex(const UiIfaceView *view);
 
-       UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
+       explicit UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
        ~UiIfaceViewmgrImpl();
 
        bool activate();