*/
#include "jsw_atree.h"
-#ifdef __cplusplus
-#include <cstdlib>
-
-using std::malloc;
-using std::free;
-using std::size_t;
-#else
#include <stdlib.h>
-#endif
#ifndef HEIGHT_LIMIT
#define HEIGHT_LIMIT 64 /* Tallest allowable tree */
static jsw_anode_t *new_node ( jsw_atree_t *tree, void *data )
{
- jsw_anode_t *rn = (jsw_anode_t *)malloc ( sizeof *rn );
+ jsw_anode_t *rn = malloc ( sizeof *rn );
if ( rn == NULL )
return tree->nil;
jsw_atree_t *jsw_anew ( cmp_f cmp, dup_f dup, rel_f rel )
{
- jsw_atree_t *rt = (jsw_atree_t *)malloc ( sizeof *rt );
+ jsw_atree_t *rt = malloc ( sizeof *rt );
if ( rt == NULL )
return NULL;
/* Initialize sentinel */
- rt->nil = (jsw_anode_t *)malloc ( sizeof *rt->nil );
+ rt->nil = malloc ( sizeof *rt->nil );
if ( rt->nil == NULL ) {
free ( rt );
return NULL;
anyone who has modified the code through
a header comment, such as this one.
*/
-#ifdef __cplusplus
-#include <cstddef>
-using std::size_t;
+/* code modified for inclusion in zpm */
-extern "C" {
-#else
#include <stddef.h>
-#endif
/* Opaque types */
typedef struct jsw_atree jsw_atree_t;
void *jsw_atnext ( jsw_atrav_t *trav );
void *jsw_atprev ( jsw_atrav_t *trav );
-#ifdef __cplusplus
-}
-#endif
-
#endif
*/
#include "jsw_avltree.h"
-#ifdef __cplusplus
-#include <cstdlib>
-
-using std::malloc;
-using std::free;
-using std::size_t;
-#else
#include <stdlib.h>
-#endif
#ifndef HEIGHT_LIMIT
#define HEIGHT_LIMIT 64 /* Tallest allowable tree */
static jsw_avlnode_t *new_node ( jsw_avltree_t *tree, void *data )
{
- jsw_avlnode_t *rn = (jsw_avlnode_t *)malloc ( sizeof *rn );
+ jsw_avlnode_t *rn = malloc ( sizeof *rn );
if ( rn == NULL )
return NULL;
jsw_avltree_t *jsw_avlnew ( cmp_f cmp, dup_f dup, rel_f rel )
{
- jsw_avltree_t *rt = (jsw_avltree_t *)malloc ( sizeof *rt );
+ jsw_avltree_t *rt = malloc ( sizeof *rt );
if ( rt == NULL )
return NULL;
anyone who has modified the code through
a header comment, such as this one.
*/
-#ifdef __cplusplus
-#include <cstddef>
-
-using std::size_t;
-
-extern "C" {
-#else
#include <stddef.h>
-#endif
/* Opaque types */
typedef struct jsw_avltree jsw_avltree_t;
void *jsw_avltnext ( jsw_avltrav_t *trav );
void *jsw_avltprev ( jsw_avltrav_t *trav );
-#ifdef __cplusplus
-}
-#endif
-
#endif
*/
#include "jsw_hlib.h"
-#ifdef __cplusplus
-#include <cstdlib>
-
-using std::malloc;
-using std::free;
-#else
#include <stdlib.h>
-#endif
typedef struct jsw_node {
void *key; /* Key used for searching */
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;
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;
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 );
if ( htab->size == 0 )
return NULL;
- stat = (jsw_hstat_t *)malloc ( sizeof *stat );
+ stat = malloc ( sizeof *stat );
if ( stat == NULL )
return NULL;
anyone who has modified the code through
a header comment, such as this one.
*/
-#ifdef __cplusplus
-#include <cstddef>
-
-using std::size_t;
-
-extern "C" {
-#else
#include <stddef.h>
-#endif
typedef struct jsw_hash jsw_hash_t;
/* Get statistics for the hash table */
jsw_hstat_t *jsw_hstat ( jsw_hash_t *htab );
-#ifdef __cplusplus
-}
-#endif
-
#endif
*/
#include "jsw_rbtree.h"
-#ifdef __cplusplus
-#include <cstdlib>
-
-using std::malloc;
-using std::free;
-using std::size_t;
-#else
#include <stdlib.h>
-#endif
#ifndef HEIGHT_LIMIT
#define HEIGHT_LIMIT 64 /* Tallest allowable tree */
*/
static jsw_rbnode_t *new_node ( jsw_rbtree_t *tree, void *data )
{
- jsw_rbnode_t *rn = (jsw_rbnode_t *)malloc ( sizeof *rn );
+ jsw_rbnode_t *rn = malloc ( sizeof *rn );
if ( rn == NULL )
return NULL;
*/
jsw_rbtree_t *jsw_rbnew ( cmp_f cmp, dup_f dup, rel_f rel )
{
- jsw_rbtree_t *rt = (jsw_rbtree_t *)malloc ( sizeof *rt );
+ jsw_rbtree_t *rt = malloc ( sizeof *rt );
if ( rt == NULL )
return NULL;
*/
jsw_rbtrav_t *jsw_rbtnew ( void )
{
- return (jsw_rbtrav_t*)malloc ( sizeof ( jsw_rbtrav_t ) );
+ return malloc ( sizeof ( jsw_rbtrav_t ) );
}
/**
void *jsw_rbtprev ( jsw_rbtrav_t *trav )
{
return move ( trav, 0 ); /* Toward smaller items */
-}
\ No newline at end of file
+}
anyone who has modified the code through
a header comment, such as this one.
*/
-#ifdef __cplusplus
-#include <cstddef>
-
-using std::size_t;
-
-extern "C" {
-#else
#include <stddef.h>
-#endif
/* Opaque types */
typedef struct jsw_rbtree jsw_rbtree_t;
void *jsw_rbtnext ( jsw_rbtrav_t *trav );
void *jsw_rbtprev ( jsw_rbtrav_t *trav );
-#ifdef __cplusplus
-}
-#endif
-
#endif