X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=lib%2Fjsw%2Fjsw_hlib.c;h=a3a7a138352892bc9e84cc8f8a2df2f0a484fa38;hb=94724d7dd33cf19e283d86109adc037c0d771b6d;hp=6cc961ae791bebaa5f46d1f4c395d22e4c3c7e03;hpb=d37d830611a8dc438b2de37f68bf2f9ae1230490;p=zpackage diff --git a/lib/jsw/jsw_hlib.c b/lib/jsw/jsw_hlib.c index 6cc961a..a3a7a13 100644 --- a/lib/jsw/jsw_hlib.c +++ b/lib/jsw/jsw_hlib.c @@ -8,14 +8,7 @@ */ #include "jsw_hlib.h" -#ifdef __cplusplus -#include - -using std::malloc; -using std::free; -#else #include -#endif typedef struct jsw_node { void *key; /* Key used for searching */ @@ -44,7 +37,7 @@ struct jsw_hash { static jsw_node_t *new_node ( void *key, void *item, jsw_node_t *next ) { - jsw_node_t *node = (jsw_node_t *)malloc ( sizeof *node ); + jsw_node_t *node = malloc ( sizeof *node ); if ( node == NULL ) return NULL; @@ -58,7 +51,7 @@ static jsw_node_t *new_node ( void *key, void *item, jsw_node_t *next ) static jsw_head_t *new_chain ( void ) { - jsw_head_t *chain = (jsw_head_t *)malloc ( sizeof *chain ); + jsw_head_t *chain = malloc ( sizeof *chain ); if ( chain == NULL ) return NULL; @@ -79,13 +72,13 @@ jsw_hash_t *jsw_hnew ( size_t size, hash_f hash, cmp_f cmp, keydup_f keydup, itemdup_f itemdup, keyrel_f keyrel, itemrel_f itemrel ) { - jsw_hash_t *htab = (jsw_hash_t *)malloc ( sizeof *htab ); + jsw_hash_t *htab = malloc ( sizeof *htab ); size_t i; if ( htab == NULL ) return NULL; - htab->table = (jsw_head_t **)malloc ( size * sizeof *htab->table ); + htab->table = malloc ( size * sizeof *htab->table ); if ( htab->table == NULL ) { free ( htab ); @@ -385,7 +378,7 @@ jsw_hstat_t *jsw_hstat ( jsw_hash_t *htab ) if ( htab->size == 0 ) return NULL; - stat = (jsw_hstat_t *)malloc ( sizeof *stat ); + stat = malloc ( sizeof *stat ); if ( stat == NULL ) return NULL;