Skip to content

Commit

Permalink
t* remove the dependence to cdefs.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoire committed Dec 6, 2010
1 parent b983946 commit 8b02394
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions compat/tdelete.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# include <config.h>
#endif

#include <sys/cdefs.h>
#include <assert.h>
#include <stdlib.h>

Expand All @@ -26,7 +25,7 @@ void *
tdelete(vkey, vrootp, compar)
const void *vkey; /* key to be deleted */
void **vrootp; /* address of the root of tree */
int (*compar) __P((const void *, const void *));
int (*compar) (const void *, const void *);
{
node_t **rootp = (node_t **)vrootp;
node_t *p, *q, *r;
Expand Down
1 change: 0 additions & 1 deletion compat/tdestroy.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// Do not implement tdestroy if that's the only missing t* function
#ifndef HAVE_SEARCH_H

#include <sys/cdefs.h>
#include <assert.h>
#include <stdlib.h>

Expand Down
3 changes: 1 addition & 2 deletions compat/tfind.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# include <config.h>
#endif

#include <sys/cdefs.h>
#include <assert.h>
#include <stdlib.h>

Expand All @@ -26,7 +25,7 @@ void *
tfind(vkey, vrootp, compar)
const void *vkey; /* key to be found */
const void **vrootp; /* address of the tree root */
int (*compar) __P((const void *, const void *));
int (*compar) (const void *, const void *);
{
node_t * const *rootp = (node_t * const*)vrootp;

Expand Down
3 changes: 1 addition & 2 deletions compat/tsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# include <config.h>
#endif

#include <sys/cdefs.h>
#include <assert.h>
#include <stdlib.h>

Expand All @@ -26,7 +25,7 @@ void *
tsearch(vkey, vrootp, compar)
const void *vkey; /* key to be located */
void **vrootp; /* address of tree root */
int (*compar) __P((const void *, const void *));
int (*compar) (const void *, const void *);
{
node_t *q;
node_t **rootp = (node_t **)vrootp;
Expand Down
9 changes: 4 additions & 5 deletions compat/twalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
# include <config.h>
#endif

#include <sys/cdefs.h>
#include <assert.h>
#include <stdlib.h>

static void trecurse __P((const node_t *,
void (*action)(const void *, VISIT, int), int level));
static void trecurse (const node_t *,
void (*action)(const void *, VISIT, int), int level);

/* Walk the nodes of a tree */
static void
trecurse(root, action, level)
const node_t *root; /* Root of the tree to be walked */
void (*action) __P((const void *, VISIT, int));
void (*action) (const void *, VISIT, int);
int level;
{
assert(root != NULL);
Expand All @@ -51,7 +50,7 @@ trecurse(root, action, level)
void
twalk(vroot, action)
const void *vroot; /* Root of the tree to be walked */
void (*action) __P((const void *, VISIT, int));
void (*action) (const void *, VISIT, int);
{
if (vroot != NULL && action != NULL)
trecurse(vroot, action, 0);
Expand Down

0 comments on commit 8b02394

Please sign in to comment.