[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [ [PATCH 1/2] cutils:change strtosz_suffix_unit functio
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [ [PATCH 1/2] cutils:change strtosz_suffix_unit function |
Date: |
Wed, 12 Dec 2012 09:18:44 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Dec 12, 2012 at 08:58:17AM +0800, li guang wrote:
> 在 2012-12-11二的 10:52 +0100,Stefan Hajnoczi写道:
> > On Fri, Dec 07, 2012 at 11:49:49AM +0800, liguang wrote:
> > > if value to be translated is larger than INT64_MAX,
> > > this function will not be convenient for caller to
> > > be aware of it, so change a little for this.
> > >
> > > Signed-off-by: liguang <address@hidden>
> > > ---
> > > cutils.c | 5 +++--
> > > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > I don't understand what this patch is supposed to do.
>
> little change to let the caller know the translated value overflow
Using a negative errno will make the intent clear.
> >
> > Why change the type of mul from double to int64_t?
>
> mul is multiplier generated by suffix_mul(return value type int64_t)
> so double is incorrect.
Okay, thanks. I asked because I wondered whether it had something to do
with overflow detection. Please put unrelated changes in separate
patches - and if you feel it's not worth putting in a separate patch
then maybe it's not worth changing at all.
Stefan