* copy inlined needed functions in evas_array.c, hence remove dependancy

of evas_common.h
 * use size_t when needed
 * add vim header


SVN revision: 35153
This commit is contained in:
doursse 2008-07-18 09:38:03 +00:00 committed by doursse
parent 94a1de12d6
commit 31f339cdc1
8 changed files with 104 additions and 13 deletions

View File

@ -1,11 +1,46 @@
#include "evas_common.h"
#include "evas_private.h"
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
Evas_Bool
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "Evas_Data.h"
#ifdef __GNUC__
# define UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
# define UNLIKELY(x) (x)
#endif
static Evas_Bool _evas_array_grow(Evas_Array *array);
static inline void
_evas_array_append(Evas_Array *array, void *data)
{
if (UNLIKELY((array->count + array->step) > array->total))
if (!_evas_array_grow(array)) return ;
array->data[array->count++] = data;
}
static inline void*
_evas_array_get(Evas_Array *array, unsigned int index)
{
return array->data[index];
}
static Evas_Bool
_evas_array_grow(Evas_Array *array)
{
void **tmp;
unsigned int total;
size_t total;
total = array->total + array->step;
tmp = realloc(array->data, sizeof (void*) * total);

View File

@ -1,4 +1,12 @@
#include "evas_common.h"
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "Evas_Data.h"
#define EAH_BUCKETS 256
#define EAH_HASH(key) \

View File

@ -1,5 +1,15 @@
#include "evas_common.h"
#include "evas_private.h"
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "Evas_Data.h"
typedef struct _Evas_Hash_El Evas_Hash_El;

View File

@ -1,8 +1,15 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "evas_common.h"
#include "evas_mempool.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "Evas_Data.h"
#include <evas_mempool.h>
typedef struct _Evas_List_Accounting Evas_List_Accounting;

View File

@ -2,9 +2,14 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "Evas_Data.h"
#include "evas_mempool.h"
//#define NOPOOL

View File

@ -1,3 +1,7 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef _EVAS_MEMPOOL_H
#define _EVAS_MEMPOOL_H

View File

@ -1,4 +1,14 @@
#include "evas_common.h"
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "Evas_Data.h"
/* list ops */
void *

View File

@ -1,5 +1,17 @@
#include "evas_common.h"
#include "evas_private.h"
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "Evas_Data.h"
typedef struct _Evas_Stringshare Evas_Stringshare;
typedef struct _Evas_Stringshare_El Evas_Stringshare_El;
@ -16,7 +28,7 @@ struct _Evas_Stringshare_El
int references;
};
static Evas_Stringshare share =
static Evas_Stringshare share =
{
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,