Received: from [140.186.70.92] (port=37382 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1Q2Z-0005e3-El for qemu-devel@nongnu.org; Thu, 30 Sep 2010 16:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1PoZ-0000Ff-I2 for qemu-devel@nongnu.org; Thu, 30 Sep 2010 16:33:16 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:63976 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1PoZ-0000FO-Bi for qemu-devel@nongnu.org; Thu, 30 Sep 2010 16:33:15 -0400 Date: Fri, 1 Oct 2010 00:33:09 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] [PATCH] es1370: Fix compiler warnings for debug code In-Reply-To: <1285873715-9131-1-git-send-email-weil@mail.berlios.de> Message-ID: References: <1285873715-9131-1-git-send-email-weil@mail.berlios.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , QEMU Developers On Thu, 30 Sep 2010, Stefan Weil wrote: > 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 > > Cc: Blue Swirl > Signed-off-by: Stefan Weil > --- > hw/es1370.c | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/hw/es1370.c b/hw/es1370.c > index 40cb48c..c87bbf2 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 %ld 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 %ld 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 %ld 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; > typeof(ptr a - ptr b) = ptrdiff, not an %ld here on ppc32, so no, this "fix" is not correct. -- mailto:av1474@comtv.ru