Re: va_list customize strings and objects.
Re: va_list customize strings and objects.
- Subject: Re: va_list customize strings and objects.
- From: "email@hidden" <email@hidden>
- Date: Sat, 14 Aug 2010 17:51:09 +0100
On 14 Aug 2010, at 17:13, 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;
> }
>
>
You are using a double here for both floats and double.
floatValue is declared a double so sizeof() will always report the size of a double.
I would split the float and double into different case statements.
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________
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