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>
This commit is contained in:
parent
cf1fd2efb6
commit
5e471fd9e4
|
@ -1,8 +1,12 @@
|
|||
//Compile with:
|
||||
// gcc -o ecore_idler_example ecore_idler_example.c `pkg-config --libs --cflags ecore eo`
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <Ecore.h>
|
||||
//#include <Ecore_Eo.h>
|
||||
#include <Eo.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct context // helper struct to give some context to the callbacks
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
|
@ -16,17 +17,19 @@ main(void)
|
|||
const char *key = "This is a crypto key";
|
||||
const char *key_bad = "This is another crypto key";
|
||||
|
||||
char *file = strdup("/tmp/eet_cipher_example_XXXXX");
|
||||
char *file = strdup("/tmp/eet_cipher_example_XXXXXX");
|
||||
Eet_File *ef;
|
||||
char *test;
|
||||
int size;
|
||||
int tmpfd;
|
||||
|
||||
eet_init();
|
||||
|
||||
if (!(file = tmpnam(file)))
|
||||
if (-1 == (tmpfd = mkstemp(file)) || !!close(tmpfd))
|
||||
{
|
||||
fprintf(
|
||||
stderr, "ERROR: could not create temporary file (%s).\n", file);
|
||||
stderr, "ERROR: could not create temporary file (%s) : %s\n",
|
||||
file, strerror(errno));
|
||||
goto panic;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ _phone_entry_free_cb(void *data)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||
void *data, void *fdata)
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book EINA_UNUSED, const void *key,
|
||||
void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
const char *name = key;
|
||||
const char *number = data;
|
||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
Eina_Hash *phone_book = NULL;
|
||||
int i;
|
||||
const char *entry_name = "Heitor Villa-Lobos";
|
||||
|
|
|
@ -47,7 +47,9 @@ _phone_book_stringshared_free_cb(void *data)
|
|||
|
||||
static Eina_Bool
|
||||
_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book,
|
||||
const void *key, void *data, void *fdata)
|
||||
const void *key EINA_UNUSED,
|
||||
void *data,
|
||||
void *fdata EINA_UNUSED)
|
||||
{
|
||||
Phone_Entry *e = data;
|
||||
const char *name = e->name; // e->name == key
|
||||
|
@ -97,8 +99,8 @@ _phone_book_string_key_length(const char *key)
|
|||
}
|
||||
|
||||
static int
|
||||
_phone_book_string_key_cmp(const char *key1, int key1_length,
|
||||
const char *key2, int key2_length)
|
||||
_phone_book_string_key_cmp(const char *key1, int key1_length EINA_UNUSED,
|
||||
const char *key2, int key2_length EINA_UNUSED)
|
||||
{
|
||||
return strcmp(key1, key2);
|
||||
}
|
||||
|
@ -138,6 +140,8 @@ example_hash_big(void)
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
eina_init();
|
||||
|
||||
example_hash_stringshared();
|
||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
|||
|
||||
static Eina_Bool
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||
void *data, void *fdata)
|
||||
void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
const char *name = key;
|
||||
const char *number = data;
|
||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Hash *phone_book = NULL;
|
||||
int i;
|
||||
const char *entry_name = "Heitor Villa-Lobos";
|
||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
|||
|
||||
static Eina_Bool
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||
void *data, void *fdata)
|
||||
void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
const char *name = key;
|
||||
const char *number = data;
|
||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Hash *phone_book = NULL;
|
||||
int i;
|
||||
const char *entry_name = "Heitor Villa-Lobos";
|
||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
|||
|
||||
static Eina_Bool
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||
void *data, void *fdata)
|
||||
void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
const int32_t *id = key;
|
||||
const char *number = data;
|
||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Hash *phone_book = NULL;
|
||||
int i;
|
||||
int32_t entry_id = 4;
|
||||
|
|
|
@ -38,11 +38,11 @@ _phone_entry_free_cb(void *data)
|
|||
|
||||
static Eina_Bool
|
||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||
void *data, void *fdata)
|
||||
void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
const int64_t *id = key;
|
||||
const char *number = data;
|
||||
printf("%lld: %s\n", *id, number);
|
||||
printf("%lld: %s\n", (long long int)*id, number);
|
||||
|
||||
// Return EINA_FALSE to stop this callback from being called
|
||||
return EINA_TRUE;
|
||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
|||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Hash *phone_book = NULL;
|
||||
int i;
|
||||
int64_t entry_id = 4;
|
||||
|
@ -75,7 +77,7 @@ main(int argc, const char *argv[])
|
|||
if (phone)
|
||||
{
|
||||
printf("Printing entry.\n");
|
||||
printf("Id: %lld\n", entry_id);
|
||||
printf("Id: %lld\n", (long long int)entry_id);
|
||||
printf("Number: %s\n\n", phone);
|
||||
}
|
||||
|
||||
|
@ -136,7 +138,7 @@ main(int argc, const char *argv[])
|
|||
Eina_Hash_Tuple *t = data;
|
||||
const int64_t *id = t->key;
|
||||
const char *number = t->data;
|
||||
printf("%lld: %s\n", *id, number);
|
||||
printf("%lld: %s\n", (long long int)*id, number);
|
||||
}
|
||||
eina_iterator_free(it); // Always free the iterator after its use
|
||||
printf("\n");
|
||||
|
@ -147,7 +149,7 @@ main(int argc, const char *argv[])
|
|||
while (eina_iterator_next(it, &data))
|
||||
{
|
||||
const int64_t *id = data;
|
||||
printf("%lld\n", *id);
|
||||
printf("%lld\n", (long long int)*id);
|
||||
}
|
||||
eina_iterator_free(it);
|
||||
printf("\n");
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_List *list = NULL;
|
||||
Eina_List *l;
|
||||
void *list_data;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_List *list = NULL, *other_list = NULL;
|
||||
Eina_List *l;
|
||||
void *data;
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_List *list = NULL, *r_list;
|
||||
Eina_List *l;
|
||||
Eina_Iterator *itr;
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_List *list = NULL;
|
||||
Eina_List *l;
|
||||
void *list_data;
|
||||
|
|
|
@ -25,7 +25,7 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
|||
eina_strbuf_reset(buf);
|
||||
|
||||
eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
|
||||
eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
|
||||
eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", (int)eina_strbuf_length_get(buf));
|
||||
printf("%s\n", eina_strbuf_string_get(buf));
|
||||
|
||||
eina_strbuf_remove(buf, 0, 7);
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Value v;
|
||||
int i;
|
||||
char *newstr;
|
||||
|
|
|
@ -79,6 +79,8 @@ void my_struct_use(Eina_Value *params)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
Eina_Value *v1, *v2;
|
||||
|
||||
eina_init();
|
||||
|
|
|
@ -26,7 +26,7 @@ _tz_copy(const Eina_Value_Type *type EINA_UNUSED, const void *src, void * dst)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
static int
|
||||
_tz_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b)
|
||||
{
|
||||
struct timezone tza = *(struct timezone*)a;
|
||||
|
|
|
@ -37,7 +37,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
else if (strcmp(argv[1], "get") == 0)
|
||||
{
|
||||
size_t size = 0;
|
||||
ssize_t size = 0;
|
||||
const char *value;
|
||||
|
||||
if (argc < 4)
|
||||
|
|
|
@ -63,7 +63,7 @@ _fill_receive_array_of_string_int_with_size(Eldbus_Message *msg, int size, const
|
|||
|
||||
offset = _type_offset(sizeof(int), sizeof(Eina_Value_Array));
|
||||
main_members[0].name = "size";
|
||||
main_members[0].type = EINA_VALUE_TYPE_INT, 0;
|
||||
main_members[0].type = EINA_VALUE_TYPE_INT;
|
||||
main_members[0].offset = 0;
|
||||
main_members[1].name = "array";
|
||||
main_members[1].type = EINA_VALUE_TYPE_ARRAY;
|
||||
|
|
|
@ -166,9 +166,6 @@ _on_keydown(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *e
|
|||
{
|
||||
App_Data *ad = data;
|
||||
Evas_Event_Key_Down *ev = event;
|
||||
const Evas_Modifier *mods;
|
||||
|
||||
mods = evas_key_modifier_get(ad->canvas);
|
||||
switch (ev->key[0])
|
||||
{
|
||||
case 'a':
|
||||
|
|
Loading…
Reference in New Issue