mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
Use PRIxPTR constant for string formatting
These constants are meant to be used in format string for size_t types. Use them for portability. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
parent
47ca1f0da0
commit
9541cd2fec
@ -123,7 +123,7 @@ static void write_binary(FILE *fd, const char *prefix, size_t size, const uint8_
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fprintf(fd, "binary %d %s %zu:", WITH_ZLIB, prefix, size);
|
fprintf(fd, "binary %d %s %" PRIuPTR ":", WITH_ZLIB, prefix, size);
|
||||||
#if WITH_ZLIB
|
#if WITH_ZLIB
|
||||||
zlib_size = zlib_encode(enc, RECORD_ZLIB_DEFAULT_COMPRESSION_LEVEL, size,
|
zlib_size = zlib_encode(enc, RECORD_ZLIB_DEFAULT_COMPRESSION_LEVEL, size,
|
||||||
output, sizeof(output));
|
output, sizeof(output));
|
||||||
@ -153,7 +153,7 @@ static size_t red_record_data_chunks_ptr(FILE *fd, const char *prefix,
|
|||||||
data_size += cur->data_size;
|
data_size += cur->data_size;
|
||||||
count_chunks++;
|
count_chunks++;
|
||||||
}
|
}
|
||||||
fprintf(fd, "data_chunks %d %zu\n", count_chunks, data_size);
|
fprintf(fd, "data_chunks %d %" PRIuPTR "\n", count_chunks, data_size);
|
||||||
memslot_validate_virt(slots, (intptr_t)qxl->data, memslot_id, qxl->data_size, group_id);
|
memslot_validate_virt(slots, (intptr_t)qxl->data, memslot_id, qxl->data_size, group_id);
|
||||||
write_binary(fd, prefix, qxl->data_size, qxl->data);
|
write_binary(fd, prefix, qxl->data_size, qxl->data);
|
||||||
|
|
||||||
|
|||||||
@ -266,7 +266,7 @@ static replay_t read_binary(SpiceReplay *replay, const char *prefix, size_t *siz
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if ((ret = inflate(&strm, Z_NO_FLUSH)) != Z_STREAM_END) {
|
if ((ret = inflate(&strm, Z_NO_FLUSH)) != Z_STREAM_END) {
|
||||||
spice_error("inflate error %d (disc: %ld)", ret, *size - strm.total_out);
|
spice_error("inflate error %d (disc: %" PRIdPTR ")", ret, *size - strm.total_out);
|
||||||
if (ret == Z_DATA_ERROR) {
|
if (ret == Z_DATA_ERROR) {
|
||||||
/* last operation may be wrong. since we do the recording
|
/* last operation may be wrong. since we do the recording
|
||||||
* in red_worker, when there is a shutdown from the vcpu/io thread
|
* in red_worker, when there is a shutdown from the vcpu/io thread
|
||||||
@ -296,7 +296,7 @@ static ssize_t red_replay_data_chunks(SpiceReplay *replay, const char *prefix,
|
|||||||
size_t next_data_size;
|
size_t next_data_size;
|
||||||
QXLDataChunk *cur, *next;
|
QXLDataChunk *cur, *next;
|
||||||
|
|
||||||
replay_fscanf(replay, "data_chunks %u %zu\n", &count_chunks, &data_size);
|
replay_fscanf(replay, "data_chunks %u %" PRIuPTR "\n", &count_chunks, &data_size);
|
||||||
if (replay->error) {
|
if (replay->error) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
|
|||||||
} else {
|
} else {
|
||||||
size = red_replay_data_chunks(replay, "bitmap.data", (uint8_t**)&qxl->bitmap.data, 0);
|
size = red_replay_data_chunks(replay, "bitmap.data", (uint8_t**)&qxl->bitmap.data, 0);
|
||||||
if (size != bitmap_size) {
|
if (size != bitmap_size) {
|
||||||
spice_printerr("bad image, %zu != %zu", size, bitmap_size);
|
spice_printerr("bad image, %" PRIuPTR " != %" PRIuPTR, size, bitmap_size);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1137,7 +1137,7 @@ static QXLSurfaceCmd *red_replay_surface_cmd(SpiceReplay *replay)
|
|||||||
if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
|
if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
|
||||||
read_binary(replay, "data", &read_size, (uint8_t**)&qxl->u.surface_create.data, 0);
|
read_binary(replay, "data", &read_size, (uint8_t**)&qxl->u.surface_create.data, 0);
|
||||||
if (read_size != size) {
|
if (read_size != size) {
|
||||||
spice_printerr("mismatch %zu != %zu", size, read_size);
|
spice_printerr("mismatch %" PRIuPTR " != %" PRIuPTR, size, read_size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qxl->u.surface_create.data = QXLPHYSICAL_FROM_PTR(replay_malloc(replay, size));
|
qxl->u.surface_create.data = QXLPHYSICAL_FROM_PTR(replay_malloc(replay, size));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user