summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-05-24 02:27:11 +0200
committerCedric Bail <cedric.bail@free.fr>2014-05-24 02:27:15 +0200
commit72ee78b929d6af5436d09eee1a5ef41719b5f918 (patch)
tree187c336777624af8194778959beb7ff3a65e0cbb /src/examples
parente68225ae691bfa5d8df694fc1f4bd96f1fee9003 (diff)
efl: remove some warnings.
Summary: Mainly from the examples but also from libunibreak and tests/eet. I'm not sure if it's really worth to remove warnings from the examples -- because it adds pedantic-ness to something supposed to be didatic, but I leave for you guys to judge. Reviewers: tasn, cedric CC: felipealmeida, raster, smohanty, cedric Differential Revision: https://phab.enlightenment.org/D896 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Diffstat (limited to '')
-rw-r--r--src/examples/ecore/ecore_idler_example.c6
-rw-r--r--src/examples/eet/eet-data-cipher_decipher.c9
-rw-r--r--src/examples/eina/eina_hash_01.c6
-rw-r--r--src/examples/eina/eina_hash_02.c10
-rw-r--r--src/examples/eina/eina_hash_03.c4
-rw-r--r--src/examples/eina/eina_hash_04.c4
-rw-r--r--src/examples/eina/eina_hash_05.c4
-rw-r--r--src/examples/eina/eina_hash_06.c12
-rw-r--r--src/examples/eina/eina_list_01.c2
-rw-r--r--src/examples/eina/eina_list_02.c2
-rw-r--r--src/examples/eina/eina_list_03.c2
-rw-r--r--src/examples/eina/eina_list_04.c2
-rw-r--r--src/examples/eina/eina_strbuf_01.c2
-rw-r--r--src/examples/eina/eina_value_01.c2
-rw-r--r--src/examples/eina/eina_value_02.c2
-rw-r--r--src/examples/eina/eina_value_03.c2
-rw-r--r--src/examples/eina/eina_xattr_01.c2
-rw-r--r--src/examples/eldbus/complex-types-client-eina-value.c2
-rw-r--r--src/examples/evas/evas-map-utils.c3
19 files changed, 54 insertions, 24 deletions
diff --git a/src/examples/ecore/ecore_idler_example.c b/src/examples/ecore/ecore_idler_example.c
index b33d86f..144f56f 100644
--- a/src/examples/ecore/ecore_idler_example.c
+++ b/src/examples/ecore/ecore_idler_example.c
@@ -1,8 +1,12 @@
1//Compile with: 1//Compile with:
2// gcc -o ecore_idler_example ecore_idler_example.c `pkg-config --libs --cflags ecore eo` 2// gcc -o ecore_idler_example ecore_idler_example.c `pkg-config --libs --cflags ecore eo`
3 3
4#ifdef HAVE_CONFIG_H
5# include <config.h>
6#endif
7
4#include <Ecore.h> 8#include <Ecore.h>
5//#include <Ecore_Eo.h> 9#include <Eo.h>
6#include <unistd.h> 10#include <unistd.h>
7 11
8struct context // helper struct to give some context to the callbacks 12struct context // helper struct to give some context to the callbacks
diff --git a/src/examples/eet/eet-data-cipher_decipher.c b/src/examples/eet/eet-data-cipher_decipher.c
index 1708b78..4ff94d5 100644
--- a/src/examples/eet/eet-data-cipher_decipher.c
+++ b/src/examples/eet/eet-data-cipher_decipher.c
@@ -8,6 +8,7 @@
8#include <sys/types.h> 8#include <sys/types.h>
9#include <sys/stat.h> 9#include <sys/stat.h>
10#include <unistd.h> 10#include <unistd.h>
11#include <string.h>
11 12
12int 13int
13main(void) 14main(void)
@@ -16,17 +17,19 @@ main(void)
16 const char *key = "This is a crypto key"; 17 const char *key = "This is a crypto key";
17 const char *key_bad = "This is another crypto key"; 18 const char *key_bad = "This is another crypto key";
18 19
19 char *file = strdup("/tmp/eet_cipher_example_XXXXX"); 20 char *file = strdup("/tmp/eet_cipher_example_XXXXXX");
20 Eet_File *ef; 21 Eet_File *ef;
21 char *test; 22 char *test;
22 int size; 23 int size;
24 int tmpfd;
23 25
24 eet_init(); 26 eet_init();
25 27
26 if (!(file = tmpnam(file))) 28 if (-1 == (tmpfd = mkstemp(file)) || !!close(tmpfd))
27 { 29 {
28 fprintf( 30 fprintf(
29 stderr, "ERROR: could not create temporary file (%s).\n", file); 31 stderr, "ERROR: could not create temporary file (%s) : %s\n",
32 file, strerror(errno));
30 goto panic; 33 goto panic;
31 } 34 }
32 35
diff --git a/src/examples/eina/eina_hash_01.c b/src/examples/eina/eina_hash_01.c
index 75181af..acd894c 100644
--- a/src/examples/eina/eina_hash_01.c
+++ b/src/examples/eina/eina_hash_01.c
@@ -37,8 +37,8 @@ _phone_entry_free_cb(void *data)
37} 37}
38 38
39static Eina_Bool 39static Eina_Bool
40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, 40_phone_book_foreach_cb(const Eina_Hash *phone_book EINA_UNUSED, const void *key,
41 void *data, void *fdata) 41 void *data, void *fdata EINA_UNUSED)
42{ 42{
43 const char *name = key; 43 const char *name = key;
44 const char *number = data; 44 const char *number = data;
@@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
51int 51int
52main(int argc, const char *argv[]) 52main(int argc, const char *argv[])
53{ 53{
54 (void) argc;
55 (void) argv;
54 Eina_Hash *phone_book = NULL; 56 Eina_Hash *phone_book = NULL;
55 int i; 57 int i;
56 const char *entry_name = "Heitor Villa-Lobos"; 58 const char *entry_name = "Heitor Villa-Lobos";
diff --git a/src/examples/eina/eina_hash_02.c b/src/examples/eina/eina_hash_02.c
index 7baec93..348c6d1 100644
--- a/src/examples/eina/eina_hash_02.c
+++ b/src/examples/eina/eina_hash_02.c
@@ -47,7 +47,9 @@ _phone_book_stringshared_free_cb(void *data)
47 47
48static Eina_Bool 48static Eina_Bool
49_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book, 49_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book,
50 const void *key, void *data, void *fdata) 50 const void *key EINA_UNUSED,
51 void *data,
52 void *fdata EINA_UNUSED)
51{ 53{
52 Phone_Entry *e = data; 54 Phone_Entry *e = data;
53 const char *name = e->name; // e->name == key 55 const char *name = e->name; // e->name == key
@@ -97,8 +99,8 @@ _phone_book_string_key_length(const char *key)
97} 99}
98 100
99static int 101static int
100_phone_book_string_key_cmp(const char *key1, int key1_length, 102_phone_book_string_key_cmp(const char *key1, int key1_length EINA_UNUSED,
101 const char *key2, int key2_length) 103 const char *key2, int key2_length EINA_UNUSED)
102{ 104{
103 return strcmp(key1, key2); 105 return strcmp(key1, key2);
104} 106}
@@ -138,6 +140,8 @@ example_hash_big(void)
138int 140int
139main(int argc, const char *argv[]) 141main(int argc, const char *argv[])
140{ 142{
143 (void)argc;
144 (void)argv;
141 eina_init(); 145 eina_init();
142 146
143 example_hash_stringshared(); 147 example_hash_stringshared();
diff --git a/src/examples/eina/eina_hash_03.c b/src/examples/eina/eina_hash_03.c
index b7323c4..5e88a20 100644
--- a/src/examples/eina/eina_hash_03.c
+++ b/src/examples/eina/eina_hash_03.c
@@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
38 38
39static Eina_Bool 39static Eina_Bool
40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, 40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
41 void *data, void *fdata) 41 void *data, void *fdata EINA_UNUSED)
42{ 42{
43 const char *name = key; 43 const char *name = key;
44 const char *number = data; 44 const char *number = data;
@@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
51int 51int
52main(int argc, const char *argv[]) 52main(int argc, const char *argv[])
53{ 53{
54 (void)argc;
55 (void)argv;
54 Eina_Hash *phone_book = NULL; 56 Eina_Hash *phone_book = NULL;
55 int i; 57 int i;
56 const char *entry_name = "Heitor Villa-Lobos"; 58 const char *entry_name = "Heitor Villa-Lobos";
diff --git a/src/examples/eina/eina_hash_04.c b/src/examples/eina/eina_hash_04.c
index 2441617..fd4624c 100644
--- a/src/examples/eina/eina_hash_04.c
+++ b/src/examples/eina/eina_hash_04.c
@@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
38 38
39static Eina_Bool 39static Eina_Bool
40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, 40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
41 void *data, void *fdata) 41 void *data, void *fdata EINA_UNUSED)
42{ 42{
43 const char *name = key; 43 const char *name = key;
44 const char *number = data; 44 const char *number = data;
@@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
51int 51int
52main(int argc, const char *argv[]) 52main(int argc, const char *argv[])
53{ 53{
54 (void)argc;
55 (void)argv;
54 Eina_Hash *phone_book = NULL; 56 Eina_Hash *phone_book = NULL;
55 int i; 57 int i;
56 const char *entry_name = "Heitor Villa-Lobos"; 58 const char *entry_name = "Heitor Villa-Lobos";
diff --git a/src/examples/eina/eina_hash_05.c b/src/examples/eina/eina_hash_05.c
index 5e5c32d..b5956cb 100644
--- a/src/examples/eina/eina_hash_05.c
+++ b/src/examples/eina/eina_hash_05.c
@@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
38 38
39static Eina_Bool 39static Eina_Bool
40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, 40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
41 void *data, void *fdata) 41 void *data, void *fdata EINA_UNUSED)
42{ 42{
43 const int32_t *id = key; 43 const int32_t *id = key;
44 const char *number = data; 44 const char *number = data;
@@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
51int 51int
52main(int argc, const char *argv[]) 52main(int argc, const char *argv[])
53{ 53{
54 (void)argc;
55 (void)argv;
54 Eina_Hash *phone_book = NULL; 56 Eina_Hash *phone_book = NULL;
55 int i; 57 int i;
56 int32_t entry_id = 4; 58 int32_t entry_id = 4;
diff --git a/src/examples/eina/eina_hash_06.c b/src/examples/eina/eina_hash_06.c
index 2df8a47..7e961de 100644
--- a/src/examples/eina/eina_hash_06.c
+++ b/src/examples/eina/eina_hash_06.c
@@ -38,11 +38,11 @@ _phone_entry_free_cb(void *data)
38 38
39static Eina_Bool 39static Eina_Bool
40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, 40_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
41 void *data, void *fdata) 41 void *data, void *fdata EINA_UNUSED)
42{ 42{
43 const int64_t *id = key; 43 const int64_t *id = key;
44 const char *number = data; 44 const char *number = data;
45 printf("%lld: %s\n", *id, number); 45 printf("%lld: %s\n", (long long int)*id, number);
46 46
47 // Return EINA_FALSE to stop this callback from being called 47 // Return EINA_FALSE to stop this callback from being called
48 return EINA_TRUE; 48 return EINA_TRUE;
@@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
51int 51int
52main(int argc, const char *argv[]) 52main(int argc, const char *argv[])
53{ 53{
54 (void)argc;
55 (void)argv;
54 Eina_Hash *phone_book = NULL; 56 Eina_Hash *phone_book = NULL;
55 int i; 57 int i;
56 int64_t entry_id = 4; 58 int64_t entry_id = 4;
@@ -75,7 +77,7 @@ main(int argc, const char *argv[])
75 if (phone) 77 if (phone)
76 { 78 {
77 printf("Printing entry.\n"); 79 printf("Printing entry.\n");
78 printf("Id: %lld\n", entry_id); 80 printf("Id: %lld\n", (long long int)entry_id);
79 printf("Number: %s\n\n", phone); 81 printf("Number: %s\n\n", phone);
80 } 82 }
81 83
@@ -136,7 +138,7 @@ main(int argc, const char *argv[])
136 Eina_Hash_Tuple *t = data; 138 Eina_Hash_Tuple *t = data;
137 const int64_t *id = t->key; 139 const int64_t *id = t->key;
138 const char *number = t->data; 140 const char *number = t->data;
139 printf("%lld: %s\n", *id, number); 141 printf("%lld: %s\n", (long long int)*id, number);
140 } 142 }
141 eina_iterator_free(it); // Always free the iterator after its use 143 eina_iterator_free(it); // Always free the iterator after its use
142 printf("\n"); 144 printf("\n");
@@ -147,7 +149,7 @@ main(int argc, const char *argv[])
147 while (eina_iterator_next(it, &data)) 149 while (eina_iterator_next(it, &data))
148 { 150 {
149 const int64_t *id = data; 151 const int64_t *id = data;
150 printf("%lld\n", *id); 152 printf("%lld\n", (long long int)*id);
151 } 153 }
152 eina_iterator_free(it); 154 eina_iterator_free(it);
153 printf("\n"); 155 printf("\n");
diff --git a/src/examples/eina/eina_list_01.c b/src/examples/eina/eina_list_01.c
index 4fcb020..c82a7f1 100644
--- a/src/examples/eina/eina_list_01.c
+++ b/src/examples/eina/eina_list_01.c
@@ -7,6 +7,8 @@
7int 7int
8main(int argc, char **argv) 8main(int argc, char **argv)
9{ 9{
10 (void)argc;
11 (void)argv;
10 Eina_List *list = NULL; 12 Eina_List *list = NULL;
11 Eina_List *l; 13 Eina_List *l;
12 void *list_data; 14 void *list_data;
diff --git a/src/examples/eina/eina_list_02.c b/src/examples/eina/eina_list_02.c
index 5fe31e8..f695a1a 100644
--- a/src/examples/eina/eina_list_02.c
+++ b/src/examples/eina/eina_list_02.c
@@ -8,6 +8,8 @@
8int 8int
9main(int argc, char **argv) 9main(int argc, char **argv)
10{ 10{
11 (void)argc;
12 (void)argv;
11 Eina_List *list = NULL, *other_list = NULL; 13 Eina_List *list = NULL, *other_list = NULL;
12 Eina_List *l; 14 Eina_List *l;
13 void *data; 15 void *data;
diff --git a/src/examples/eina/eina_list_03.c b/src/examples/eina/eina_list_03.c
index db53148..2097954 100644
--- a/src/examples/eina/eina_list_03.c
+++ b/src/examples/eina/eina_list_03.c
@@ -7,6 +7,8 @@
7int 7int
8main(int argc, char **argv) 8main(int argc, char **argv)
9{ 9{
10 (void)argc;
11 (void)argv;
10 Eina_List *list = NULL, *r_list; 12 Eina_List *list = NULL, *r_list;
11 Eina_List *l; 13 Eina_List *l;
12 Eina_Iterator *itr; 14 Eina_Iterator *itr;
diff --git a/src/examples/eina/eina_list_04.c b/src/examples/eina/eina_list_04.c
index d92a607..b78d8ae 100644
--- a/src/examples/eina/eina_list_04.c
+++ b/src/examples/eina/eina_list_04.c
@@ -7,6 +7,8 @@
7int 7int
8main(int argc, char **argv) 8main(int argc, char **argv)
9{ 9{
10 (void)argc;
11 (void)argv;
10 Eina_List *list = NULL; 12 Eina_List *list = NULL;
11 Eina_List *l; 13 Eina_List *l;
12 void *list_data; 14 void *list_data;
diff --git a/src/examples/eina/eina_strbuf_01.c b/src/examples/eina/eina_strbuf_01.c
index 4ee6472..eaccd38 100644
--- a/src/examples/eina/eina_strbuf_01.c
+++ b/src/examples/eina/eina_strbuf_01.c
@@ -25,7 +25,7 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
25 eina_strbuf_reset(buf); 25 eina_strbuf_reset(buf);
26 26
27 eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r'); 27 eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
28 eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf)); 28 eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", (int)eina_strbuf_length_get(buf));
29 printf("%s\n", eina_strbuf_string_get(buf)); 29 printf("%s\n", eina_strbuf_string_get(buf));
30 30
31 eina_strbuf_remove(buf, 0, 7); 31 eina_strbuf_remove(buf, 0, 7);
diff --git a/src/examples/eina/eina_value_01.c b/src/examples/eina/eina_value_01.c
index 8a20828..0916ce3 100644
--- a/src/examples/eina/eina_value_01.c
+++ b/src/examples/eina/eina_value_01.c
@@ -5,6 +5,8 @@
5 5
6int main(int argc, char **argv) 6int main(int argc, char **argv)
7{ 7{
8 (void)argc;
9 (void)argv;
8 Eina_Value v; 10 Eina_Value v;
9 int i; 11 int i;
10 char *newstr; 12 char *newstr;
diff --git a/src/examples/eina/eina_value_02.c b/src/examples/eina/eina_value_02.c
index 9c659ec..a8119bd 100644
--- a/src/examples/eina/eina_value_02.c
+++ b/src/examples/eina/eina_value_02.c
@@ -79,6 +79,8 @@ void my_struct_use(Eina_Value *params)
79 79
80int main(int argc, char **argv) 80int main(int argc, char **argv)
81{ 81{
82 (void)argc;
83 (void)argv;
82 Eina_Value *v1, *v2; 84 Eina_Value *v1, *v2;
83 85
84 eina_init(); 86 eina_init();
diff --git a/src/examples/eina/eina_value_03.c b/src/examples/eina/eina_value_03.c
index 0f1d15b..e5217b4 100644
--- a/src/examples/eina/eina_value_03.c
+++ b/src/examples/eina/eina_value_03.c
@@ -26,7 +26,7 @@ _tz_copy(const Eina_Value_Type *type EINA_UNUSED, const void *src, void * dst)
26 return EINA_TRUE; 26 return EINA_TRUE;
27} 27}
28 28
29static Eina_Bool 29static int
30_tz_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b) 30_tz_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b)
31{ 31{
32 struct timezone tza = *(struct timezone*)a; 32 struct timezone tza = *(struct timezone*)a;
diff --git a/src/examples/eina/eina_xattr_01.c b/src/examples/eina/eina_xattr_01.c
index e4bf421..5de066f 100644
--- a/src/examples/eina/eina_xattr_01.c
+++ b/src/examples/eina/eina_xattr_01.c
@@ -37,7 +37,7 @@ main(int argc, char **argv)
37 } 37 }
38 else if (strcmp(argv[1], "get") == 0) 38 else if (strcmp(argv[1], "get") == 0)
39 { 39 {
40 size_t size = 0; 40 ssize_t size = 0;
41 const char *value; 41 const char *value;
42 42
43 if (argc < 4) 43 if (argc < 4)
diff --git a/src/examples/eldbus/complex-types-client-eina-value.c b/src/examples/eldbus/complex-types-client-eina-value.c
index 3d290ae..1789321 100644
--- a/src/examples/eldbus/complex-types-client-eina-value.c
+++ b/src/examples/eldbus/complex-types-client-eina-value.c
@@ -63,7 +63,7 @@ _fill_receive_array_of_string_int_with_size(Eldbus_Message *msg, int size, const
63 63
64 offset = _type_offset(sizeof(int), sizeof(Eina_Value_Array)); 64 offset = _type_offset(sizeof(int), sizeof(Eina_Value_Array));
65 main_members[0].name = "size"; 65 main_members[0].name = "size";
66 main_members[0].type = EINA_VALUE_TYPE_INT, 0; 66 main_members[0].type = EINA_VALUE_TYPE_INT;
67 main_members[0].offset = 0; 67 main_members[0].offset = 0;
68 main_members[1].name = "array"; 68 main_members[1].name = "array";
69 main_members[1].type = EINA_VALUE_TYPE_ARRAY; 69 main_members[1].type = EINA_VALUE_TYPE_ARRAY;
diff --git a/src/examples/evas/evas-map-utils.c b/src/examples/evas/evas-map-utils.c
index db82023..644968c4 100644
--- a/src/examples/evas/evas-map-utils.c
+++ b/src/examples/evas/evas-map-utils.c
@@ -166,9 +166,6 @@ _on_keydown(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *e
166{ 166{
167 App_Data *ad = data; 167 App_Data *ad = data;
168 Evas_Event_Key_Down *ev = event; 168 Evas_Event_Key_Down *ev = event;
169 const Evas_Modifier *mods;
170
171 mods = evas_key_modifier_get(ad->canvas);
172 switch (ev->key[0]) 169 switch (ev->key[0])
173 { 170 {
174 case 'a': 171 case 'a':