forked from enlightenment/efl
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
e68225ae69
commit
72ee78b929
|
@ -1,8 +1,12 @@
|
||||||
//Compile with:
|
//Compile with:
|
||||||
// gcc -o ecore_idler_example ecore_idler_example.c `pkg-config --libs --cflags ecore eo`
|
// 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.h>
|
||||||
//#include <Ecore_Eo.h>
|
#include <Eo.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
struct context // helper struct to give some context to the callbacks
|
struct context // helper struct to give some context to the callbacks
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -16,17 +17,19 @@ main(void)
|
||||||
const char *key = "This is a crypto key";
|
const char *key = "This is a crypto key";
|
||||||
const char *key_bad = "This is another 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;
|
Eet_File *ef;
|
||||||
char *test;
|
char *test;
|
||||||
int size;
|
int size;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
if (!(file = tmpnam(file)))
|
if (-1 == (tmpfd = mkstemp(file)) || !!close(tmpfd))
|
||||||
{
|
{
|
||||||
fprintf(
|
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;
|
goto panic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ _phone_entry_free_cb(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
_phone_book_foreach_cb(const Eina_Hash *phone_book EINA_UNUSED, const void *key,
|
||||||
void *data, void *fdata)
|
void *data, void *fdata EINA_UNUSED)
|
||||||
{
|
{
|
||||||
const char *name = key;
|
const char *name = key;
|
||||||
const char *number = data;
|
const char *number = data;
|
||||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
Eina_Hash *phone_book = NULL;
|
Eina_Hash *phone_book = NULL;
|
||||||
int i;
|
int i;
|
||||||
const char *entry_name = "Heitor Villa-Lobos";
|
const char *entry_name = "Heitor Villa-Lobos";
|
||||||
|
|
|
@ -47,7 +47,9 @@ _phone_book_stringshared_free_cb(void *data)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book,
|
_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;
|
Phone_Entry *e = data;
|
||||||
const char *name = e->name; // e->name == key
|
const char *name = e->name; // e->name == key
|
||||||
|
@ -97,8 +99,8 @@ _phone_book_string_key_length(const char *key)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_phone_book_string_key_cmp(const char *key1, int key1_length,
|
_phone_book_string_key_cmp(const char *key1, int key1_length EINA_UNUSED,
|
||||||
const char *key2, int key2_length)
|
const char *key2, int key2_length EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return strcmp(key1, key2);
|
return strcmp(key1, key2);
|
||||||
}
|
}
|
||||||
|
@ -138,6 +140,8 @@ example_hash_big(void)
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
eina_init();
|
eina_init();
|
||||||
|
|
||||||
example_hash_stringshared();
|
example_hash_stringshared();
|
||||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
_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 *name = key;
|
||||||
const char *number = data;
|
const char *number = data;
|
||||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Hash *phone_book = NULL;
|
Eina_Hash *phone_book = NULL;
|
||||||
int i;
|
int i;
|
||||||
const char *entry_name = "Heitor Villa-Lobos";
|
const char *entry_name = "Heitor Villa-Lobos";
|
||||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
_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 *name = key;
|
||||||
const char *number = data;
|
const char *number = data;
|
||||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Hash *phone_book = NULL;
|
Eina_Hash *phone_book = NULL;
|
||||||
int i;
|
int i;
|
||||||
const char *entry_name = "Heitor Villa-Lobos";
|
const char *entry_name = "Heitor Villa-Lobos";
|
||||||
|
|
|
@ -38,7 +38,7 @@ _phone_entry_free_cb(void *data)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
_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 int32_t *id = key;
|
||||||
const char *number = data;
|
const char *number = data;
|
||||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Hash *phone_book = NULL;
|
Eina_Hash *phone_book = NULL;
|
||||||
int i;
|
int i;
|
||||||
int32_t entry_id = 4;
|
int32_t entry_id = 4;
|
||||||
|
|
|
@ -38,11 +38,11 @@ _phone_entry_free_cb(void *data)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
_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 int64_t *id = key;
|
||||||
const char *number = data;
|
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_FALSE to stop this callback from being called
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -51,6 +51,8 @@ _phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
|
||||||
int
|
int
|
||||||
main(int argc, const char *argv[])
|
main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Hash *phone_book = NULL;
|
Eina_Hash *phone_book = NULL;
|
||||||
int i;
|
int i;
|
||||||
int64_t entry_id = 4;
|
int64_t entry_id = 4;
|
||||||
|
@ -75,7 +77,7 @@ main(int argc, const char *argv[])
|
||||||
if (phone)
|
if (phone)
|
||||||
{
|
{
|
||||||
printf("Printing entry.\n");
|
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);
|
printf("Number: %s\n\n", phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +138,7 @@ main(int argc, const char *argv[])
|
||||||
Eina_Hash_Tuple *t = data;
|
Eina_Hash_Tuple *t = data;
|
||||||
const int64_t *id = t->key;
|
const int64_t *id = t->key;
|
||||||
const char *number = t->data;
|
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
|
eina_iterator_free(it); // Always free the iterator after its use
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -147,7 +149,7 @@ main(int argc, const char *argv[])
|
||||||
while (eina_iterator_next(it, &data))
|
while (eina_iterator_next(it, &data))
|
||||||
{
|
{
|
||||||
const int64_t *id = data;
|
const int64_t *id = data;
|
||||||
printf("%lld\n", *id);
|
printf("%lld\n", (long long int)*id);
|
||||||
}
|
}
|
||||||
eina_iterator_free(it);
|
eina_iterator_free(it);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_List *list = NULL;
|
Eina_List *list = NULL;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
void *list_data;
|
void *list_data;
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_List *list = NULL, *other_list = NULL;
|
Eina_List *list = NULL, *other_list = NULL;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_List *list = NULL, *r_list;
|
Eina_List *list = NULL, *r_list;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Eina_Iterator *itr;
|
Eina_Iterator *itr;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_List *list = NULL;
|
Eina_List *list = NULL;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
void *list_data;
|
void *list_data;
|
||||||
|
|
|
@ -25,7 +25,7 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
eina_strbuf_reset(buf);
|
eina_strbuf_reset(buf);
|
||||||
|
|
||||||
eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
|
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));
|
printf("%s\n", eina_strbuf_string_get(buf));
|
||||||
|
|
||||||
eina_strbuf_remove(buf, 0, 7);
|
eina_strbuf_remove(buf, 0, 7);
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Value v;
|
Eina_Value v;
|
||||||
int i;
|
int i;
|
||||||
char *newstr;
|
char *newstr;
|
||||||
|
|
|
@ -79,6 +79,8 @@ void my_struct_use(Eina_Value *params)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
Eina_Value *v1, *v2;
|
Eina_Value *v1, *v2;
|
||||||
|
|
||||||
eina_init();
|
eina_init();
|
||||||
|
|
|
@ -26,7 +26,7 @@ _tz_copy(const Eina_Value_Type *type EINA_UNUSED, const void *src, void * dst)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static int
|
||||||
_tz_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b)
|
_tz_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b)
|
||||||
{
|
{
|
||||||
struct timezone tza = *(struct timezone*)a;
|
struct timezone tza = *(struct timezone*)a;
|
||||||
|
|
|
@ -37,7 +37,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "get") == 0)
|
else if (strcmp(argv[1], "get") == 0)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
ssize_t size = 0;
|
||||||
const char *value;
|
const char *value;
|
||||||
|
|
||||||
if (argc < 4)
|
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));
|
offset = _type_offset(sizeof(int), sizeof(Eina_Value_Array));
|
||||||
main_members[0].name = "size";
|
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[0].offset = 0;
|
||||||
main_members[1].name = "array";
|
main_members[1].name = "array";
|
||||||
main_members[1].type = EINA_VALUE_TYPE_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;
|
App_Data *ad = data;
|
||||||
Evas_Event_Key_Down *ev = event;
|
Evas_Event_Key_Down *ev = event;
|
||||||
const Evas_Modifier *mods;
|
|
||||||
|
|
||||||
mods = evas_key_modifier_get(ad->canvas);
|
|
||||||
switch (ev->key[0])
|
switch (ev->key[0])
|
||||||
{
|
{
|
||||||
case 'a':
|
case 'a':
|
||||||
|
|
|
@ -128,6 +128,7 @@ static void set_brks_to(
|
||||||
while (posNext < posEnd)
|
while (posNext < posEnd)
|
||||||
{
|
{
|
||||||
utf32_t ch;
|
utf32_t ch;
|
||||||
|
(void)ch;
|
||||||
ch = get_next_char(s, len, &posNext);
|
ch = get_next_char(s, len, &posNext);
|
||||||
assert(ch != EOS);
|
assert(ch != EOS);
|
||||||
for (; posStart < posNext - 1; ++posStart)
|
for (; posStart < posNext - 1; ++posStart)
|
||||||
|
|
|
@ -415,7 +415,7 @@ _eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream)
|
||||||
eet_eina_stream_data_descriptor_class_set(&eddc,
|
eet_eina_stream_data_descriptor_class_set(&eddc,
|
||||||
sizeof (Eet_Data_Descriptor_Class),
|
sizeof (Eet_Data_Descriptor_Class),
|
||||||
"Eet_Test_Basic_Type",
|
"Eet_Test_Basic_Type",
|
||||||
sizeof(Eet_Test_Basic_Type));
|
sizeof(Eet_Test_Basic_Type));
|
||||||
eddb = eet_data_descriptor_stream_new(&eddc);
|
eddb = eet_data_descriptor_stream_new(&eddc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -423,7 +423,7 @@ _eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream)
|
||||||
eet_eina_file_data_descriptor_class_set(&eddc,
|
eet_eina_file_data_descriptor_class_set(&eddc,
|
||||||
sizeof (Eet_Data_Descriptor_Class),
|
sizeof (Eet_Data_Descriptor_Class),
|
||||||
"Eet_Test_Basic_Type",
|
"Eet_Test_Basic_Type",
|
||||||
sizeof(Eet_Test_Basic_Type));
|
sizeof(Eet_Test_Basic_Type));
|
||||||
eddb = eet_data_descriptor_file_new(&eddc);
|
eddb = eet_data_descriptor_file_new(&eddc);
|
||||||
}
|
}
|
||||||
fail_if(!eddb);
|
fail_if(!eddb);
|
||||||
|
@ -968,10 +968,12 @@ START_TEST(eet_file_simple_write)
|
||||||
char *test;
|
char *test;
|
||||||
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
||||||
int size;
|
int size;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
fail_if(eet_mode_get(NULL) != EET_FILE_MODE_INVALID);
|
fail_if(eet_mode_get(NULL) != EET_FILE_MODE_INVALID);
|
||||||
|
|
||||||
|
@ -1040,6 +1042,7 @@ START_TEST(eet_file_data_test)
|
||||||
Eet_Test_Ex_Type etbt;
|
Eet_Test_Ex_Type etbt;
|
||||||
int size;
|
int size;
|
||||||
int test;
|
int test;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
|
@ -1071,7 +1074,8 @@ START_TEST(eet_file_data_test)
|
||||||
|
|
||||||
_eet_build_ex_descriptor(edd, EINA_FALSE);
|
_eet_build_ex_descriptor(edd, EINA_FALSE);
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
/* Insert an error in etbt. */
|
/* Insert an error in etbt. */
|
||||||
etbt.i = 0;
|
etbt.i = 0;
|
||||||
|
@ -1194,6 +1198,7 @@ START_TEST(eet_file_data_dump_test)
|
||||||
char *string1;
|
char *string1;
|
||||||
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
||||||
int test;
|
int test;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
|
@ -1223,7 +1228,8 @@ START_TEST(eet_file_data_dump_test)
|
||||||
|
|
||||||
_eet_build_ex_descriptor(edd, EINA_FALSE);
|
_eet_build_ex_descriptor(edd, EINA_FALSE);
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
/* Save the encoded data in a file. */
|
/* Save the encoded data in a file. */
|
||||||
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
||||||
|
@ -1294,10 +1300,12 @@ START_TEST(eet_image)
|
||||||
int alpha;
|
int alpha;
|
||||||
unsigned int w;
|
unsigned int w;
|
||||||
unsigned int h;
|
unsigned int h;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
/* Save the encoded data in a file. */
|
/* Save the encoded data in a file. */
|
||||||
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
||||||
|
@ -1660,6 +1668,7 @@ START_TEST(eet_small_image)
|
||||||
int quality;
|
int quality;
|
||||||
Eet_Image_Encoding lossy;
|
Eet_Image_Encoding lossy;
|
||||||
int result;
|
int result;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
image[0] = IM0;
|
image[0] = IM0;
|
||||||
image[1] = IM1;
|
image[1] = IM1;
|
||||||
|
@ -1668,7 +1677,8 @@ START_TEST(eet_small_image)
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
||||||
fail_if(!ef);
|
fail_if(!ef);
|
||||||
|
@ -1720,7 +1730,8 @@ START_TEST(eet_identity_simple)
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (fd = mkstemp(file)));
|
||||||
|
fail_if(!!close(fd));
|
||||||
fail_if(!(noread = fopen("/dev/null", "w")));
|
fail_if(!(noread = fopen("/dev/null", "w")));
|
||||||
|
|
||||||
/* Sign an eet file. */
|
/* Sign an eet file. */
|
||||||
|
@ -1880,10 +1891,12 @@ START_TEST(eet_cipher_decipher_simple)
|
||||||
char *test;
|
char *test;
|
||||||
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
char *file = strdup("/tmp/eet_suite_testXXXXXX");
|
||||||
int size;
|
int size;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
/* Crypt an eet file. */
|
/* Crypt an eet file. */
|
||||||
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
||||||
|
@ -1966,6 +1979,7 @@ START_TEST(eet_cache_concurrency)
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
Eina_Thread thread;
|
Eina_Thread thread;
|
||||||
Eina_Bool r;
|
Eina_Bool r;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
eina_threads_init();
|
eina_threads_init();
|
||||||
|
@ -1974,7 +1988,8 @@ START_TEST(eet_cache_concurrency)
|
||||||
eina_condition_new(&open_worker_cond, &open_worker_mutex);
|
eina_condition_new(&open_worker_cond, &open_worker_mutex);
|
||||||
|
|
||||||
/* create a file to test with */
|
/* create a file to test with */
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_WRITE);
|
||||||
fail_if(!ef);
|
fail_if(!ef);
|
||||||
fail_if(!eet_write(ef, "keys/tests", buffer, strlen(buffer) + 1, 0));
|
fail_if(!eet_write(ef, "keys/tests", buffer, strlen(buffer) + 1, 0));
|
||||||
|
@ -2235,6 +2250,7 @@ START_TEST(eet_file_fp)
|
||||||
Eet_5FP origin;
|
Eet_5FP origin;
|
||||||
Eet_5DBL *convert;
|
Eet_5DBL *convert;
|
||||||
Eet_5FP *build;
|
Eet_5FP *build;
|
||||||
|
int tmpfd;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
|
|
||||||
|
@ -2262,7 +2278,8 @@ START_TEST(eet_file_fp)
|
||||||
origin.f1 = eina_f32p32_int_from(1);
|
origin.f1 = eina_f32p32_int_from(1);
|
||||||
origin.f0 = 0;
|
origin.f0 = 0;
|
||||||
|
|
||||||
fail_if(!(file = tmpnam(file)));
|
fail_if(-1 == (tmpfd = mkstemp(file)));
|
||||||
|
fail_if(!!close(tmpfd));
|
||||||
|
|
||||||
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
||||||
fail_if(!ef);
|
fail_if(!ef);
|
||||||
|
@ -2871,4 +2888,3 @@ main(int argc EINA_UNUSED, char *argv[])
|
||||||
|
|
||||||
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
} /* main */
|
} /* main */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue