Remove all C-style cast expressions 30/191830/2
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Wed, 24 Oct 2018 08:57:35 +0000 (10:57 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Wed, 14 Nov 2018 07:28:08 +0000 (07:28 +0000)
Change-Id: I8bec6649eec9447ba50b45254ee78caafeb77582

17 files changed:
src/AccessibilityLauncherPage.cpp
src/AccessoriesSwitchesPage.cpp
src/AddSwitchPage.cpp
src/CameraSwitchesPage.cpp
src/MainData.cpp
src/RemoveSwitchPage.cpp
src/ScreenReaderPage.cpp
src/ScreenReaderSettingsPage.cpp
src/SetValuePage.cpp
src/SwitchesPage.cpp
src/UniversalSwitchPage.cpp
src/UniversalSwitchSettingsPage.cpp
src/UpdateSwitchPage.cpp
src/setting-accessibility-main.cpp
src/setting-accessibility-universal-switch-dbus.cpp
src/setting-accessibility.cpp
src/setting-common-draw-genlist.cpp

index cdac7db..526ed22 100644 (file)
@@ -94,7 +94,7 @@ AccessibilityLauncherPage::AccessibilityLauncherPage(SettingAccessibility *ad)
 Eina_Bool AccessibilityLauncherPage::onNaviframePopCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       ItemWrapper *items = (ItemWrapper *)data;
+       auto items = static_cast<ItemWrapper*>(data);
        delete[] items;
 
        return EINA_TRUE;
@@ -103,7 +103,7 @@ Eina_Bool AccessibilityLauncherPage::onNaviframePopCb(void *data, Elm_Object_Ite
 void AccessibilityLauncherPage::onBackButtonCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
 
@@ -119,9 +119,9 @@ void AccessibilityLauncherPage::updateVconf(ItemWrapper *items)
 void AccessibilityLauncherPage::onCheckboxChangeCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Input parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        list_item->chk_status = !list_item->chk_status;
-       updateVconf((ItemWrapper*)list_item->userdata);
+       updateVconf(static_cast<ItemWrapper*>(list_item->userdata));
 }
 
 void AccessibilityLauncherPage::onItemSelectedCb(void *data, Evas_Object *obj, void *event_info)
@@ -129,9 +129,9 @@ void AccessibilityLauncherPage::onItemSelectedCb(void *data, Evas_Object *obj, v
        retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
-       updateVconf((ItemWrapper*)list_item->userdata);
+       updateVconf(static_cast<ItemWrapper*>(list_item->userdata));
 }
 
 void AccessibilityLauncherPage::updateName(GenGroupItemData *item)
@@ -145,7 +145,7 @@ void AccessibilityLauncherPage::updateMainSwitch(GenGroupItemData *list_item)
        retm_if(list_item == NULL, "Data parameter is NULL");
        updateName(list_item);
        vconf_set_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, list_item->chk_status);
-       ItemWrapper *items = (ItemWrapper *)list_item->userdata;
+       auto items = static_cast<ItemWrapper*>(list_item->userdata);
        for (auto i = 0u; i < utils::lenOf(LAUNCHER_NAMES); i++)
                elm_object_item_disabled_set(items[i].item->item, list_item->chk_status ? EINA_FALSE : EINA_TRUE);
 }
@@ -153,7 +153,7 @@ void AccessibilityLauncherPage::updateMainSwitch(GenGroupItemData *list_item)
 void AccessibilityLauncherPage::checkboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        list_item->chk_status = !list_item->chk_status;
        updateMainSwitch(list_item);
 }
@@ -163,7 +163,7 @@ void AccessibilityLauncherPage::onMouseUpGendialListCb(void *data, Evas_Object *
        retm_if(data == NULL, "Invalid argument: data is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
        updateMainSwitch(list_item);
 }
index ff945a6..5755dcd 100644 (file)
@@ -73,7 +73,7 @@ void AccessoriesSwitchesPage::captureSwitchCb(void *user_data, const char *switc
 {
        retm_if(user_data == NULL, "Input argument is NULL");
        retm_if(switch_id == NULL, "switch_id is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)user_data;
+       auto ad = static_cast<SettingAccessibility*>(user_data);
 
        for (auto &it : ad->config.configuration_items) {
                if (strlen(switch_id) == it->switch_id.size() && strncmp(switch_id, it->switch_id.c_str(), strlen(switch_id)) == 0) {
@@ -116,7 +116,7 @@ void AccessoriesSwitchesPage::alreadyMappedSwitchPopup(SettingAccessibility *ad)
 void AccessoriesSwitchesPage::okResponseCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        renewCaptureSwitchCb(ad, NULL);
 
@@ -127,7 +127,7 @@ void AccessoriesSwitchesPage::okResponseCb(void *data, Evas_Object *obj, void *e
 void AccessoriesSwitchesPage::popupResponseCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        auto response_type = get_popup_btn_response_type(obj);
 
        if (response_type == PopupBtnResponse::OK) {
@@ -163,7 +163,7 @@ void AccessoriesSwitchesPage::accessorySwitchActionCb(SettingAccessibility *ad,
 Eina_Bool AccessoriesSwitchesPage::renewCaptureSwitchCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        setting_accessibility_universal_switch_dbus_config_captureSwitch(&ad->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, ad);
 
@@ -174,7 +174,7 @@ Eina_Bool AccessoriesSwitchesPage::renewCaptureSwitchCb(void *data, Elm_Object_I
 Eina_Bool AccessoriesSwitchesPage::naviframPopCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(&ad->config);
        ad->us_configuration.switch_id = {};
@@ -185,6 +185,6 @@ Eina_Bool AccessoriesSwitchesPage::naviframPopCb(void *data, Elm_Object_Item *it
 void AccessoriesSwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
index eeb92eb..100b618 100644 (file)
@@ -69,8 +69,8 @@ void AddSwitchPage::onSwitchAddition(void *data, Evas_Object *obj, void *event_i
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
-       GenGroupItemData *settings_item = (GenGroupItemData *)elm_object_item_data_get(item);
-       SettingAccessibility *ad = (SettingAccessibility *)settings_item->userdata;
+       auto settings_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+       auto ad = static_cast<SettingAccessibility*>(settings_item->userdata);
        retm_if(ad == NULL, "Input argument is NULL");
        auto providerId = *static_cast<std::string*>(data);
 
@@ -94,7 +94,7 @@ void AddSwitchPage::showSwitchesPage(SettingAccessibility *ad, const char * prov
 void AddSwitchPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
@@ -102,7 +102,7 @@ void AddSwitchPage::backCb(void *data, Evas_Object *obj, void *event_info)
 Eina_Bool AddSwitchPage::onNaviframePopCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        ad->us_configuration.screen_switch_added_cb = NULL;
        ad->us_configuration.camera_switch_added_cb = NULL;
index caecfa1..9f656fb 100644 (file)
@@ -60,10 +60,10 @@ void CameraSwitchesPage::addSwitchCb(void *data, Evas_Object *obj, void *event_i
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
-       GenGroupItemData *settings_item = (GenGroupItemData *)elm_object_item_data_get(item);
-       SettingAccessibility *ad = (SettingAccessibility *)settings_item->userdata;
+       auto settings_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+       auto ad = static_cast<SettingAccessibility*>(settings_item->userdata);
        retm_if(ad == NULL, "Input argument is NULL");
-       UniversalSwitchInfoType * camera_switch = (UniversalSwitchInfoType *)data;
+       auto camera_switch = static_cast<UniversalSwitchInfoType*>(data);
 
        createActionPage(ad, camera_switch);
 }
@@ -81,7 +81,7 @@ void CameraSwitchesPage::createActionPage(SettingAccessibility *ad, UniversalSwi
 void CameraSwitchesPage::switchActionCb(SettingAccessibility *ad, const std::string& action, void *user_data)
 {
        retm_if(user_data == NULL, "User data parameter is NULL");
-       UniversalSwitchInfoType * camera_switch = (UniversalSwitchInfoType *)user_data;
+       auto camera_switch = static_cast<UniversalSwitchInfoType*>(user_data);
 
        if (ad->us_configuration.camera_switch_added_cb)
                ad->us_configuration.camera_switch_added_cb(ad, camera_switch->id, action, camera_switch->name);
@@ -90,7 +90,7 @@ void CameraSwitchesPage::switchActionCb(SettingAccessibility *ad, const std::str
 void CameraSwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
index ae7959c..5733afb 100644 (file)
@@ -141,7 +141,7 @@ void MainData::onAllGenlistRealizedCb(void *data, Evas_Object *obj, void *event_
        __gl_realized_cb(data, obj, event_info);
        setting_retm_if(event_info == NULL, "invalid parameter: event_info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       GenGroupItemData *item_data = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto item_data = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        ret_if(!item_data);
 }
 
index 6430c17..78c770b 100644 (file)
@@ -39,7 +39,7 @@ void RemoveSwitchPage::attachCallback(SettingAccessibility *ad, UniversalSwitchU
 
 void RemoveSwitchPage::onDeleteButtonClicked(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retm_if(ad == NULL, "Input parameter is NULL");
        retm_if(ad->set_value_layout.getGenlist() == NULL, "No genlist provided");
 
@@ -48,7 +48,7 @@ void RemoveSwitchPage::onDeleteButtonClicked(void *data, Evas_Object *obj, void
 
 void RemoveSwitchPage::onAllButtonsClicked(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retm_if(ad == NULL, "Input parameter is NULL");
        retm_if(ad->set_value_layout.getGenlist() == NULL, "No genlist provided");
 
@@ -57,7 +57,7 @@ void RemoveSwitchPage::onAllButtonsClicked(void *data, Evas_Object *obj, void *e
 
        Elm_Object_Item *item = elm_genlist_first_item_get(ad->set_value_layout.getGenlist());
        while (item != NULL) {
-               GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+               auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
                setting_update_gl_item_chk_status(list_item, !all_selected);
                item = elm_genlist_item_next_get(item);
        }
@@ -139,12 +139,12 @@ void RemoveSwitchPage::createPopupForSwitchesRemoving(SettingAccessibility *ad)
 
 void RemoveSwitchPage::onRemoveSelectedSwitches(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        bool disable_universal_switch = (ad->switches_to_remove_counter == (int)elm_genlist_items_count(ad->set_value_layout.getGenlist()));
 
        Elm_Object_Item *item = elm_genlist_last_item_get(ad->set_value_layout.getGenlist());
        while (item != NULL) {
-               GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+               auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
                item = elm_genlist_item_prev_get(item);
                if (list_item->chk_status)
                        removeSwitch(ad, list_item->chk_id);
index 36b7b40..fbbc00c 100644 (file)
@@ -6,7 +6,7 @@
 
 ScreenReaderPage::ScreenReaderPage(SettingAccessibility *data)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        Evas_Object *genlist = elm_genlist_add(ad->md.getNaviframe());
        retm_if(genlist == NULL, "Cannot set genlist object as content of layout");
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
@@ -77,7 +77,7 @@ void ScreenReaderPage::listCb(void *data, Evas_Object *obj, void *event_info)
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_retm_if(data == NULL, "Data parameter is NULL");
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
        updateScreenReaderVconfCheck((list_item->chk_status ? 1 : 0), list_item->userdata);
@@ -88,7 +88,7 @@ void ScreenReaderPage::settingsListCb(void *data, Evas_Object *obj, void *event_
        retm_if(data == NULL, "Invalid argument: data is NULL");
        retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
@@ -98,7 +98,7 @@ void ScreenReaderPage::settingsListCb(void *data, Evas_Object *obj, void *event_
 void ScreenReaderPage::screenReaderCheckCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        /* for genlist update status */
        list_item->chk_status = elm_check_state_get(obj);
@@ -110,7 +110,7 @@ void ScreenReaderPage::screenReaderCheckCb(void *data, Evas_Object *obj, void *e
 void ScreenReaderPage::updateScreenReaderVconfCheck(int state, void* data)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        vconf_set_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, state);
        if (!state) {
                char buf[255] = "";
@@ -126,7 +126,7 @@ void ScreenReaderPage::updateScreenReaderVconfCheck(int state, void* data)
 Eina_Bool ScreenReaderPage::hideScreenReaderPage(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, onVconfChangedCb);
        elm_naviframe_item_pop(ad->md.getNaviframe());
 
@@ -135,7 +135,7 @@ Eina_Bool ScreenReaderPage::hideScreenReaderPage(void *data, Elm_Object_Item *it
 
 void ScreenReaderPage::onVconfChangedCb(keynode_t *node, void *user_data)
 {
-       GenGroupItemData *screenReaderItem = (GenGroupItemData *)user_data;
+       auto screenReaderItem = static_cast<GenGroupItemData*>(user_data);
        /*SETTING_TRACE_DEBUG("check_status: %i, node->value.i: %i",
         *  screenReaderItem->chk_status, node->value.i); */
        /* I don't know why following code does not update check box to
index 9c94313..0028f4e 100644 (file)
@@ -214,7 +214,7 @@ void ScreenReaderSettingsPage::mouseUpGendialListCb(void *data, Evas_Object *obj
        retm_if(data == NULL, "Invalid argument: data is NULL");
        retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        Evas_Object *popup;
        Evas_Object *box;
        Evas_Object *genlist;
@@ -294,8 +294,7 @@ void ScreenReaderSettingsPage::mouseUpGendialListCb(void *data, Evas_Object *obj
 void ScreenReaderSettingsPage::vibrationFeedbackCb(void *data, Evas_Object *obj, void *event_info)
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       GenGroupItemData *list_item = (GenGroupItemData *)
-                       elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
        setting_update_gl_item_chk_status(list_item,
@@ -306,7 +305,7 @@ void ScreenReaderSettingsPage::vibrationFeedbackCb(void *data, Evas_Object *obj,
 void ScreenReaderSettingsPage::updateVibrationFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        /* for genlist update status */
        list_item->chk_status = elm_check_state_get(obj);
@@ -323,7 +322,7 @@ void ScreenReaderSettingsPage::updateVibrationFeedbackVconf(int state)
 void ScreenReaderSettingsPage::soundFeedbackCb(void *data, Evas_Object *obj, void *event_info)
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       GenGroupItemData *list_item = (GenGroupItemData *) elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
@@ -333,7 +332,7 @@ void ScreenReaderSettingsPage::soundFeedbackCb(void *data, Evas_Object *obj, voi
 void ScreenReaderSettingsPage::updateSoundFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        /* for genlist update status */
        list_item->chk_status = elm_check_state_get(obj);
@@ -351,8 +350,7 @@ void ScreenReaderSettingsPage::hintsCb(void *data, Evas_Object *obj, void *event
 {
 
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       GenGroupItemData *list_item = (GenGroupItemData *)
-                       elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
        setting_update_gl_item_chk_status(list_item,
@@ -363,7 +361,7 @@ void ScreenReaderSettingsPage::hintsCb(void *data, Evas_Object *obj, void *event
 void ScreenReaderSettingsPage::updateHintsCheck(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        /* for genlist update status */
        list_item->chk_status = elm_check_state_get(obj);
@@ -380,7 +378,7 @@ void ScreenReaderSettingsPage::updateHintsVconf(int state)
 void ScreenReaderSettingsPage::keyboardFeedbackCb(void *data, Evas_Object *obj, void *event_info)
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
@@ -390,7 +388,7 @@ void ScreenReaderSettingsPage::keyboardFeedbackCb(void *data, Evas_Object *obj,
 void ScreenReaderSettingsPage::updateKeyboardFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        /* for genlist update status */
        list_item->chk_status = elm_check_state_get(obj);
@@ -407,7 +405,7 @@ void ScreenReaderSettingsPage::updateKeyboardFeedbackVconf(int state)
 void ScreenReaderSettingsPage::speechRateCb(void *data, Evas_Object *obj, void *event_info)
 {
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
        createSpeechRatePopup(ad, item);
@@ -416,7 +414,7 @@ void ScreenReaderSettingsPage::speechRateCb(void *data, Evas_Object *obj, void *
 void ScreenReaderSettingsPage::ttsSpeedChangedCb(int speed, void *user_data)
 {
        SETTING_TRACE("=== Speed changed to (%d)", speed);
-       GenGroupItemData *speech_rate_item = (GenGroupItemData *)user_data;
+       auto speech_rate_item = static_cast<GenGroupItemData*>(user_data);
        char buf[256];
 
        snprintf(buf, utils::lenOf(buf), "%d", speed);
@@ -425,7 +423,7 @@ void ScreenReaderSettingsPage::ttsSpeedChangedCb(int speed, void *user_data)
 
 void ScreenReaderSettingsPage::createSpeechRatePopup(void *data, void *item)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        Evas_Object *popup;
        Evas_Object *layout;
        Evas_Object *slider;
@@ -520,8 +518,7 @@ void ScreenReaderSettingsPage::onListItemClicked(void *data, Evas_Object *obj, v
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)
-                       elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        retm_if(!list_item, "list_item == NULL");
 
        LOGI("ITEM SELECTED: %s", list_item->keyStr.c_str());
@@ -552,7 +549,7 @@ void ScreenReaderSettingsPage::onCheckStateChanged(void *data, Evas_Object *obj,
                return;
        }
 
-       GenGroupItemData *item_data = (GenGroupItemData *)data;
+       auto item_data = static_cast<GenGroupItemData*>(data);
        item_data->chk_status = elm_check_state_get(obj);
        LOGE("Check changed: %s; status: %d, %p", item_data->keyStr.c_str(), item_data->chk_status, &item_data->chk_status);
 }
@@ -608,7 +605,7 @@ Eina_Bool ScreenReaderSettingsPage::vconfValueGet(const char *key)
 Eina_Bool ScreenReaderSettingsPage::hidePage(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        if (0 != tts_setting_unset_speed_changed_cb())
                SETTING_TRACE("Fail to unset speed changed cb");
index a73fffe..a344bd3 100644 (file)
@@ -165,7 +165,7 @@ void SetValuePage::addSwitchItem(SettingAccessibility *ad, const char *caption,
 {
        retm_if(ad == NULL, "Input parameter is NULL");
 
-       GenGroupItemData *item = (GenGroupItemData *)createGendialGroupItem(ad->set_value_layout.getGenlist(), &ad->itc_multiline_sub,
+       GenGroupItemData *item = createGendialGroupItem(ad->set_value_layout.getGenlist(), &ad->itc_multiline_sub,
                        gl_sel, NULL,
                        SwallowType::ICON_RADIO, (int)state,
                        caption ? caption : std::string{},
@@ -199,7 +199,7 @@ GenGroupItemData* SetValuePage::addRadioListItem(SettingAccessibility *ad, const
 {
        retvm_if(ad == NULL, NULL, "Input parameter is NULL");
 
-       OptionsItem *opt_item = (OptionsItem *)calloc(1, sizeof(OptionsItem));
+       auto opt_item = new OptionsItem;
        retvm_if(opt_item == NULL, NULL, "calloc failed");
 
        opt_item->ad = ad;
@@ -291,7 +291,7 @@ void SetValuePage::syncPageWithVconf(keynode_t *node, void *user_data)
 {
        retm_if(user_data == NULL, "Data parameter is NULL");
        retm_if(node == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)user_data;
+       auto ad = static_cast<SettingAccessibility*>(user_data);
        int ret = vconf_keynode_get_bool(node);
        retm_if(ret < 0, "FAIL: vconf_keynode_get_bool");
        if (elm_check_state_get(ad->set_value_layout.getCheck()) != ret) {
@@ -313,7 +313,7 @@ void SetValuePage::addActionGendialField(SettingAccessibility *ad)
 void SetValuePage::updateSwitchAction(void *data, Evas_Object *obj, void *event_info)
 {
        elm_genlist_item_selected_set((Elm_Genlist_Item *)event_info, 0);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retm_if(ad == NULL, "Data argument is NULL");
 
        ad->actionPage_ = std::make_unique<ActionPage>(ad);
@@ -337,7 +337,7 @@ void SetValuePage::updateGendialActionField(SettingAccessibility *ad)
 
 void SetValuePage::closeUpdateAccessoriesSwitchPage(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retm_if(ad == NULL, "Data argument is NULL");
 
        if (event_info == ad->save_object_item)
@@ -360,8 +360,7 @@ void SetValuePage::gendialRadioItemSelectedCb(void *data, Evas_Object *obj, void
 
        elm_genlist_item_selected_set(item, 0);
 
-       GenGroupItemData *list_item =
-                       (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        if (list_item->chk_status)
                setting_update_gl_item_chk_status(list_item, 0);
 
@@ -371,14 +370,14 @@ void SetValuePage::gendialRadioItemSelectedCb(void *data, Evas_Object *obj, void
 void SetValuePage::gendialRadioChangeCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Input parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        callRadioItemChangeCbAndPopNaviframe(list_item);
 }
 
 void SetValuePage::callRadioItemChangeCbAndPopNaviframe(GenGroupItemData *list_item)
 {
        retm_if(list_item == NULL, "Input parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "Application data is NULL");
        if (ad->set_value_layout.radio_item_change_cb)
                ad->set_value_layout.radio_item_change_cb(ad, list_item->chk_id);
@@ -398,11 +397,11 @@ void SetValuePage::gendialRemoveSelectedItemCb(void *data, Evas_Object *obj, voi
 
        elm_genlist_item_selected_set(item, 0);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_update_gl_item_chk_status(list_item,
                        list_item->chk_status ? 0 : 1);
 
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
 
        if (elm_check_state_get(list_item->eo_check))
                ad->switches_to_remove_counter++;
@@ -415,8 +414,8 @@ void SetValuePage::gendialRemoveSelectedItemCb(void *data, Evas_Object *obj, voi
 void SetValuePage::gendialRemoveCheckboxItemCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Input parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        if (elm_check_state_get(list_item->eo_check))
                ad->switches_to_remove_counter++;
        else
@@ -428,8 +427,8 @@ void SetValuePage::gendialRemoveCheckboxItemCb(void *data, Evas_Object *obj, voi
 void SetValuePage::switchItemCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Input parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
 
        if (ad->set_value_layout.switch_item_change_cb) {
                bool state = elm_check_state_get(list_item->eo_check);
@@ -557,7 +556,7 @@ void SetValuePage::listItemClickCb(void *data, Evas_Object *obj, void *event_inf
 {
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(data == NULL, "Input parameter is NULL");
-       OptionsItem *opt_item = (OptionsItem *)data;
+       auto opt_item = static_cast<OptionsItem*>(data);
        retm_if(opt_item->ad->set_value_layout.list_item_options_request_cb == NULL, "Function not provided");
 
        opt_item->ad->set_value_layout.list_item_options_request_cb(opt_item->ad, opt_item->option_id);
@@ -567,7 +566,7 @@ void SetValuePage::scrollerScrollCb(void *data, Evas_Object *obj, void *event_in
 {
        int page_num = 0;
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_scroller_current_page_get(ad->set_value_layout.getScroller(), NULL, &page_num);
 
@@ -578,7 +577,7 @@ void SetValuePage::checkStateChangedCb(void *data, Evas_Object *obj, void *event
 {
        bool state;
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        state = elm_check_state_get(obj);
 
@@ -602,7 +601,7 @@ void SetValuePage::checkStateChangedCb(void *data, Evas_Object *obj, void *event
 Eina_Bool SetValuePage::naviframePopCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, SetValuePage::syncPageWithVconf);
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, SetValuePage::syncPageWithVconf);
@@ -625,7 +624,7 @@ Eina_Bool SetValuePage::naviframePopCb(void *data, Elm_Object_Item *it)
 void SetValuePage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
index 36fc1aa..e04006a 100644 (file)
@@ -49,7 +49,7 @@ void SwitchesPage::createAddButton(SettingAccessibility *ad, Evas_Object *genlis
 {
        retm_if(ad == NULL, "Input argument is NULL");
 
-       GenGroupItemData *item = (GenGroupItemData *)createGendialGroupItem(genlist, &itc_1text_1icon_3,
+       GenGroupItemData *item = createGendialGroupItem(genlist, &itc_1text_1icon_3,
                        addSwitchClickedCb, ad,
                        SwallowType::ICON_IMAGE, 0,
                        "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES_ADD_SWITCH",
@@ -75,7 +75,7 @@ void SwitchesPage::createSwitchesGroup(SettingAccessibility *ad, Evas_Object *ge
 void SwitchesPage::createRemovePageCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        ad->removeSwitchPage_ = std::make_unique<RemoveSwitchPage>(ad);
        RemoveSwitchPage::attachCallback(ad, switchRemovedCb);
@@ -85,7 +85,7 @@ void SwitchesPage::addSwitchClickedCb(void *data, Evas_Object *obj, void *event_
 {
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        AddSwitchPage::attachCallbackOnSwitchAttach(ad, addSwitchCb);
        ad->addSwitchPage_ = std::make_unique<AddSwitchPage>(ad);
@@ -98,10 +98,10 @@ void SwitchesPage::switchClickCb(void *data, Evas_Object *obj, void *event_info)
        elm_genlist_item_selected_set(item, EINA_FALSE);
        retm_if(data == NULL, "Data argument is NULL");
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
-       UniversalSwitchConfigurationItem *config_item = (UniversalSwitchConfigurationItem *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+       auto config_item = static_cast<UniversalSwitchConfigurationItem*>(list_item->userdata);
 
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        UpdateSwitchPage::attachActionCallback(ad, switchUpdatedCb);
        ad->updateSwitchPage_ = std::make_unique<UpdateSwitchPage>(ad, config_item);
 }
@@ -138,9 +138,8 @@ GenGroupItemData* SwitchesPage::addMappedSwitchMenuItem(SettingAccessibility *ad
 {
        retvm_if(ad == NULL, NULL, "Input argument is NULL");
        retvm_if(genlist == NULL, NULL, "Input genlist argument is NULL");
-       GenGroupItemData *item;
 
-       item =  (GenGroupItemData *)createGendialGroupItem(genlist, &itc_2text_1icon_3,
+       auto item = createGendialGroupItem(genlist, &itc_2text_1icon_3,
                        item_cb, ad,
                        SwallowType::INVALID, 0,
                        main_text,
@@ -156,7 +155,7 @@ GenGroupItemData* SwitchesPage::addMappedSwitchMenuItem(SettingAccessibility *ad
 Eina_Bool SwitchesPage::naviframePopCb(void *data, Elm_Object_Item *it)
 {
        retv_if(data == NULL, EINA_TRUE);
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        if (ad->universal_switch_switches_back)
                ad->universal_switch_switches_back(ad);
@@ -172,7 +171,7 @@ Eina_Bool SwitchesPage::naviframePopCb(void *data, Elm_Object_Item *it)
 void SwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
index c5f9d1b..48b7f55 100644 (file)
@@ -83,7 +83,7 @@ UniversalSwitchPage::UniversalSwitchPage(SettingAccessibility *ad)
 
 void UniversalSwitchPage::createSettingsPage(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retm_if(ad == NULL, "Input parameter is NULL");
 
        ad->universalSwitchSettingsPage_ = std::make_unique<UniversalSwitchSettingsPage>(ad);
@@ -124,7 +124,7 @@ bool UniversalSwitchPage::setState(bool state)
 void UniversalSwitchPage::updateVconfKey(int state, void *data)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&ad->config);
 
        if (state && switch_count == 0) {
@@ -156,7 +156,7 @@ void UniversalSwitchPage::onNewSwitchAddition(SettingAccessibility *ad, const st
 void UniversalSwitchPage::popupResponseCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        auto response_type = get_popup_btn_response_type(obj);
 
        SETTING_TRACE_DEBUG("popup response_type: %i", static_cast<int>(response_type));
@@ -181,14 +181,14 @@ void UniversalSwitchPage::popupResponseCb(void *data, Evas_Object *obj, void *ev
 void UniversalSwitchPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
 
 Eina_Bool UniversalSwitchPage::naviframePopCb(void *data, Elm_Object_Item *it)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, onVconfKeyChange);
        stopUniversalSwitch(ad);
@@ -228,7 +228,7 @@ void UniversalSwitchPage::onUniversalSwitchStarting(void * data)
 {
        SETTING_TRACE_DEBUG("universal-switch started");
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        if (ad->universal_switch_off_checkbox)
                elm_object_item_disabled_set(ad->universal_switch_off_checkbox->item, EINA_FALSE);
@@ -248,7 +248,7 @@ void UniversalSwitchPage::listCb(void *data, Evas_Object *obj, void *event_info)
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_retm_if(data == NULL, "Data parameter is NULL");
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
        updateVconfKey(list_item->chk_status ? 1 : 0, list_item->userdata);
@@ -257,7 +257,7 @@ void UniversalSwitchPage::listCb(void *data, Evas_Object *obj, void *event_info)
 void UniversalSwitchPage::checkboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
 
        list_item->chk_status = elm_check_state_get(obj);
 
@@ -268,7 +268,7 @@ void UniversalSwitchPage::checkboxCb(void *data, Evas_Object *obj, void *event_i
 void UniversalSwitchPage::onVconfKeyChange(keynode_t *node, void *user_data)
 {
        int state;
-       SettingAccessibility *ad = (SettingAccessibility *)user_data;
+       auto ad = static_cast<SettingAccessibility*>(user_data);
 
        state = vconf_keynode_get_bool(node);
        if (state >= 0)
index c9f7f9d..3245051 100644 (file)
@@ -228,11 +228,11 @@ void UniversalSwitchSettingsPage::autoTapKBDMenuItemSelected(void *data, Evas_Ob
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_retm_if(list_item == NULL, "Data parameter is NULL");
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
 
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        ad->us_configuration.auto_tap_kbd_state = list_item->chk_status;
 
        updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE, (bool *)&list_item->chk_status, NULL, NULL);
@@ -518,7 +518,7 @@ void UniversalSwitchSettingsPage::updateSwitchesCount(SettingAccessibility *ad)
 
 void UniversalSwitchSettingsPage::manageOptionsCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -541,10 +541,10 @@ void UniversalSwitchSettingsPage::manageOptionsItemSelected(void *data, Evas_Obj
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_retm_if(list_item == NULL, "Data parameter is NULL");
 
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        list_item->chk_status = ad->us_configuration.manage_options_state[list_item->chk_id] ? 1 : 0;
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
 
@@ -562,7 +562,7 @@ void UniversalSwitchSettingsPage::manageOptionsCheckboxCb(SettingAccessibility *
 void UniversalSwitchSettingsPage::feedbackVoiceCb(void *data, Evas_Object *obj, void *event_info)
 {
        char str[128] = {0,};
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -661,8 +661,8 @@ void UniversalSwitchSettingsPage::feedbackVoiceSwitchChangedCb(SettingAccessibil
 void UniversalSwitchSettingsPage::feedbackVoiceCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
 
        list_item->chk_status = elm_check_state_get(obj);
 
@@ -681,7 +681,7 @@ void UniversalSwitchSettingsPage::feedbackVoiceCheckboxCb(void *data, Evas_Objec
 void UniversalSwitchSettingsPage::feedbackSoundCb(void *data, Evas_Object *obj, void *event_info)
 {
        char str[128] = {0,};
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -745,8 +745,8 @@ void UniversalSwitchSettingsPage::feedbackSoundSwitchChangedCb(SettingAccessibil
 void UniversalSwitchSettingsPage::feedbackSoundCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
 
        list_item->chk_status = elm_check_state_get(obj);
 
@@ -765,7 +765,7 @@ void UniversalSwitchSettingsPage::feedbackSoundCheckboxCb(void *data, Evas_Objec
 void UniversalSwitchSettingsPage::cursorColorCb(void *data, Evas_Object *obj, void *event_info)
 {
        int i;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -792,8 +792,8 @@ void UniversalSwitchSettingsPage::cursorColorListItemChangedCb(SettingAccessibil
 void UniversalSwitchSettingsPage::autoTapKbdCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -804,7 +804,7 @@ void UniversalSwitchSettingsPage::autoTapKbdCheckboxCb(void *data, Evas_Object *
 
 void UniversalSwitchSettingsPage::autoMoveIntervalCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -836,7 +836,7 @@ void UniversalSwitchSettingsPage::autoMoveIntervalSwitchChangedCb(SettingAccessi
 
 void UniversalSwitchSettingsPage::autoTapCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -884,8 +884,8 @@ void UniversalSwitchSettingsPage::autoTapValueChangedCb(SettingAccessibility *ad
 void UniversalSwitchSettingsPage::autoTapCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -901,7 +901,7 @@ void UniversalSwitchSettingsPage::autoTapCheckboxCb(void *data, Evas_Object *obj
 
 void UniversalSwitchSettingsPage::sglInactionIntervalCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -949,8 +949,8 @@ void UniversalSwitchSettingsPage::sglInactionIntervalValueChangedCb(SettingAcces
 void UniversalSwitchSettingsPage::sglInactionIntervalCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -966,7 +966,7 @@ void UniversalSwitchSettingsPage::sglInactionIntervalCheckboxCb(void *data, Evas
 
 void UniversalSwitchSettingsPage::tapDurationCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1014,8 +1014,8 @@ void UniversalSwitchSettingsPage::tapDurationValueChangedCb(SettingAccessibility
 void UniversalSwitchSettingsPage::tapDurationCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -1032,7 +1032,7 @@ void UniversalSwitchSettingsPage::tapDurationCheckboxCb(void *data, Evas_Object
 void UniversalSwitchSettingsPage::pauseOnFirstCb(void *data, Evas_Object *obj, void *event_info)
 {
        char str[512] = {0,};
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1082,8 +1082,8 @@ void UniversalSwitchSettingsPage::pauseOnFirstValueChangedCb(SettingAccessibilit
 void UniversalSwitchSettingsPage::pauseOnFirstCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -1100,7 +1100,7 @@ void UniversalSwitchSettingsPage::pauseOnFirstCheckboxCb(void *data, Evas_Object
 
 void UniversalSwitchSettingsPage::scanSpeedCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1128,7 +1128,7 @@ void UniversalSwitchSettingsPage::scanSpeedChangedCb(SettingAccessibility *ad, d
 void UniversalSwitchSettingsPage::scanDirectionCb(void *data, Evas_Object *obj, void *event_info)
 {
        Evas_Object *ctxpopup;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1145,7 +1145,7 @@ void UniversalSwitchSettingsPage::scanDirectionCb(void *data, Evas_Object *obj,
 void UniversalSwitchSettingsPage::scanMethodCb(void *data, Evas_Object *obj, void *event_info)
 {
        Evas_Object *ctxpopup;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1161,7 +1161,7 @@ void UniversalSwitchSettingsPage::scanMethodCb(void *data, Evas_Object *obj, voi
 
 void UniversalSwitchSettingsPage::scanNumberCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1188,7 +1188,7 @@ void UniversalSwitchSettingsPage::scanNumberChangedCb(SettingAccessibility *ad,
 
 void UniversalSwitchSettingsPage::autoScanIntervalCb(void *data, Evas_Object *obj, void *event_info)
 {
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(ad == NULL, "Data argument is NULL");
 
@@ -1214,8 +1214,8 @@ void UniversalSwitchSettingsPage::autoScanIntervalChangedCb(SettingAccessibility
 
 void UniversalSwitchSettingsPage::ScanDirectionCtxPopupCb(void *data, Evas_Object *obj, void *event_info)
 {
-       ScanDirection scan_dir = (ScanDirection)reinterpret_cast<long>(data);
-       SettingAccessibility *ad = (SettingAccessibility *)evas_object_data_get(obj, CTXPOPUP_DATA_AD);
+       ScanDirection scan_dir = (ScanDirection)reinterpret_cast<long>(data); //TODO change way the argument is being passed
+       auto ad = static_cast<SettingAccessibility*>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
        retm_if(ad == NULL, "ctxpopup data is NULL");
 
        if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL, NULL, (int *)&scan_dir, NULL)) {
@@ -1231,8 +1231,8 @@ void UniversalSwitchSettingsPage::ScanDirectionCtxPopupCb(void *data, Evas_Objec
 
 void UniversalSwitchSettingsPage::ScanMethodCtxPopupCb(void *data, Evas_Object *obj, void *event_info)
 {
-       ScanMethod scan_method = (ScanMethod)reinterpret_cast<long>(data);
-       SettingAccessibility *ad = (SettingAccessibility *)evas_object_data_get(obj, CTXPOPUP_DATA_AD);
+       ScanMethod scan_method = (ScanMethod)reinterpret_cast<long>(data);//TODO change way the argument is being passed
+       auto ad = static_cast<SettingAccessibility*>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
        retm_if(ad == NULL, "ctxpopup data is NULL");
 
        if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD, NULL, (int *)&scan_method, NULL)) {
@@ -1247,8 +1247,8 @@ void UniversalSwitchSettingsPage::ScanMethodCtxPopupCb(void *data, Evas_Object *
 void UniversalSwitchSettingsPage::autoScanCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -1266,7 +1266,7 @@ void UniversalSwitchSettingsPage::switchesClickCb(void *data, Evas_Object *obj,
 {
        elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        ad->switchesPage_ = std::make_unique<SwitchesPage>(ad);
        SwitchesPage::attachCallback(ad, updateSwitchesCount);
@@ -1281,7 +1281,7 @@ void UniversalSwitchSettingsPage::ctxPopupDelCb(void *data, Evas_Object *obj, vo
 
 Eina_Bool UniversalSwitchSettingsPage::naviframPopCb(void *data, Elm_Object_Item *it)
 {
-       SettingAccessibility *ad = (SettingAccessibility *) data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retv_if(ad == NULL, EINA_TRUE);
        ad->universal_switch_settings_item = NULL;
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, syncAutoScanWithVconf);
@@ -1295,7 +1295,7 @@ Eina_Bool UniversalSwitchSettingsPage::naviframPopCb(void *data, Elm_Object_Item
 void UniversalSwitchSettingsPage::backCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data argument is NULL");
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
 
        elm_naviframe_item_pop(ad->md.getNaviframe());
 }
@@ -1319,7 +1319,7 @@ void UniversalSwitchSettingsPage::syncCheckboxWithVconf(keynode_t *node, void *u
 {
        retm_if(user_data == NULL, "Data parameter is NULL");
        retm_if(node == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)user_data;
+       auto list_item = static_cast<GenGroupItemData*>(user_data);
        int ret = vconf_keynode_get_bool(node);
        retm_if(ret < 0, "FAIL: vconf_keynode_get_bool");
        if (list_item->chk_status != ret) {
@@ -1331,8 +1331,8 @@ void UniversalSwitchSettingsPage::syncCheckboxWithVconf(keynode_t *node, void *u
 void UniversalSwitchSettingsPage::autoMoveIntervalCheckboxCb(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto list_item = static_cast<GenGroupItemData*>(data);
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        retm_if(ad == NULL, "View data parameter is NULL");
 
        list_item->chk_status = elm_check_state_get(obj);
@@ -1368,11 +1368,11 @@ void UniversalSwitchSettingsPage::onAutoScanItemSelection(void *data, Evas_Objec
 
        elm_genlist_item_selected_set(item, EINA_FALSE);
 
-       GenGroupItemData *list_item = (GenGroupItemData *)elm_object_item_data_get(item);
+       auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
        setting_retm_if(list_item == NULL, "Data parameter is NULL");
        setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
 
-       SettingAccessibility *ad = (SettingAccessibility *)list_item->userdata;
+       auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
        ad->us_configuration.auto_scan = list_item->chk_status;
        elm_object_item_disabled_set(ad->universal_switch_auto_scan_int->item, (Eina_Bool)!ad->us_configuration.auto_scan);
        elm_object_item_disabled_set(ad->universal_switch_scans_num->item, (Eina_Bool)!ad->us_configuration.auto_scan);
index cbd138b..564d6e4 100644 (file)
@@ -29,7 +29,7 @@ void UpdateSwitchPage::attachActionCallback(SettingAccessibility *ad, UniversalS
 void UpdateSwitchPage::onActionUpdate(SettingAccessibility *ad, const std::string& action, void *user_data)
 {
        if (ad->us_configuration.switch_updated_cb) {
-               UniversalSwitchConfigurationItem *config_item = (UniversalSwitchConfigurationItem *)user_data;
+               auto config_item = static_cast<UniversalSwitchConfigurationItem*>(user_data);
                ad->us_configuration.switch_updated_cb(ad, config_item->switch_id, action, config_item->user_name);
        }
 }
index 69bad9d..b57b19f 100644 (file)
@@ -39,7 +39,7 @@ static void setting_accessibility_screen_reader_key_change_vconf_cb(
                keynode_t *key, void *user_data)
 {
 
-       GenGroupItemData *screen_reader_item = (GenGroupItemData *)user_data;
+       auto screen_reader_item = static_cast<GenGroupItemData*>(user_data);
        screen_reader_item->sub_desc = vconf_keynode_get_bool(key) ? _("IDS_ST_BODY_ON") : _("IDS_ST_BODY_OFF");
 
        elm_genlist_item_update(screen_reader_item->item);
@@ -54,7 +54,7 @@ static void setting_accessibility_screen_reader_key_change_vconf_cb(
 static Eina_Bool _cancel_cb(void *data, Elm_Object_Item *it)
 {
 
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        retv_if(!ad, EINA_FALSE);
 
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
@@ -68,7 +68,7 @@ static void setting_accessibility_vision_screen_reader_mouse_up_Gendial_list_cb(
 {
 
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set(item, EINA_FALSE);
        ad->screenReaderPage_ = std::make_unique<ScreenReaderPage>(ad);
 
@@ -78,7 +78,7 @@ static void setting_accessibility_universal_switch_mouse_up_Gendial_list_cb(void
 {
 
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set(item, EINA_FALSE);
        ad->universalSwitchPage_ = std::make_unique<UniversalSwitchPage>(ad);
 
@@ -88,7 +88,7 @@ static void setting_accessibility_accessibility_launcher_mouse_up_Gendial_list_c
 {
 
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        elm_genlist_item_selected_set(item, EINA_FALSE);
        ad->accessibilityLauncherPage_ = std::make_unique<AccessibilityLauncherPage>(ad);
 
@@ -108,7 +108,7 @@ int setting_accessibility_main_generate_genlist(void *data)
        /* error check */
        retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
 
-       SettingAccessibility *ad = (SettingAccessibility *)data;
+       auto ad = static_cast<SettingAccessibility*>(data);
        Evas_Object *scroller = ad->md.getGenlist();
        createGendialTitleItem(scroller, &(itc_group_item), "IDS_ST_HEADER_VISION");
 
@@ -167,7 +167,7 @@ int setting_accessibility_main_generate_genlist(void *data)
 static int setting_accessibility_main_create(void *cb)
 {
 
-       SettingAccessibility *ad = (SettingAccessibility *)cb;
+       auto ad = static_cast<SettingAccessibility*>(cb);
        retv_if(ad == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
 
        ad->md.initView(_("IDS_ST_BODY_ACCESSIBILITY"));
index 0d4892e..117030c 100755 (executable)
@@ -334,7 +334,7 @@ static void __bus_name_acquired(void *data, const char *bus, const char *old_id,
        if (!new_id || strlen(new_id) == 0)
                return;
 
-       UniversalSwitchDbusConfig *config = (UniversalSwitchDbusConfig *)data;
+       auto config = static_cast<UniversalSwitchDbusConfig*>(data);
        UniversalSwitchEldbus *eldbus = &config->eldbus;
 
        if (!eldbus->dobj && !(eldbus->dobj = eldbus_object_get(eldbus->conn, BUS, PATH))) {
@@ -420,7 +420,7 @@ std::vector<UniversalSwitchInfoType*> setting_accessibility_universal_switch_dbu
 
 static void __eldbus_on_capture_switch(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
 {
-       UniversalSwitchEldbus *eldbus = (UniversalSwitchEldbus *) data;
+       auto eldbus = static_cast<UniversalSwitchEldbus*>(data);
        const char *errname, *errmsg;
        const char *switch_id = NULL;
 
index 7bb4ad9..c9aa81f 100644 (file)
@@ -93,7 +93,7 @@ destroy_tts_handle(SettingAccessibility *ad)
 
 static char *_universal_switch_gendial_new_text_get(void *data, Evas_Object *obj, const char *part)
 {
-       GenGroupItemData *item_data = (GenGroupItemData *)data;
+       auto item_data = static_cast<GenGroupItemData*>(data);
        if (!safeStrCmp(item_data->itc.c_str(), "multiline")) {
                if (!safeStrCmp(part, "elm.text")) {
                        if (!item_data->keyStr.empty()) {
@@ -122,7 +122,7 @@ static bool on_app_create(void *priv)
 {
 
        setting_retvm_if((NULL == priv), NULL, "NULL == priv");
-       SettingAccessibility *ad = (SettingAccessibility *)priv;
+       auto ad = static_cast<SettingAccessibility*>(priv);
        ad->launched_by_app_control = false;
        ad->universal_switch_main_item = NULL;
        ad->universal_switch_settings_item = NULL;
@@ -167,7 +167,7 @@ static void on_app_resume(void *priv)
 static void on_app_terminate(void *priv)
 {
 
-       SettingAccessibility *ad = (SettingAccessibility *)priv;
+       auto ad = static_cast<SettingAccessibility*>(priv);
        destroy_tts_handle(ad);
        setting_view_destroy(&setting_view_accessibility_main, ad);
 
@@ -176,7 +176,7 @@ static void on_app_terminate(void *priv)
 static void on_app_control(app_control_h service, void *priv)
 {
 
-       SettingAccessibility *ad = (SettingAccessibility *)priv;
+       auto ad = static_cast<SettingAccessibility*>(priv);
        retm_if(!ad, "Data parameter is NULL");
        char *value = NULL;
        if (!app_control_get_extra_data(service, "SHOW_US_SETTINGS", &value) && value != NULL && !strcmp(value, "1")) {
index be2f411..39e01ad 100644 (file)
@@ -74,16 +74,14 @@ DEFINE_ITC1(SETTING_GENLIST_GROUP_INDEX_STYLE, itc_group_item);
 static void __radio_changed(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item =
-                       (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        list_item->chk_status = elm_radio_value_get(obj); /* for update */
 }
 
 static void __chk_changed(void *data, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Data parameter is NULL");
-       GenGroupItemData *list_item =
-                       (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        list_item->chk_status = elm_check_state_get(obj); /* for update */
 }
 
@@ -297,7 +295,7 @@ static ContentDrawer cd_right[static_cast<int>(SwallowType::MAX)] = {
 static void __multiline_eraser_clicked(void *data, Evas_Object *obj,
                void *event_info)
 {
-       GenGroupItemData *list_item = (GenGroupItemData *)data;
+       auto list_item = static_cast<GenGroupItemData*>(data);
        Evas_Object *entry = (Evas_Object *)elm_object_item_part_content_get(list_item->item,
                        "elm.icon.entry");
        /* After button is clicked, entry should get focus again. */
@@ -307,7 +305,7 @@ static void __multiline_eraser_clicked(void *data, Evas_Object *obj,
 
 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part)
 {
-       GenGroupItemData *item_data = (GenGroupItemData *)data;
+       auto item_data = static_cast<GenGroupItemData*>(data);
        ContentDrawer *cd_list = NULL;
        drawer_fp fp = NULL;
        retv_if(!item_data, NULL);
@@ -363,7 +361,7 @@ static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const
 
 static void _gl_Gendial_del(void *data, Evas_Object *obj)
 {
-       GenGroupItemData *item_data = (GenGroupItemData *)data;
+       auto item_data = static_cast<GenGroupItemData*>(data);
        if (item_data) {
                item_data->eo_check = NULL;/*set to NULL at once */
                item_data->itc = {};