mirror of
https://xff.cz/git/u-boot/
synced 2025-09-20 18:12:11 +02:00
env: Drop _ENTRY
This typedef does not need to be defined in the search.h header since it is only used in one file (hashtable.c). Remove it from the header and change it to a struct. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -34,9 +34,6 @@ struct env_entry {
|
|||||||
int flags;
|
int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Opaque type for internal use. */
|
|
||||||
struct _ENTRY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Family of hash table handling functions. The functions also
|
* Family of hash table handling functions. The functions also
|
||||||
* have reentrant counterparts ending with _r. The non-reentrant
|
* have reentrant counterparts ending with _r. The non-reentrant
|
||||||
@@ -45,7 +42,7 @@ struct _ENTRY;
|
|||||||
|
|
||||||
/* Data type for reentrant functions. */
|
/* Data type for reentrant functions. */
|
||||||
struct hsearch_data {
|
struct hsearch_data {
|
||||||
struct _ENTRY *table;
|
struct env_entry_node *table;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int filled;
|
unsigned int filled;
|
||||||
/*
|
/*
|
||||||
|
@@ -59,10 +59,10 @@
|
|||||||
* which describes the current status.
|
* which describes the current status.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _ENTRY {
|
struct env_entry_node {
|
||||||
int used;
|
int used;
|
||||||
struct env_entry entry;
|
struct env_entry entry;
|
||||||
} _ENTRY;
|
};
|
||||||
|
|
||||||
|
|
||||||
static void _hdelete(const char *key, struct hsearch_data *htab,
|
static void _hdelete(const char *key, struct hsearch_data *htab,
|
||||||
@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab)
|
|||||||
htab->filled = 0;
|
htab->filled = 0;
|
||||||
|
|
||||||
/* allocate memory and zero out */
|
/* allocate memory and zero out */
|
||||||
htab->table = (_ENTRY *) calloc(htab->size + 1, sizeof(_ENTRY));
|
htab->table = (struct env_entry_node *)calloc(htab->size + 1,
|
||||||
|
sizeof(struct env_entry_node));
|
||||||
if (htab->table == NULL)
|
if (htab->table == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user