From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Me7dK-0007vg-OO for qemu-devel@nongnu.org; Thu, 20 Aug 2009 09:24:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Me7dG-0007ty-6D for qemu-devel@nongnu.org; Thu, 20 Aug 2009 09:24:50 -0400 Received: from [199.232.76.173] (port=34921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Me7dG-0007tr-2d for qemu-devel@nongnu.org; Thu, 20 Aug 2009 09:24:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60717) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Me7dF-0001hk-Gf for qemu-devel@nongnu.org; Thu, 20 Aug 2009 09:24:45 -0400 Date: Thu, 20 Aug 2009 10:24:34 -0300 From: Luiz Capitulino Message-ID: <20090820102434.173fd816@doriath> In-Reply-To: <4A8D0094.6040901@redhat.com> References: <1250723280-3509-1-git-send-email-lcapitulino@redhat.com> <1250723280-3509-3-git-send-email-lcapitulino@redhat.com> <4A8D0094.6040901@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 02/29] Introduce QInt List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Thu, 20 Aug 2009 10:51:48 +0300 Avi Kivity 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? Thinking about this now, qint_from_int() is not needed, I can drop it and rename qint_from_int64(). Regarding the 'export' ones, I thought that the compiler would warn about something like: int index = qint_to_int64(qi); forcing the user to cast by hand. But testing it now, it doesn't happen. :)