[Spice-commits] 3 commits - server/char-device.c server/display-channel.h server/red-record-qxl.c server/red-replay-qxl.c server/stream.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Tue Dec 15 09:50:58 PST 2015
server/char-device.c | 3 ++-
server/display-channel.h | 1 -
server/red-record-qxl.c | 10 +++++-----
server/red-replay-qxl.c | 16 ++++++++--------
server/stream.c | 4 ++--
5 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit 3c4e735e9e438502876a7ee259158a38ae31967e
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Dec 15 17:49:59 2015 +0000
server: Use '%zu' to print size_t variables
The size_t definition is different between 32 and 64 bit systems so that
neither '%u' nor '%lu' work for both. '%zu' should be used instead.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/red-record-qxl.c b/server/red-record-qxl.c
index f36d0e4..9c9dd62 100644
--- a/server/red-record-qxl.c
+++ b/server/red-record-qxl.c
@@ -114,7 +114,7 @@ static void write_binary(FILE *fd, const char *prefix, size_t size, const uint8_
}
#endif
- fprintf(fd, "binary %d %s %ld:", WITH_ZLIB, prefix, size);
+ fprintf(fd, "binary %d %s %zu:", WITH_ZLIB, prefix, size);
#if WITH_ZLIB
zlib_size = zlib_encode(enc, RECORD_ZLIB_DEFAULT_COMPRESSION_LEVEL, size,
output, sizeof(output));
@@ -144,7 +144,7 @@ static size_t red_record_data_chunks_ptr(FILE *fd, const char *prefix,
data_size += cur->data_size;
count_chunks++;
}
- fprintf(fd, "data_chunks %d %ld\n", count_chunks, data_size);
+ fprintf(fd, "data_chunks %d %zu\n", count_chunks, data_size);
memslot_validate_virt(slots, (intptr_t)qxl->data, memslot_id, qxl->data_size, group_id);
write_binary(fd, prefix, qxl->data_size, qxl->data);
diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index cedd126..66acf1e 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -198,7 +198,7 @@ static replay_t read_binary(SpiceReplay *replay, const char *prefix, size_t *siz
if (*buf == NULL) {
*buf = malloc(*size + base_size);
if (*buf == NULL) {
- spice_error("allocation error for %ld", *size);
+ spice_error("allocation error for %zu", *size);
exit(1);
}
}
@@ -259,7 +259,7 @@ static size_t red_replay_data_chunks(SpiceReplay *replay, const char *prefix,
size_t next_data_size;
QXLDataChunk *cur;
- replay_fscanf(replay, "data_chunks %d %ld\n", &count_chunks, &data_size);
+ replay_fscanf(replay, "data_chunks %d %zu\n", &count_chunks, &data_size);
if (base_size == 0) {
base_size = sizeof(QXLDataChunk);
}
@@ -407,7 +407,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
} else {
size = red_replay_data_chunks(replay, "bitmap.data", (uint8_t**)&qxl->bitmap.data, 0);
if (size != bitmap_size) {
- spice_printerr("bad image, %ld != %ld", size, bitmap_size);
+ spice_printerr("bad image, %zu != %zu", size, bitmap_size);
return NULL;
}
}
@@ -1028,7 +1028,7 @@ static QXLSurfaceCmd *red_replay_surface_cmd(SpiceReplay *replay)
if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
read_binary(replay, "data", &read_size, (uint8_t**)&qxl->u.surface_create.data, 0);
if (read_size != size) {
- spice_printerr("mismatch %ld != %ld", size, read_size);
+ spice_printerr("mismatch %zu != %zu", size, read_size);
}
} else {
qxl->u.surface_create.data = (QXLPHYSICAL)malloc(size);
commit badee4003010e5c9177af73b747a287f2a69915a
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Dec 15 17:48:52 2015 +0000
server: Remove an unneeded mjpeg-encoder.h include
The corresponding code has been moved elsewhere during the refactoring.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/display-channel.h b/server/display-channel.h
index c57bc8e..bf29cd3 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -28,7 +28,6 @@
#include "sw-canvas.h"
#include "stat.h"
#include "reds.h"
-#include "mjpeg-encoder.h"
#include "memslot.h"
#include "red-parse-qxl.h"
#include "red-record-qxl.h"
commit 110c31439b8bf832639ccdffff2ef52256c9c5e2
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Dec 15 17:43:44 2015 +0000
server: Use PRI macros in printf for 32/64 bit compatibility
Some integer type definitions are different between 32 and 64 bit
systems which causes problems in printf. The PRI macros automatically
provide the printf format appropriate for the system.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/char-device.c b/server/char-device.c
index 95d31f7..cefc14d 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -21,6 +21,7 @@
#include <config.h>
+#include <inttypes.h>
#include "char-device.h"
#include "red-channel.h"
#include "reds.h"
@@ -830,7 +831,7 @@ void spice_char_device_client_remove(SpiceCharDeviceState *dev,
}
if (dev->num_clients == 0) {
- spice_debug("client removed, memory pool will be freed (%lu bytes)", dev->cur_pool_size);
+ spice_debug("client removed, memory pool will be freed (%"PRIu64" bytes)", dev->cur_pool_size);
write_buffers_queue_free(&dev->write_bufs_pool);
dev->cur_pool_size = 0;
}
diff --git a/server/red-record-qxl.c b/server/red-record-qxl.c
index 0b966f0..f36d0e4 100644
--- a/server/red-record-qxl.c
+++ b/server/red-record-qxl.c
@@ -255,7 +255,7 @@ static void red_record_image(FILE *fd, RedMemSlotInfo *slots, int group_id,
qxl = (QXLImage *)memslot_get_virt(slots, addr, sizeof(*qxl), group_id,
&error);
- fprintf(fd, "descriptor.id %ld\n", qxl->descriptor.id);
+ fprintf(fd, "descriptor.id %"PRIu64"\n", qxl->descriptor.id);
fprintf(fd, "descriptor.type %d\n", qxl->descriptor.type);
fprintf(fd, "descriptor.flags %d\n", qxl->descriptor.flags);
fprintf(fd, "descriptor.width %d\n", qxl->descriptor.width);
@@ -280,7 +280,7 @@ static void red_record_image(FILE *fd, RedMemSlotInfo *slots, int group_id,
memslot_validate_virt(slots, (intptr_t)qp->ents,
memslot_get_id(slots, qxl->bitmap.palette),
num_ents * sizeof(qp->ents[0]), group_id);
- fprintf(fd, "unique %ld\n", qp->unique);
+ fprintf(fd, "unique %"PRIu64"\n", qp->unique);
for (i = 0; i < num_ents; i++) {
fprintf(fd, "ents %d\n", qp->ents[i]);
}
@@ -742,7 +742,7 @@ static void red_record_cursor(FILE *fd, RedMemSlotInfo *slots, int group_id,
qxl = (QXLCursor *)memslot_get_virt(slots, addr, sizeof(*qxl), group_id,
&error);
- fprintf(fd, "header.unique %ld\n", qxl->header.unique);
+ fprintf(fd, "header.unique %"PRIu64"\n", qxl->header.unique);
fprintf(fd, "header.type %d\n", qxl->header.type);
fprintf(fd, "header.width %d\n", qxl->header.width);
fprintf(fd, "header.height %d\n", qxl->header.height);
diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index ef7477a..cedd126 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -370,7 +370,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
}
qxl = (QXLImage*)malloc(sizeof(QXLImage));
- replay_fscanf(replay, "descriptor.id %ld\n", &qxl->descriptor.id);
+ replay_fscanf(replay, "descriptor.id %"PRIu64"\n", &qxl->descriptor.id);
replay_fscanf(replay, "descriptor.type %d\n", &temp); qxl->descriptor.type = temp;
replay_fscanf(replay, "descriptor.flags %d\n", &temp); qxl->descriptor.flags = temp;
replay_fscanf(replay, "descriptor.width %d\n", &qxl->descriptor.width);
@@ -393,7 +393,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
qp = malloc(sizeof(QXLPalette) + num_ents * sizeof(qp->ents[0]));
qp->num_ents = num_ents;
qxl->bitmap.palette = (QXLPHYSICAL)qp;
- replay_fscanf(replay, "unique %ld\n", &qp->unique);
+ replay_fscanf(replay, "unique %"PRIu64"\n", &qp->unique);
for (i = 0; i < num_ents; i++) {
replay_fscanf(replay, "ents %d\n", &qp->ents[i]);
}
@@ -1121,7 +1121,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
int counter;
while (what != 0) {
- replay_fscanf(replay, "event %d %d %d %ld\n", &counter,
+ replay_fscanf(replay, "event %d %d %d %"PRIu64"\n", &counter,
&what, &type, ×tamp);
if (replay->eof) {
return NULL;
@@ -1133,7 +1133,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
cmd = g_slice_new(QXLCommandExt);
cmd->cmd.type = type;
cmd->group_id = 0;
- spice_debug("command %ld, %d\r", timestamp, cmd->cmd.type);
+ spice_debug("command %"PRIu64", %d\r", timestamp, cmd->cmd.type);
switch (cmd->cmd.type) {
case QXL_CMD_DRAW:
cmd->flags = 0;
diff --git a/server/stream.c b/server/stream.c
index 811f7d3..3120860 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -38,8 +38,8 @@ void stream_agent_stats_print(StreamAgent *agent)
mjpeg_encoder_get_stats(agent->mjpeg_encoder, &encoder_stats);
}
- spice_debug("stream=%p dim=(%dx%d) #in-frames=%lu #in-avg-fps=%.2f #out-frames=%lu "
- "out/in=%.2f #drops=%lu (#pipe=%lu #fps=%lu) out-avg-fps=%.2f "
+ spice_debug("stream=%p dim=(%dx%d) #in-frames=%"PRIu64" #in-avg-fps=%.2f #out-frames=%"PRIu64" "
+ "out/in=%.2f #drops=%"PRIu64" (#pipe=%"PRIu64" #fps=%"PRIu64") out-avg-fps=%.2f "
"passed-mm-time(sec)=%.2f size-total(MB)=%.2f size-per-sec(Mbps)=%.2f "
"size-per-frame(KBpf)=%.2f avg-quality=%.2f "
"start-bit-rate(Mbps)=%.2f end-bit-rate(Mbps)=%.2f",
More information about the Spice-commits
mailing list