summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Callaway <spot@fedoraproject.org>2020-01-31 12:40:45 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-31 14:31:57 +0100
commitc245b576aad09ac5faeb800de7f7c4fef87c6363 (patch)
tree15be97f328d4756f308d1bcf4ec2b135cbc75850
parent5af0e65bffa612f51ac72f4c78ba005dd1da63e2 (diff)
Fix build with gcc 10 (which has -fno-common enabled by default).
EFL failed to build from source in Fedora Rawhide as a result of the update to GCC 10. GCC 10 enables -fno-common by default, and this found three issues in EFL: # The eina benchmark code defined int key_size in a header that was included in multiple places. # The elementary test code defines the "dt1", "dt2", "dt3" vars in two code files which are compiled together (but these variables do not appear to be used globally) # The eio test code defines the "ee" var in two code files which are compiled together (but this variable does not appear to be used globally) I've fixed these issues and confirmed locally that the code builds again in Fedora. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11259
-rw-r--r--src/benchmarks/eina/eina_bench.h2
-rw-r--r--src/benchmarks/eina/eina_bench_crc_hash.c1
-rw-r--r--src/bin/elementary/test_ui_clock.c90
-rw-r--r--src/tests/eio/eio_test_map.c10
4 files changed, 52 insertions, 51 deletions
diff --git a/src/benchmarks/eina/eina_bench.h b/src/benchmarks/eina/eina_bench.h
index a38d70433e..747ac6f39f 100644
--- a/src/benchmarks/eina/eina_bench.h
+++ b/src/benchmarks/eina/eina_bench.h
@@ -21,7 +21,7 @@
21 21
22#include "eina_benchmark.h" 22#include "eina_benchmark.h"
23 23
24int key_size; 24extern int key_size;
25 25
26void eina_bench_hash(Eina_Benchmark *bench); 26void eina_bench_hash(Eina_Benchmark *bench);
27void eina_bench_crc_hash_short(Eina_Benchmark *bench); 27void eina_bench_crc_hash_short(Eina_Benchmark *bench);
diff --git a/src/benchmarks/eina/eina_bench_crc_hash.c b/src/benchmarks/eina/eina_bench_crc_hash.c
index b6734489a3..7750233ed4 100644
--- a/src/benchmarks/eina/eina_bench_crc_hash.c
+++ b/src/benchmarks/eina/eina_bench_crc_hash.c
@@ -26,6 +26,7 @@
26uint64_t CityHash64(const char *buf, size_t len); 26uint64_t CityHash64(const char *buf, size_t len);
27#endif 27#endif
28 28
29int key_size;
29char *key_str=NULL; 30char *key_str=NULL;
30 31
31void repchar(int n) 32void repchar(int n)
diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c
index 79e9074ead..9973b25cd3 100644
--- a/src/bin/elementary/test_ui_clock.c
+++ b/src/bin/elementary/test_ui_clock.c
@@ -6,7 +6,7 @@
6 6
7/* A simple test, just displaying clock in its default format */ 7/* A simple test, just displaying clock in its default format */
8 8
9Evas_Object *dt1, *dt2, *dt3, *dt4; 9Evas_Object *uicdt1, *uicdt2, *uicdt3, *uicdt4;
10 10
11static void 11static void
12_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 12_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
@@ -28,19 +28,19 @@ _bt_clicked(void *data EINA_UNUSED, const Efl_Event *ev)
28 new_time.tm_mday = 26; 28 new_time.tm_mday = 26;
29 new_time.tm_hour = 9; 29 new_time.tm_hour = 9;
30 new_time.tm_min = 0; 30 new_time.tm_min = 0;
31 efl_ui_clock_field_visible_set(dt1, EFL_UI_CLOCK_TYPE_HOUR, EINA_TRUE); 31 efl_ui_clock_field_visible_set(uicdt1, EFL_UI_CLOCK_TYPE_HOUR, EINA_TRUE);
32 efl_ui_clock_field_visible_set(dt1, EFL_UI_CLOCK_TYPE_MINUTE, EINA_TRUE); 32 efl_ui_clock_field_visible_set(uicdt1, EFL_UI_CLOCK_TYPE_MINUTE, EINA_TRUE);
33 efl_ui_clock_field_visible_set(dt1, EFL_UI_CLOCK_TYPE_AMPM, EINA_TRUE); 33 efl_ui_clock_field_visible_set(uicdt1, EFL_UI_CLOCK_TYPE_AMPM, EINA_TRUE);
34 efl_ui_clock_field_visible_set(dt1, EFL_UI_CLOCK_TYPE_SECOND, EINA_TRUE); 34 efl_ui_clock_field_visible_set(uicdt1, EFL_UI_CLOCK_TYPE_SECOND, EINA_TRUE);
35 efl_ui_clock_field_visible_set(dt1, EFL_UI_CLOCK_TYPE_DAY, EINA_TRUE); 35 efl_ui_clock_field_visible_set(uicdt1, EFL_UI_CLOCK_TYPE_DAY, EINA_TRUE);
36 efl_ui_clock_time_set(dt1, new_time); 36 efl_ui_clock_time_set(uicdt1, new_time);
37 37
38 elm_object_disabled_set(dt1, EINA_TRUE); 38 elm_object_disabled_set(uicdt1, EINA_TRUE);
39 elm_object_disabled_set(ev->object, EINA_TRUE); 39 elm_object_disabled_set(ev->object, EINA_TRUE);
40 40
41 efl_del(dt2); 41 efl_del(uicdt2);
42 efl_del(dt3); 42 efl_del(uicdt3);
43 dt2 = dt3 = NULL; 43 uicdt2 = uicdt3 = NULL;
44} 44}
45 45
46void 46void
@@ -56,33 +56,33 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
56 efl_content_set(win, efl_added), 56 efl_content_set(win, efl_added),
57 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); 57 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240)));
58 58
59 dt1 = efl_add(EFL_UI_CLOCK_CLASS, bx, 59 uicdt1 = efl_add(EFL_UI_CLOCK_CLASS, bx,
60 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 60 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
61 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), 61 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
62 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_HOUR, EINA_FALSE), 62 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_HOUR, EINA_FALSE),
63 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MINUTE, EINA_FALSE), 63 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MINUTE, EINA_FALSE),
64 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_AMPM, EINA_FALSE), 64 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_AMPM, EINA_FALSE),
65 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_SECOND, EINA_FALSE), 65 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_SECOND, EINA_FALSE),
66 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DAY, EINA_FALSE), 66 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DAY, EINA_FALSE),
67 efl_ui_clock_pause_set(efl_added, EINA_TRUE), 67 efl_ui_clock_pause_set(efl_added, EINA_TRUE),
68 efl_event_callback_add(efl_added, EFL_UI_CLOCK_EVENT_CHANGED, _changed_cb, NULL), 68 efl_event_callback_add(efl_added, EFL_UI_CLOCK_EVENT_CHANGED, _changed_cb, NULL),
69 efl_pack(bx, efl_added)); 69 efl_pack(bx, efl_added));
70 70
71 dt2 = efl_add(EFL_UI_CLOCK_CLASS, bx, 71 uicdt2 = efl_add(EFL_UI_CLOCK_CLASS, bx,
72 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 72 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
73 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), 73 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
74 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_YEAR, EINA_FALSE), 74 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_YEAR, EINA_FALSE),
75 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MONTH, EINA_FALSE), 75 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MONTH, EINA_FALSE),
76 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DATE, EINA_FALSE), 76 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DATE, EINA_FALSE),
77 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_SECOND, EINA_FALSE), 77 efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_SECOND, EINA_FALSE),
78 efl_ui_clock_pause_set(efl_added, EINA_TRUE), 78 efl_ui_clock_pause_set(efl_added, EINA_TRUE),
79 efl_pack(bx, efl_added)); 79 efl_pack(bx, efl_added));
80 elm_object_disabled_set(dt2, EINA_TRUE); 80 elm_object_disabled_set(uicdt2, EINA_TRUE);
81 81
82 dt3 = efl_add(EFL_UI_CLOCK_CLASS, bx, 82 uicdt3 = efl_add(EFL_UI_CLOCK_CLASS, bx,
83 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 83 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
84 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), 84 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
85 efl_pack(bx, efl_added)); 85 efl_pack(bx, efl_added));
86 86
87 efl_add(EFL_UI_TEXTBOX_CLASS, bx, 87 efl_add(EFL_UI_TEXTBOX_CLASS, bx,
88 efl_text_set(efl_added, "Editable Clock:"), 88 efl_text_set(efl_added, "Editable Clock:"),
@@ -92,12 +92,12 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
92 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 25)), 92 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 25)),
93 efl_pack(bx, efl_added)); 93 efl_pack(bx, efl_added));
94 94
95 dt4 = efl_add(EFL_UI_CLOCK_CLASS, bx, 95 uicdt4 = efl_add(EFL_UI_CLOCK_CLASS, bx,
96 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 96 efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
97 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), 97 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
98 efl_ui_clock_edit_mode_set(efl_added, EINA_TRUE), 98 efl_ui_clock_edit_mode_set(efl_added, EINA_TRUE),
99 efl_ui_clock_pause_set(efl_added, EINA_TRUE), 99 efl_ui_clock_pause_set(efl_added, EINA_TRUE),
100 efl_pack(bx, efl_added)); 100 efl_pack(bx, efl_added));
101 101
102 efl_add(EFL_UI_BUTTON_CLASS, win, 102 efl_add(EFL_UI_BUTTON_CLASS, win,
103 efl_text_set(efl_added, "Back to the future..."), 103 efl_text_set(efl_added, "Back to the future..."),
diff --git a/src/tests/eio/eio_test_map.c b/src/tests/eio/eio_test_map.c
index fdb0631a9d..f794f73d73 100644
--- a/src/tests/eio/eio_test_map.c
+++ b/src/tests/eio/eio_test_map.c
@@ -14,7 +14,7 @@
14 14
15#include "eio_suite.h" 15#include "eio_suite.h"
16 16
17Eina_File *ee; 17Eina_File *eie;
18 18
19static void 19static void
20_done_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED) 20_done_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED)
@@ -25,7 +25,7 @@ _done_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED)
25static void 25static void
26_open_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, Eina_File *ef) 26_open_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, Eina_File *ef)
27{ 27{
28 ee = ef; 28 eie = ef;
29 ecore_main_loop_quit(); 29 ecore_main_loop_quit();
30} 30}
31 31
@@ -70,17 +70,17 @@ EFL_START_TEST(eio_test_map_simple)
70 ecore_main_loop_begin(); 70 ecore_main_loop_begin();
71 fail_if(!ef); 71 fail_if(!ef);
72 72
73 ef = eio_file_map_all(ee, EINA_FILE_POPULATE, _filter_cb, _map_cb, 73 ef = eio_file_map_all(eie, EINA_FILE_POPULATE, _filter_cb, _map_cb,
74 _error_cb, data); 74 _error_cb, data);
75 ecore_main_loop_begin(); 75 ecore_main_loop_begin();
76 fail_if(!ef); 76 fail_if(!ef);
77 77
78 ef = eio_file_map_new(ee, EINA_FILE_WILLNEED, 0, strlen(data), _filter_cb, 78 ef = eio_file_map_new(eie, EINA_FILE_WILLNEED, 0, strlen(data), _filter_cb,
79 _map_cb, _error_cb, data); 79 _map_cb, _error_cb, data);
80 ecore_main_loop_begin(); 80 ecore_main_loop_begin();
81 fail_if(!ef); 81 fail_if(!ef);
82 82
83 ef = eio_file_close(ee, _done_cb, _error_cb, NULL); 83 ef = eio_file_close(eie, _done_cb, _error_cb, NULL);
84 ecore_main_loop_begin(); 84 ecore_main_loop_begin();
85 fail_if(!ef); 85 fail_if(!ef);
86 86