Unify unsigned integer usage in the API
Replace all occurences of unsigned int and unsigned long with size_t. This is a backwards incompatible change, as the signature of many API functions changes.
This commit is contained in:
@@ -28,7 +28,7 @@ static int getenv_int(const char *name)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int indent = 0;
|
||||
unsigned int flags = 0;
|
||||
size_t flags = 0;
|
||||
|
||||
json_t *json;
|
||||
json_error_t error;
|
||||
|
||||
@@ -174,7 +174,7 @@ static void test_copy_array(void)
|
||||
const char *json_array_text = "[1, \"foo\", 3.141592, {\"foo\": \"bar\"}]";
|
||||
|
||||
json_t *array, *copy;
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
array = json_loads(json_array_text, NULL);
|
||||
if(!array)
|
||||
@@ -203,7 +203,7 @@ static void test_deep_copy_array(void)
|
||||
const char *json_array_text = "[1, \"foo\", 3.141592, {\"foo\": \"bar\"}]";
|
||||
|
||||
json_t *array, *copy;
|
||||
unsigned int i;
|
||||
size_t i;
|
||||
|
||||
array = json_loads(json_array_text, NULL);
|
||||
if(!array)
|
||||
|
||||
@@ -152,33 +152,33 @@ int main()
|
||||
|
||||
/* Test reference counting on singletons (true, false, null) */
|
||||
value = json_true();
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting true works incorrectly");
|
||||
json_decref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting true works incorrectly");
|
||||
json_incref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting true works incorrectly");
|
||||
|
||||
value = json_false();
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting false works incorrectly");
|
||||
json_decref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting false works incorrectly");
|
||||
json_incref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting false works incorrectly");
|
||||
|
||||
value = json_null();
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting null works incorrectly");
|
||||
json_decref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting null works incorrectly");
|
||||
json_incref(value);
|
||||
if(value->refcount != (unsigned int)-1)
|
||||
if(value->refcount != (size_t)-1)
|
||||
fail("refcounting null works incorrectly");
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user