qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Subject: [Qemu-devel] [PATCH v2] es1370: Fix compiler warnings for debug code
Date: Fri,  1 Oct 2010 20:05:54 +0200	[thread overview]
Message-ID: <1285956354-5071-1-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1010010031040.1728@linmac>

The patch fixes these gcc warnings:

./hw/es1370.c: In function ‘es1370_update_voices’:
./hw/es1370.c:411: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
./hw/es1370.c: In function ‘es1370_writel’:
./hw/es1370.c:579: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
./hw/es1370.c:589: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
./hw/es1370.c:606: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
./hw/es1370.c: In function ‘es1370_readl’:
./hw/es1370.c:748: error: suggest braces around empty body in an ‘if’ statement

v2

* Use %zd for pointer differences (ptrdiff_t or ssize_t).
  The gcc error message ("long int") was misleading.
  Malc, thank you for this hint.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: malc <av1474@comtv.ru>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/es1370.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/es1370.c b/hw/es1370.c
index 40cb48c..591dbd0 100644
--- a/hw/es1370.c
+++ b/hw/es1370.c
@@ -408,7 +408,7 @@ static void es1370_update_voices (ES1370State *s, uint32_t ctl, uint32_t sctl)
 
         if ((old_fmt != new_fmt) || (old_freq != new_freq)) {
             d->shift = (new_fmt & 1) + (new_fmt >> 1);
-            ldebug ("channel %d, freq = %d, nchannels %d, fmt %d, shift %d\n",
+            ldebug ("channel %zu, freq = %d, nchannels %d, fmt %d, shift %d\n",
                     i,
                     new_freq,
                     1 << (new_fmt & 1),
@@ -576,7 +576,7 @@ IO_WRITE_PROTO (es1370_writel)
         d++;
     case ES1370_REG_DAC1_SCOUNT:
         d->scount = (val & 0xffff) | (d->scount & ~0xffff);
-        ldebug ("chan %d CURR_SAMP_CT %d, SAMP_CT %d\n",
+        ldebug ("chan %zd CURR_SAMP_CT %d, SAMP_CT %d\n",
                 d - &s->chan[0], val >> 16, (val & 0xffff));
         break;
 
@@ -586,7 +586,7 @@ IO_WRITE_PROTO (es1370_writel)
         d++;
     case ES1370_REG_DAC1_FRAMEADR:
         d->frame_addr = val;
-        ldebug ("chan %d frame address %#x\n", d - &s->chan[0], val);
+        ldebug ("chan %zd frame address %#x\n", d - &s->chan[0], val);
         break;
 
     case ES1370_REG_PHANTOM_FRAMECNT:
@@ -603,7 +603,7 @@ IO_WRITE_PROTO (es1370_writel)
     case ES1370_REG_DAC1_FRAMECNT:
         d->frame_cnt = val;
         d->leftover = 0;
-        ldebug ("chan %d frame count %d, buffer size %d\n",
+        ldebug ("chan %zd frame count %d, buffer size %d\n",
                 d - &s->chan[0], val >> 16, val & 0xffff);
         break;
 
@@ -743,9 +743,10 @@ IO_READ_PROTO (es1370_readl)
         {
             uint32_t size = ((d->frame_cnt & 0xffff) + 1) << 2;
             uint32_t curr = ((d->frame_cnt >> 16) + 1) << 2;
-            if (curr > size)
+            if (curr > size) {
                 dolog ("read framecnt curr %d, size %d %d\n", curr, size,
                        curr > size);
+            }
         }
 #endif
         break;
-- 
1.7.1

  reply	other threads:[~2010-10-01 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 19:08 [Qemu-devel] [PATCH] es1370: Fix compiler warnings for debug code Stefan Weil
2010-09-30 20:33 ` malc
2010-10-01 18:05   ` Stefan Weil [this message]
2010-10-01 18:22     ` [Qemu-devel] [PATCH v2] " Markus Armbruster
2010-10-02  9:46       ` Stefan Weil
2010-10-02 10:20       ` [Qemu-devel] [PATCH v3] " Stefan Weil
2010-10-02 14:10         ` [Qemu-devel] " malc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285956354-5071-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).