beware "class"! those c++ compiler can compile c... but they like to think

class is special... ESPECIALLY IN HEADERS used by c++ apps.



SVN revision: 41738
This commit is contained in:
Carsten Haitzler 2009-08-13 14:47:10 +00:00
parent 05edf17dd4
commit c1acd83e1e
2 changed files with 25 additions and 25 deletions

View File

@ -1049,7 +1049,7 @@ extern "C" {
* *
* @since 1.3.0 * @since 1.3.0
*/ */
EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *class, const char *name, int size); EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, const char *name, int size);
/** /**
* This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class * This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class
@ -1061,7 +1061,7 @@ extern "C" {
* *
* @since 1.3.0 * @since 1.3.0
*/ */
#define EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(Class, Type) eet_eina_stream_data_descriptor_class_set(Class, #Type , sizeof (Type)); #define EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(Clas, Type) eet_eina_stream_data_descriptor_class_set(Clas, #Type , sizeof (Type));
/** /**
* This function is an helper that set all the parameter of an Eet_Data_Descriptor_Class * This function is an helper that set all the parameter of an Eet_Data_Descriptor_Class
@ -1074,7 +1074,7 @@ extern "C" {
* *
* @since 1.3.0 * @since 1.3.0
*/ */
EAPI Eina_Bool eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *class, const char *name, int size); EAPI Eina_Bool eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, const char *name, int size);
/** /**
* This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class * This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class
@ -1086,7 +1086,7 @@ extern "C" {
* *
* @since 1.3.0 * @since 1.3.0
*/ */
#define EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(Class, Type) eet_eina_file_data_descriptor_class_set(Class, #Type , sizeof (Type)); #define EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(Clas, Type) eet_eina_file_data_descriptor_class_set(Clas, #Type , sizeof (Type));
/** /**
* This function frees a data descriptor when it is not needed anymore. * This function frees a data descriptor when it is not needed anymore.

View File

@ -1034,39 +1034,39 @@ _eet_str_direct_free(const char *str)
/*---*/ /*---*/
EAPI Eina_Bool EAPI Eina_Bool
eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *class, const char *name, int size) eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, const char *name, int size)
{ {
if (!class || !name) return EINA_FALSE; if (!eddc || !name) return EINA_FALSE;
class->name = name; eddc->name = name;
class->size = size; eddc->size = size;
class->version = 1; eddc->version = 1;
class->func.mem_alloc = _eet_mem_alloc; eddc->func.mem_alloc = _eet_mem_alloc;
class->func.mem_free = _eet_mem_free; eddc->func.mem_free = _eet_mem_free;
class->func.str_alloc = (char *(*)(const char *))eina_stringshare_add; eddc->func.str_alloc = (char *(*)(const char *))eina_stringshare_add;
class->func.str_free = eina_stringshare_del; eddc->func.str_free = eina_stringshare_del;
class->func.list_next = (void *(*)(void *))eina_list_next; eddc->func.list_next = (void *(*)(void *))eina_list_next;
class->func.list_append = (void *(*)(void *, void *))eina_list_append; eddc->func.list_append = (void *(*)(void *, void *))eina_list_append;
class->func.list_data = (void *(*)(void *))eina_list_data_get; eddc->func.list_data = (void *(*)(void *))eina_list_data_get;
class->func.list_free = (void *(*)(void *))eina_list_free; eddc->func.list_free = (void *(*)(void *))eina_list_free;
class->func.hash_foreach = (void (*)(void *, int (*)(void *, const char *, void *, void *), void *))eina_hash_foreach; eddc->func.hash_foreach = (void (*)(void *, int (*)(void *, const char *, void *, void *), void *))eina_hash_foreach;
class->func.hash_add = (void* (*)(void *, const char *, void *)) _eet_eina_hash_add_alloc; eddc->func.hash_add = (void* (*)(void *, const char *, void *)) _eet_eina_hash_add_alloc;
class->func.hash_free = (void (*)(void *))eina_hash_free; eddc->func.hash_free = (void (*)(void *))eina_hash_free;
return EINA_TRUE; return EINA_TRUE;
} }
EAPI Eina_Bool EAPI Eina_Bool
eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *class, const char *name, int size) eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, const char *name, int size)
{ {
if (!eet_eina_stream_data_descriptor_class_set(class, name, size)) if (!eet_eina_stream_data_descriptor_class_set(eddc, name, size))
return EINA_FALSE; return EINA_FALSE;
class->version = 2; eddc->version = 2;
class->func.str_direct_alloc = _eet_str_direct_alloc; eddc->func.str_direct_alloc = _eet_str_direct_alloc;
class->func.str_direct_free = _eet_str_direct_free; eddc->func.str_direct_free = _eet_str_direct_free;
return EINA_TRUE; return EINA_TRUE;
} }