From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/7] common/vsprintf: Refactor pointer() out of vsnprintf() Date: Tue, 5 Nov 2013 10:25:05 +0000 Message-ID: <5278C781.50500@citrix.com> References: <1383600624-6345-1-git-send-email-andrew.cooper3@citrix.com> <1383600624-6345-3-git-send-email-andrew.cooper3@citrix.com> <5278D4BE02000078000FF70E@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vddos-00071S-NA for xen-devel@lists.xenproject.org; Tue, 05 Nov 2013 10:25:10 +0000 In-Reply-To: <5278D4BE02000078000FF70E@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 05/11/13 10:21, Jan Beulich wrote: >>>> On 04.11.13 at 22:30, Andrew Cooper wrote: >> No fuctional change > functional > >> + str = number(str, end, val, 16, field_width, precision, flags); >> + >> + return str; > Why not simply "return number(...);"? I thought I did, although that appears to only have made it into the subsequent patch. > >> @@ -399,13 +414,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) >> continue; >> >> case 'p': >> - if (field_width == -1) { >> - field_width = 2*sizeof(void *); >> - flags |= ZEROPAD; >> - } >> - str = number(str, end, >> - (unsigned long) va_arg(args, void *), >> - 16, field_width, precision, flags); >> + str = pointer(str, end, (unsigned long) va_arg(args, void *), >> + field_width, precision, flags); > The va_arg() result clearly shouldn't be cast here, even if both > the use here and that added by the next patch require this. I'm > definitely planning on adding a modifier to print domain/vcpu IDs > as a pair from a single "struct vcpu *" argument, and such code > shouldn't be required to cast back from "unsigned long" to a > pointer. > > Jan Ok - I will use a void* instead. ~Andrew > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel