Re: va_list customize strings and objects.
Re: va_list customize strings and objects.
- Subject: Re: va_list customize strings and objects.
- From: Michael Ash <email@hidden>
- Date: Sat, 14 Aug 2010 12:53:29 -0400
On Sat, Aug 14, 2010 at 12:37 PM, Keary Suska <email@hidden> wrote:
> On Aug 14, 2010, at 10:13 AM, Mr. Gecko wrote:
>
>> Well this seems to work for everything but floats, I've tried this to fix the float issue but it didn't work.
>> case 'f':
>> case 'g': {
>> double floatValue = va_arg(ap, double);
>> size += sizeof(floatValue);
>> ap2 = realloc(ap2, size);
>> ap2[count] = (void *)&floatValue;
>> break;
>> }
>
> Floats and doubles are not the same thing, and usually have different sizes.
While what you say is true, it's also irrelevant. Because floats are
always promoted to doubles when passed as a variable argument, it is
impossible to ever find a float in a va_list.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden