[Spice-devel] [PATCH v3 7/8] replay: Use proper formatting for scanf family

Frediano Ziglio fziglio at redhat.com
Fri Sep 16 11:33:00 UTC 2016


Currently on Linux PRIu64 and SCNu64 are the same but just to make
sure in the future use the correct macros.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-replay-qxl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 6950f98..1442686 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -423,7 +423,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
 
     qxl = (QXLImage*)replay_malloc0(replay, sizeof(QXLImage));
     elem = replay->allocated;
-    replay_fscanf(replay, "descriptor.id %"PRIu64"\n", &qxl->descriptor.id);
+    replay_fscanf(replay, "descriptor.id %"SCNu64"\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);
@@ -452,7 +452,7 @@ static QXLImage *red_replay_image(SpiceReplay *replay, uint32_t flags)
             qp = replay_malloc(replay, sizeof(QXLPalette) + num_ents * sizeof(qp->ents[0]));
             qp->num_ents = num_ents;
             qxl->bitmap.palette = QXLPHYSICAL_FROM_PTR(qp);
-            replay_fscanf(replay, "unique %"PRIu64"\n", &qp->unique);
+            replay_fscanf(replay, "unique %"SCNu64"\n", &qp->unique);
             for (i = 0; i < num_ents; i++) {
                 replay_fscanf(replay, "ents %d\n", &qp->ents[i]);
             }
@@ -1296,7 +1296,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
     int counter;
 
     while (what != 0) {
-        replay_fscanf(replay, "event %d %d %d %"PRIu64"\n", &counter,
+        replay_fscanf(replay, "event %d %d %d %"SCNu64"\n", &counter,
                             &what, &type, &timestamp);
         if (replay->error) {
             goto error;
@@ -1308,7 +1308,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
     cmd = g_new(QXLCommandExt, 1);
     cmd->cmd.type = type;
     cmd->group_id = 0;
-    spice_debug("command %"PRIu64", %d\r", timestamp, cmd->cmd.type);
+    spice_debug("command %"SCNu64", %d\r", timestamp, cmd->cmd.type);
     switch (cmd->cmd.type) {
     case QXL_CMD_DRAW:
         cmd->flags = 0;
-- 
2.7.4



More information about the Spice-devel mailing list