summaryrefslogtreecommitdiff
path: root/src/examples/elementary
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-08-01 06:44:00 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-08-01 14:37:02 -0700
commit085de22d4285237297e9f0f386322cd99578860d (patch)
tree9a9a84a6511a4413d29f6830a3b66b4054c4ed8e /src/examples/elementary
parent4f45749b14abeae6c0338f07b42970e814f85b8e (diff)
examples: cast to uintptr_t instead of long
on Windows, long is a 32 bits type Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9470
Diffstat (limited to 'src/examples/elementary')
-rw-r--r--src/examples/elementary/genlist_example_01.c6
-rw-r--r--src/examples/elementary/genlist_example_02.c6
-rw-r--r--src/examples/elementary/genlist_example_03.c6
-rw-r--r--src/examples/elementary/genlist_example_04.c16
4 files changed, 17 insertions, 17 deletions
diff --git a/src/examples/elementary/genlist_example_01.c b/src/examples/elementary/genlist_example_01.c
index b8afb22..7ab3ad5 100644
--- a/src/examples/elementary/genlist_example_01.c
+++ b/src/examples/elementary/genlist_example_01.c
@@ -11,7 +11,7 @@ static char *
11_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 11_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
12{ 12{
13 char buf[256]; 13 char buf[256];
14 snprintf(buf, sizeof(buf), "Item # %i", (int)(long)data); 14 snprintf(buf, sizeof(buf), "Item # %i", (int)(uintptr_t)data);
15 return strdup(buf); 15 return strdup(buf);
16} 16}
17 17
@@ -39,7 +39,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
39{ 39{
40 Evas_Object *win; 40 Evas_Object *win;
41 Evas_Object *list; 41 Evas_Object *list;
42 int i; 42 unsigned int i;
43 43
44 win = elm_win_util_standard_add("genlist", "Genlist"); 44 win = elm_win_util_standard_add("genlist", "Genlist");
45 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 45 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@@ -60,7 +60,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
60 for (i = 0; i < N_ITEMS; i++) 60 for (i = 0; i < N_ITEMS; i++)
61 { 61 {
62 elm_genlist_item_append(list, _itc, 62 elm_genlist_item_append(list, _itc,
63 (void *)(long)i, NULL, 63 (void *)(uintptr_t)i, NULL,
64 ELM_GENLIST_ITEM_NONE, 64 ELM_GENLIST_ITEM_NONE,
65 _item_sel_cb, NULL); 65 _item_sel_cb, NULL);
66 } 66 }
diff --git a/src/examples/elementary/genlist_example_02.c b/src/examples/elementary/genlist_example_02.c
index bce62cc..77c81ac 100644
--- a/src/examples/elementary/genlist_example_02.c
+++ b/src/examples/elementary/genlist_example_02.c
@@ -13,7 +13,7 @@ _item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_
13{ 13{
14 time_t t = (time_t)ecore_time_unix_get(); 14 time_t t = (time_t)ecore_time_unix_get();
15 char buf[256]; 15 char buf[256];
16 int i = (int)(long)data; 16 int i = (int)(uintptr_t)data;
17 if (i % 2) 17 if (i % 2)
18 { 18 {
19 int n; 19 int n;
@@ -90,7 +90,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
90{ 90{
91 Evas_Object *win, *box, *hbox; 91 Evas_Object *win, *box, *hbox;
92 Evas_Object *list, *btn; 92 Evas_Object *list, *btn;
93 int i; 93 unsigned int i;
94 94
95 win = elm_win_util_standard_add("genlist", "Genlist - simple"); 95 win = elm_win_util_standard_add("genlist", "Genlist - simple");
96 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 96 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@@ -151,7 +151,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
151 for (i = 0; i < N_ITEMS; i++) 151 for (i = 0; i < N_ITEMS; i++)
152 { 152 {
153 elm_genlist_item_append(list, _itc, 153 elm_genlist_item_append(list, _itc,
154 (void *)(long)i, NULL, 154 (void *)(uintptr_t)i, NULL,
155 ELM_GENLIST_ITEM_NONE, 155 ELM_GENLIST_ITEM_NONE,
156 _item_sel_cb, NULL); 156 _item_sel_cb, NULL);
157 } 157 }
diff --git a/src/examples/elementary/genlist_example_03.c b/src/examples/elementary/genlist_example_03.c
index 2517962..ec23360 100644
--- a/src/examples/elementary/genlist_example_03.c
+++ b/src/examples/elementary/genlist_example_03.c
@@ -12,7 +12,7 @@ _item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
12{ 12{
13 time_t t = (time_t)ecore_time_unix_get(); 13 time_t t = (time_t)ecore_time_unix_get();
14 char buf[256]; 14 char buf[256];
15 int i = (int)(long)data; 15 int i = (int)(uintptr_t)data;
16 16
17 if (!strcmp(part, "elm.text")) 17 if (!strcmp(part, "elm.text"))
18 snprintf(buf, sizeof(buf), "Item # %i", i); 18 snprintf(buf, sizeof(buf), "Item # %i", i);
@@ -60,12 +60,12 @@ _genlist_add(Evas_Object *box)
60static void 60static void
61_genlist_fill(Evas_Object *list) 61_genlist_fill(Evas_Object *list)
62{ 62{
63 int i; 63 unsigned int i;
64 64
65 for (i = 0; i < N_ITEMS; i++) 65 for (i = 0; i < N_ITEMS; i++)
66 { 66 {
67 elm_genlist_item_append(list, _itc, 67 elm_genlist_item_append(list, _itc,
68 (void *)(long)i, NULL, 68 (void *)(uintptr_t)i, NULL,
69 ELM_GENLIST_ITEM_NONE, 69 ELM_GENLIST_ITEM_NONE,
70 _item_sel_cb, NULL); 70 _item_sel_cb, NULL);
71 } 71 }
diff --git a/src/examples/elementary/genlist_example_04.c b/src/examples/elementary/genlist_example_04.c
index abb15dd..48a722b 100644
--- a/src/examples/elementary/genlist_example_04.c
+++ b/src/examples/elementary/genlist_example_04.c
@@ -14,7 +14,7 @@ _item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
14{ 14{
15 time_t t = (time_t)ecore_time_unix_get(); 15 time_t t = (time_t)ecore_time_unix_get();
16 char buf[256]; 16 char buf[256];
17 int i = (int)(long)data; 17 int i = (int)(uintptr_t)data;
18 18
19 if (!strcmp(part, "elm.text")) 19 if (!strcmp(part, "elm.text"))
20 snprintf(buf, sizeof(buf), "Item # %i", i); 20 snprintf(buf, sizeof(buf), "Item # %i", i);
@@ -52,7 +52,7 @@ static char *
52_group_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 52_group_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
53{ 53{
54 char buf[256]; 54 char buf[256];
55 int i = (int)(long)data; 55 int i = (int)(uintptr_t)data;
56 56
57 snprintf(buf, sizeof(buf), "Group %d (item #%d)", i / 7, i); 57 snprintf(buf, sizeof(buf), "Group %d (item #%d)", i / 7, i);
58 58
@@ -77,7 +77,7 @@ _append_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
77 Evas_Object *list = data; 77 Evas_Object *list = data;
78 78
79 elm_genlist_item_append(list, _itc, 79 elm_genlist_item_append(list, _itc,
80 (void *)(long)nitems++, NULL, 80 (void *)(uintptr_t)nitems++, NULL,
81 ELM_GENLIST_ITEM_NONE, 81 ELM_GENLIST_ITEM_NONE,
82 _item_sel_cb, NULL); 82 _item_sel_cb, NULL);
83 83
@@ -89,7 +89,7 @@ _prepend_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED
89 Evas_Object *list = data; 89 Evas_Object *list = data;
90 90
91 elm_genlist_item_prepend(list, _itc, 91 elm_genlist_item_prepend(list, _itc,
92 (void *)(long)nitems++, NULL, 92 (void *)(uintptr_t)nitems++, NULL,
93 ELM_GENLIST_ITEM_NONE, 93 ELM_GENLIST_ITEM_NONE,
94 _item_sel_cb, NULL); 94 _item_sel_cb, NULL);
95 95
@@ -104,7 +104,7 @@ _insert_before_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_
104 if (!glit) return; 104 if (!glit) return;
105 105
106 elm_genlist_item_insert_before(list, _itc, 106 elm_genlist_item_insert_before(list, _itc,
107 (void *)(long)nitems++, NULL, 107 (void *)(uintptr_t)nitems++, NULL,
108 glit, ELM_GENLIST_ITEM_NONE, 108 glit, ELM_GENLIST_ITEM_NONE,
109 _item_sel_cb, NULL); 109 _item_sel_cb, NULL);
110 110
@@ -119,7 +119,7 @@ _insert_after_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_U
119 if (!glit) return; 119 if (!glit) return;
120 120
121 elm_genlist_item_insert_after(list, _itc, 121 elm_genlist_item_insert_after(list, _itc,
122 (void *)(long)nitems++, NULL, 122 (void *)(uintptr_t)nitems++, NULL,
123 glit, ELM_GENLIST_ITEM_NONE, 123 glit, ELM_GENLIST_ITEM_NONE,
124 _item_sel_cb, NULL); 124 _item_sel_cb, NULL);
125 125
@@ -305,7 +305,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
305 if (i % 7 == 0) 305 if (i % 7 == 0)
306 { 306 {
307 glg = gli = elm_genlist_item_append(list, _itc_group, 307 glg = gli = elm_genlist_item_append(list, _itc_group,
308 (void *)(long)nitems++, NULL, 308 (void *)(uintptr_t)nitems++, NULL,
309 ELM_GENLIST_ITEM_GROUP, 309 ELM_GENLIST_ITEM_GROUP,
310 _item_sel_cb, NULL); 310 _item_sel_cb, NULL);
311 elm_genlist_item_select_mode_set(gli, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); 311 elm_genlist_item_select_mode_set(gli, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
@@ -313,7 +313,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
313 else 313 else
314 { 314 {
315 gli = elm_genlist_item_append(list, _itc, 315 gli = elm_genlist_item_append(list, _itc,
316 (void *)(long)nitems++, glg, 316 (void *)(uintptr_t)nitems++, glg,
317 ELM_GENLIST_ITEM_NONE, 317 ELM_GENLIST_ITEM_NONE,
318 _item_sel_cb, NULL); 318 _item_sel_cb, NULL);
319 } 319 }