qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 02/29] Introduce QInt


From: Luiz Capitulino
Subject: [Qemu-devel] Re: [PATCH 02/29] Introduce QInt
Date: Thu, 20 Aug 2009 11:51:54 -0300

On Thu, 20 Aug 2009 16:26:33 +0300
Avi Kivity <address@hidden> wrote:

> On 08/20/2009 04:24 PM, Luiz Capitulino wrote:
> > On Thu, 20 Aug 2009 10:51:48 +0300
> > Avi Kivity<address@hidden>  wrote:
> >
> >    
> >> On 08/20/2009 02:07 AM, Luiz Capitulino wrote:
> >>      
> >>> QInt is a high-level data type that can be used to store integers
> >>> and perform type-safe conversions.
> >>>
> >>> The following functions are available:
> >>>
> >>> - qint_from_int()   Create a new QInt from an int
> >>> - qint_from_int64() Create a new QInt from an int64_t
> >>> - qint_to_int()     Export QInt to int
> >>> - qint_to_uint64()  Export QInt to uint64_t
> >>> - qint_to_uint32()  Export QInt to uint32_t
> >>>
> >>>        
> >> Why aren't the conversion functions symmetrical?
> >>      
> >   Are you referring to all of them?
> >    
> 
> You're converting from signed ints, but back into unsigned ints.

 Sometimes you are so brief that a range of problems come to my
mind. :)

 Basically, I'm doing what the code I'm replacing does: the top
level function (get_expr()) converts what was typed by the
user to int64_t. Command handlers, in turn, use this in several
ways: some want int, some uint32_t, some uint64_t.

 As I said, I think we can live only with:

- qint_from_int(int64_t)
- qint_to_int64(const Qint *)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]