Improve Portability: Support 64bit Systems 72/115672/1 accepted/tizen/unified/20170310.105006 accepted/tizen/wearable/20170310.103018 submit/tizen/20170310.070856 submit/tizen_unified/20170310.104109
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 21 Feb 2017 04:54:31 +0000 (13:54 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 21 Feb 2017 04:54:31 +0000 (13:54 +0900)
You have added another code that does not support 64bit systems.

PLEASE do not write such codes.

Change-Id: If01a7328808c46edd222dd5bd391d7feabbb1154
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
src/w-input-selector.cpp

index d7b14b5..270adce 100755 (executable)
@@ -22,6 +22,7 @@
 #include <string>
 #include <vconf.h>
 #include <vconf-keys.h>
+#include <stdint.h>
 
 #include "w-input-selector.h"
 #include "w-input-template.h"
@@ -175,7 +176,7 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info
        if (item) {
                elm_genlist_item_selected_set(item, EINA_FALSE);
 
-               index = (unsigned int) elm_object_item_data_get(item);
+               index = (uintptr_t) elm_object_item_data_get(item);
                const std::vector<TemplateData>  template_list = input_template_get_list();
 
                if (index < (int)template_list.size()) {
@@ -188,7 +189,7 @@ static void __ise_template_gl_sel(void *data, Evas_Object *obj, void *event_info
 static char * __ise_template_gl_text_get(void *data, Evas_Object *obj, const char *part)
 {
        if(!strcmp(part, "elm.text")) {
-               unsigned int index = (unsigned int)data;
+               unsigned int index = (uintptr_t)data;
                const std::vector<TemplateData>  template_list = input_template_get_list();
 
                if(index < template_list.size()) {
@@ -769,7 +770,7 @@ unsigned int _update_template_items(void *user_data)
                for (i = 0; i < template_list.size(); i++) {
                        elm_genlist_item_append(app_data->genlist,
                                        itc,
-                                       (void *)i,
+                                       (void *)(uintptr_t)i,
                                        NULL,
                                        ELM_GENLIST_ITEM_NONE,
                                        __ise_template_gl_sel,