mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Use (un)signed printf specifiers correctly
Various places reported by cppcheck's invalidPrintfArgType_sint and invalidPrintfArgType_uint. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
dbe3cf6c64
commit
8b80d9f0f9
@ -115,7 +115,7 @@ parse_argv(int argc, char *argv[],
|
|||||||
}
|
}
|
||||||
*milliseconds = val;
|
*milliseconds = val;
|
||||||
if (*milliseconds != val) {
|
if (*milliseconds != val) {
|
||||||
ERROR("Integer overflow: %ld", val);
|
ERROR("Integer overflow: %lu", val);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -105,7 +105,7 @@ parse_argv(int argc, char *argv[],
|
|||||||
}
|
}
|
||||||
*seconds = val;
|
*seconds = val;
|
||||||
if (*seconds != val) {
|
if (*seconds != val) {
|
||||||
ERROR("Integer overflow: %ld", val);
|
ERROR("Integer overflow: %lu", val);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -265,7 +265,7 @@ mock_chown(const char *path,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (gid >> 16 || uid >> 16) {
|
if (gid >> 16 || uid >> 16) {
|
||||||
fprintf(stderr, "Attempt to set too high UID or GID: %lld %lld",
|
fprintf(stderr, "Attempt to set too high UID or GID: %llu %llu",
|
||||||
(unsigned long long) uid, (unsigned long long) gid);
|
(unsigned long long) uid, (unsigned long long) gid);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ testHashInit(int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virHashTableSize(hash) != oldsize) {
|
if (virHashTableSize(hash) != oldsize) {
|
||||||
VIR_TEST_DEBUG("hash grown from %zd to %zd",
|
VIR_TEST_DEBUG("hash grown from %zu to %zu",
|
||||||
(size_t)oldsize, (size_t)virHashTableSize(hash));
|
(size_t)oldsize, (size_t)virHashTableSize(hash));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ testHashRemoveSet(const void *data G_GNUC_UNUSED)
|
|||||||
|
|
||||||
if (count != rcount) {
|
if (count != rcount) {
|
||||||
VIR_TEST_VERBOSE("\nvirHashRemoveSet didn't remove expected number of"
|
VIR_TEST_VERBOSE("\nvirHashRemoveSet didn't remove expected number of"
|
||||||
" entries, %d != %u",
|
" entries, %d != %d",
|
||||||
rcount, count);
|
rcount, count);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ struct pciDeviceAddress {
|
|||||||
unsigned int device;
|
unsigned int device;
|
||||||
unsigned int function;
|
unsigned int function;
|
||||||
};
|
};
|
||||||
# define ADDR_STR_FMT "%04x:%02x:%02x.%d"
|
# define ADDR_STR_FMT "%04x:%02x:%02x.%u"
|
||||||
|
|
||||||
struct pciDevice {
|
struct pciDevice {
|
||||||
struct pciDeviceAddress addr;
|
struct pciDeviceAddress addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user