diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-23 06:00:53 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-23 06:00:53 +0000 |
commit | 09702bb3f95e4d892c6592b48907c712717a8341 (patch) | |
tree | 9e87c5dcc5e2b5706f276d71fed73c040f3ade29 | |
parent | df31d32b411022d130b078de177cfa40b7bf6cde (diff) |
Remove redundancy and move hidden prototypes around
-rw-r--r-- | libc/misc/search/hsearch_r.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/misc/search/hsearch_r.c b/libc/misc/search/hsearch_r.c index 7933f2d6f..a1cdbb681 100644 --- a/libc/misc/search/hsearch_r.c +++ b/libc/misc/search/hsearch_r.c @@ -23,9 +23,6 @@ #include <search.h> -libc_hidden_proto(hcreate_r) -libc_hidden_proto(hdestroy_r) -libc_hidden_proto(hsearch_r) /* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986 [Knuth] The Art of Computer Programming, part 3 (6.4) */ @@ -67,6 +64,7 @@ static int isprime (unsigned int number) indexing as explained in the comment for the hsearch function. The contents of the table is zeroed, especially the field used becomes zero. */ +libc_hidden_proto(hcreate_r) int hcreate_r (size_t nel, struct hsearch_data *htab) { /* Test for correct arguments. */ @@ -102,6 +100,7 @@ libc_hidden_def(hcreate_r) #ifdef L_hdestroy_r /* After using the hash table it has to be destroyed. The used memory can be freed and the local static variable can be marked as not used. */ +libc_hidden_proto(hdestroy_r) void hdestroy_r (struct hsearch_data *htab) { /* Test for correct arguments. */ @@ -139,6 +138,7 @@ libc_hidden_def(hdestroy_r) libc_hidden_proto(strcmp) libc_hidden_proto(strlen) +libc_hidden_proto(hsearch_r) int hsearch_r (ENTRY item, ACTION action, ENTRY **retval, struct hsearch_data *htab) { @@ -208,7 +208,7 @@ int hsearch_r (ENTRY item, ACTION action, ENTRY **retval, { /* If table is full and another entry should be entered return with error. */ - if (action == ENTER && htab->filled == htab->size) + if (htab->filled == htab->size) { __set_errno (ENOMEM); *retval = NULL; |