Improved support for IBM operating systems

Fix compiler errors and warnings when building on IBM operating systems such as AIX and IBM i.
This commit is contained in:
David McCann
2020-05-13 15:57:54 +01:00
parent 3648c3ed2c
commit add7b13a9a
8 changed files with 39 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ static const char *rec_input_json_str =
/* clang-format on */
/* Example from RFC */
static void test_example_get()
static void test_example_get(void)
{
int i;
struct json_object *jo1, *jo2, *jo3;
@@ -126,7 +126,7 @@ static void test_example_get()
}
/* I'm not too happy with the RFC example to test the recusion of the json_pointer_get() function */
static void test_recursion_get()
static void test_recursion_get(void)
{
struct json_object *jo2, *jo1 = json_tokener_parse(rec_input_json_str);
@@ -161,7 +161,7 @@ static void test_recursion_get()
json_object_put(jo1);
}
static void test_wrong_inputs_get()
static void test_wrong_inputs_get(void)
{
struct json_object *jo2, *jo1 = json_tokener_parse(input_json_str);
@@ -231,7 +231,7 @@ static void test_wrong_inputs_get()
json_object_put(jo1);
}
static void test_example_set()
static void test_example_set(void)
{
struct json_object *jo2, *jo1 = json_tokener_parse(input_json_str);
@@ -272,7 +272,7 @@ static void test_example_set()
json_object_put(jo1);
}
static void test_wrong_inputs_set()
static void test_wrong_inputs_set(void)
{
struct json_object *jo2, *jo1 = json_tokener_parse(input_json_str);

View File

@@ -149,8 +149,8 @@ static void test_utf8_parse()
// json_tokener_parse doesn't support checking for byte order marks.
// It's the responsibility of the caller to detect and skip a BOM.
// Both of these checks return null.
char utf8_bom[] = {0xEF, 0xBB, 0xBF, 0x00};
char utf8_bom_and_chars[] = {0xEF, 0xBB, 0xBF, '{', '}', 0x00};
char* utf8_bom = "\xEF\xBB\xBF";
char* utf8_bom_and_chars = "\xEF\xBB\xBF{}";
single_basic_parse(utf8_bom, 0);
single_basic_parse(utf8_bom_and_chars, 0);
}
@@ -446,7 +446,7 @@ static void test_incremental_parse()
json_tokener_set_flags(tok, step->tok_flags);
if (length == -1)
length = strlen(step->string_to_parse);
length = (int)strlen(step->string_to_parse);
if (step->char_offset == -1)
expected_char_offset = length;
else

View File

@@ -24,10 +24,10 @@
static void test_read_valid_with_fd(const char *testdir);
static void test_read_valid_nested_with_fd(const char *testdir);
static void test_read_nonexistant();
static void test_read_nonexistant(void);
static void test_read_closed(void);
static void test_write_to_file();
static void test_write_to_file(void);
static void stat_and_cat(const char *file);
static void test_read_fd_equal(const char *testdir);