Move the json_min() and json_max() macros to json_util.h and mark everything else in bits.h deprecated.

Eliminate all uses of bits.h within the json-c code.
This commit is contained in:
Eric Haszlakiewicz
2014-05-03 22:29:10 -04:00
parent 1da0599e0e
commit d4e81f9ec8
7 changed files with 34 additions and 17 deletions

View File

@@ -20,7 +20,6 @@
# include <strings.h>
#endif /* HAVE_STRINGS_H */
#include "bits.h"
#include "arraylist.h"
struct array_list*
@@ -63,7 +62,9 @@ static int array_list_expand_internal(struct array_list *arr, int max)
int new_size;
if(max < arr->size) return 0;
new_size = json_max(arr->size << 1, max);
new_size = arr->size << 1;
if (new_size < max)
new_size = max;
if(!(t = realloc(arr->array, new_size*sizeof(void*)))) return -1;
arr->array = (void**)t;
(void)memset(arr->array + arr->size, 0, (new_size-arr->size)*sizeof(void*));