From patchwork Tue Sep 1 09:57:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Riteau X-Patchwork-Id: 32733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5CF4AB7B8C for ; Tue, 1 Sep 2009 19:59:24 +1000 (EST) Received: from localhost ([127.0.0.1]:52561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiQ8w-00048q-Fw for incoming@patchwork.ozlabs.org; Tue, 01 Sep 2009 05:59:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiQ7q-0003n9-4p for qemu-devel@nongnu.org; Tue, 01 Sep 2009 05:58:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiQ7l-0003ic-Ck for qemu-devel@nongnu.org; Tue, 01 Sep 2009 05:58:05 -0400 Received: from [199.232.76.173] (port=52535 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiQ7l-0003iN-5W for qemu-devel@nongnu.org; Tue, 01 Sep 2009 05:58:01 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:8328) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MiQ7k-0002bz-Kq for qemu-devel@nongnu.org; Tue, 01 Sep 2009 05:58:00 -0400 X-IronPort-AV: E=Sophos;i="4.44,311,1249250400"; d="scan'208";a="35282581" Received: from elfe.irisa.fr (HELO localhost.localdomain) ([131.254.60.12]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Sep 2009 11:57:57 +0200 From: Pierre Riteau To: qemu-devel@nongnu.org Date: Tue, 1 Sep 2009 11:57:20 +0200 Message-Id: <1251799040-23567-1-git-send-email-Pierre.Riteau@irisa.fr> X-Mailer: git-send-email 1.6.3.3 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Pierre Riteau Subject: [Qemu-devel] [PATCH] Fix compilation warnings when DEBUG_BUFFERED_FILE is defined X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org gcc 4.3.2 throws warnings when DEBUG_BUFFERED_FILE is defined, because we are using the wrong format specifiers to print size_t/ssize_t values. --- buffered_file.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buffered_file.c b/buffered_file.c index 63de17d..56b4418 100644 --- a/buffered_file.c +++ b/buffered_file.c @@ -52,7 +52,7 @@ static void buffered_append(QEMUFileBuffered *s, if (size > (s->buffer_capacity - s->buffer_size)) { void *tmp; - dprintf("increasing buffer capacity from %ld by %ld\n", + dprintf("increasing buffer capacity from %zu by %zu\n", s->buffer_capacity, size + 1024); s->buffer_capacity += size + 1024; @@ -79,7 +79,7 @@ static void buffered_flush(QEMUFileBuffered *s) return; } - dprintf("flushing %ld byte(s) of data\n", s->buffer_size); + dprintf("flushing %zu byte(s) of data\n", s->buffer_size); while (offset < s->buffer_size) { ssize_t ret; @@ -93,16 +93,16 @@ static void buffered_flush(QEMUFileBuffered *s) } if (ret <= 0) { - dprintf("error flushing data, %ld\n", ret); + dprintf("error flushing data, %zd\n", ret); s->has_error = 1; break; } else { - dprintf("flushed %ld byte(s)\n", ret); + dprintf("flushed %zd byte(s)\n", ret); offset += ret; } } - dprintf("flushed %ld of %ld byte(s)\n", offset, s->buffer_size); + dprintf("flushed %zu of %zu byte(s)\n", offset, s->buffer_size); memmove(s->buffer, s->buffer + offset, s->buffer_size - offset); s->buffer_size -= offset; } @@ -145,7 +145,7 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in break; } - dprintf("put %ld byte(s)\n", ret); + dprintf("put %zd byte(s)\n", ret); offset += ret; s->bytes_xfer += ret; }