From 00c0afddf7f8888a9c642ecfdf1e61691d2dd241 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Fri, 20 Jan 2017 14:35:18 +0100 Subject: [PATCH] fix compilation and warnings on gcc compiler Change-Id: I2a2ea0fc05578d8e9d460ddfa314031db45bd9a1 --- clock/src/View/AlarmView.cpp | 15 ++++++++++----- clock/src/View/DeleteAlarmView.cpp | 2 +- clock/src/View/EditAlarmView.cpp | 2 +- clock/src/View/StopWatchView.cpp | 7 +++++-- clock/src/View/WorldClockDeleteItemsView.cpp | 13 +++++++++---- clock/src/View/WorldClockReorderView.cpp | 13 +++++++++---- clock/src/View/WorldClockView.cpp | 17 +++++++++++------ 7 files changed, 46 insertions(+), 23 deletions(-) diff --git a/clock/src/View/AlarmView.cpp b/clock/src/View/AlarmView.cpp index bfb5f72..698f728 100644 --- a/clock/src/View/AlarmView.cpp +++ b/clock/src/View/AlarmView.cpp @@ -49,10 +49,15 @@ struct ItemData { }; Elm_Genlist_Item_Class AlarmView::alarm_itc = { - .item_style = "alarm", - .func.content_get = AlarmView::ContentGet, - .func.text_get = AlarmView::TextGet, - .func.del = AlarmView::Del, + 0, 0, EINA_FALSE, EINA_TRUE, + "alarm", nullptr, nullptr, + { AlarmView::TextGet, + AlarmView::ContentGet, + nullptr, + AlarmView::Del, + nullptr, + nullptr, + } }; void AlarmView::ItemClicked(void *data, Evas_Object *obj, void *info) @@ -155,7 +160,7 @@ void AlarmView::Del(void *data, Evas_Object *obj) delete id; } -AlarmView::AlarmView(ui::IView &main) +AlarmView::AlarmView(ui::IView &main) : label_(nullptr) { /* Base Layout */ content_ = elm_layout_add(main.GetEvasObject()); diff --git a/clock/src/View/DeleteAlarmView.cpp b/clock/src/View/DeleteAlarmView.cpp index 1ba05d8..1c3bfb2 100644 --- a/clock/src/View/DeleteAlarmView.cpp +++ b/clock/src/View/DeleteAlarmView.cpp @@ -97,7 +97,7 @@ void DeleteAlarmView::ItemSelectToggle(void *data, Evas_Object *obj, void *event id->instance->all_selected_ = false; elm_check_state_set(id->instance->all_selected_check_, id->instance->all_selected_); } else { - int items_count = elm_genlist_items_count(id->instance->content_) - 1; + unsigned int items_count = elm_genlist_items_count(id->instance->content_) - 1; std::vector ids = id->instance->GetSelectedItems(); if (items_count == ids.size()) { id->instance->all_selected_ = true; diff --git a/clock/src/View/EditAlarmView.cpp b/clock/src/View/EditAlarmView.cpp index 83abfc5..06e8c07 100644 --- a/clock/src/View/EditAlarmView.cpp +++ b/clock/src/View/EditAlarmView.cpp @@ -65,7 +65,7 @@ static std::string join(std::vector &array, std::string delimiter) { std::string acc; - for (int i = 0; i < array.size(); i++) { + for (unsigned int i = 0; i < array.size(); i++) { if (i != 0) acc.append(delimiter); acc.append(array[i]); diff --git a/clock/src/View/StopWatchView.cpp b/clock/src/View/StopWatchView.cpp index 0906662..e4f323e 100644 --- a/clock/src/View/StopWatchView.cpp +++ b/clock/src/View/StopWatchView.cpp @@ -28,8 +28,11 @@ const char *StopWatchView::EDJE_FILE = "edje/StopWatch.edj"; const char *StopWatchView::GROUP = "StopWatch"; const Elm_Genlist_Item_Class StopWatchView::list_itc = { - .item_style = "lap", - .func.text_get = GetListText, + 0, 0, EINA_FALSE, EINA_TRUE, + "lap", nullptr, nullptr, + { GetListText, + nullptr, nullptr, nullptr, nullptr, nullptr, + } }; StopWatchView::StopWatchView(ui::IView &main) diff --git a/clock/src/View/WorldClockDeleteItemsView.cpp b/clock/src/View/WorldClockDeleteItemsView.cpp index c8da4ea..ce3243c 100644 --- a/clock/src/View/WorldClockDeleteItemsView.cpp +++ b/clock/src/View/WorldClockDeleteItemsView.cpp @@ -60,10 +60,15 @@ struct LocationDeleteItemData { /* Delete list View */ Elm_Genlist_Item_Class WorldClockDeleteItemsView::world_clock_delete_view_itc_= { - .item_style = "worldclock.delete/reorder.list", - .func.content_get = WorldClockDeleteItemsView::ContentGet, - .func.text_get = WorldClockDeleteItemsView::TextGet, - .func.del = WorldClockDeleteItemsView::Del + 0, 0, EINA_FALSE, EINA_TRUE, + "worldclock.delete/reorder.list", nullptr, nullptr, + { WorldClockDeleteItemsView::TextGet, + WorldClockDeleteItemsView::ContentGet, + nullptr, + WorldClockDeleteItemsView::Del, + nullptr, + nullptr, + } }; void WorldClockDeleteItemsView::AppendItems(std::vector locations) diff --git a/clock/src/View/WorldClockReorderView.cpp b/clock/src/View/WorldClockReorderView.cpp index e4e0651..764d974 100644 --- a/clock/src/View/WorldClockReorderView.cpp +++ b/clock/src/View/WorldClockReorderView.cpp @@ -55,10 +55,15 @@ struct LocationReorderItemData { /* Reorder list View */ Elm_Genlist_Item_Class WorldClockReorderView::world_clock_reorder_items_view_itc_ = { - .item_style = "worldclock.delete/reorder.list", - .func.content_get = WorldClockReorderView::ContentGet, - .func.text_get = WorldClockReorderView::TextGet, - .func.del = WorldClockReorderView::Del + 0, 0, EINA_FALSE, EINA_TRUE, + "worldclock.delete/reorder.list", nullptr, nullptr, + { WorldClockReorderView::TextGet, + WorldClockReorderView::ContentGet, + nullptr, + WorldClockReorderView::Del, + nullptr, + nullptr, + } }; diff --git a/clock/src/View/WorldClockView.cpp b/clock/src/View/WorldClockView.cpp index 786e71e..c5b78c8 100644 --- a/clock/src/View/WorldClockView.cpp +++ b/clock/src/View/WorldClockView.cpp @@ -64,10 +64,15 @@ struct LocationItemData { /* Custom list View */ Elm_Genlist_Item_Class WorldClockView::world_clock_itc_= { - .item_style = "worldclock.custom.list", - .func.content_get = WorldClockView::ContentGet, - .func.text_get = WorldClockView::TextGet, - .func.del = WorldClockView::Del, + 0, 0, EINA_FALSE, EINA_TRUE, + "worldclock.custom.list", nullptr, nullptr, + { WorldClockView::TextGet, + WorldClockView::ContentGet, + nullptr, + WorldClockView::Del, + nullptr, + nullptr, + } }; @@ -512,7 +517,7 @@ Evas_Object *WorldClockView::CreateFloatingButton() void WorldClockView::UpdateTimezoneLocationsDots(const model::Timezone *timezone) { - for (int i = 0; i < 8; i++) { + for (unsigned int i = 0; i < 8; i++) { Edje_Message_Int_Set *msg; msg = (Edje_Message_Int_Set *) malloc( sizeof(Edje_Message_Int_Set) + 3 * sizeof(int)); @@ -694,7 +699,7 @@ void WorldClockView::UpdateTimezoneCitiesList(const model::Timezone *timezone) char cities[MAX_CITIES_LEN]; snprintf(cities, sizeof(cities), "%s", cities_list->at(0).name.c_str()); - for (int i = 1; i < cities_list->size(); i++) { + for (unsigned int i = 1; i < cities_list->size(); i++) { char *tmp = strdup(cities); snprintf(cities, sizeof(cities), "%s, %s", tmp, cities_list->at(i).name.c_str()); free(tmp); -- 2.7.4