diff --git a/tests/ctests/test_netplan_error.c b/tests/ctests/test_netplan_error.c index 3794f68ab..01bc1c6f3 100644 --- a/tests/ctests/test_netplan_error.c +++ b/tests/ctests/test_netplan_error.c @@ -26,7 +26,7 @@ test_netplan_error_code(__unused void** state) { GError *gerror = g_error_new(1234, 5678, "%s: error message", "it failed"); uint64_t error_code = netplan_error_code(gerror); - GQuark domain = error_code >> 32; + GQuark domain = (GQuark)(error_code >> 32); gint error = (gint) error_code; assert_int_equal(domain, 1234); diff --git a/tests/ctests/test_netplan_keyfile.c b/tests/ctests/test_netplan_keyfile.c index 7b1cbecc3..2cda89efb 100644 --- a/tests/ctests/test_netplan_keyfile.c +++ b/tests/ctests/test_netplan_keyfile.c @@ -260,8 +260,8 @@ test_load_keyfile_utf8_password(__unused void** state) { NetplanState *np_state = NULL; int fd; - int size; - int res; + size_t size; + ssize_t res; char* yaml; const char* keyfile = @@ -306,7 +306,7 @@ test_load_keyfile_utf8_password(__unused void** state) netplan_state_dump_yaml(np_state, fd, NULL); - size = lseek(fd, 0, SEEK_CUR) + 1; + size = (size_t)lseek(fd, 0, SEEK_CUR) + 1; yaml = malloc(size); memset(yaml, 0, size); lseek(fd, 0, SEEK_SET); diff --git a/tests/ctests/test_netplan_parser.c b/tests/ctests/test_netplan_parser.c index b04e228e7..d8020e420 100644 --- a/tests/ctests/test_netplan_parser.c +++ b/tests/ctests/test_netplan_parser.c @@ -389,8 +389,8 @@ test_parse_utf8_characters(__unused void** state) { NetplanState *np_state = NULL; int fd; - int size; - int res; + size_t size; + ssize_t res; char* yaml = "network:\n" @@ -418,7 +418,7 @@ test_parse_utf8_characters(__unused void** state) netplan_state_dump_yaml(np_state, fd, NULL); - size = lseek(fd, 0, SEEK_CUR) + 1; + size = (size_t)lseek(fd, 0, SEEK_CUR) + 1; yaml = malloc(size); memset(yaml, 0, size); lseek(fd, 0, SEEK_SET);