Re: va_list customize strings and objects.

2010-08-14 Thread Michael Ash
On Sat, Aug 14, 2010 at 1:10 PM, Mr. Gecko wrote: > I may as well just write my own stringWithFormat:arguments: to do what I > need, it'll probably be the best way if I can't do the things in default. That's probably your best bet. You can probably find the source to an implementation of vasprin

Re: va_list customize strings and objects.

2010-08-14 Thread Mr. Gecko
I may as well just write my own stringWithFormat:arguments: to do what I need, it'll probably be the best way if I can't do the things in default. On Aug 14, 2010, at 12:02 PM, Keary Suska wrote: > Look at your code again. You are forcing floats to be interpreted as doubles. > > Keary Suska > E

Re: va_list customize strings and objects.

2010-08-14 Thread Keary Suska
Nevermind. On Aug 14, 2010, at 11:02 AM, Keary Suska wrote: > On Aug 14, 2010, at 10:44 AM, Mr. Gecko wrote: > >> Shouldn't it detect that with the sizeof? It also doesn't seem to work with >> long numbers. My guess is that I'll have to do a custom one for each >> possible value, I don't reall

Re: va_list customize strings and objects.

2010-08-14 Thread Keary Suska
On Aug 14, 2010, at 10:44 AM, Mr. Gecko wrote: > Shouldn't it detect that with the sizeof? It also doesn't seem to work with > long numbers. My guess is that I'll have to do a custom one for each possible > value, I don't really want to do that because I think it is possible to do it > all in t

Re: va_list customize strings and objects.

2010-08-14 Thread Michael Ash
On Sat, Aug 14, 2010 at 12:37 PM, Keary Suska 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);

Re: va_list customize strings and objects.

2010-08-14 Thread jonat...@mugginsoft.com
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, si

Re: va_list customize strings and objects.

2010-08-14 Thread Mr. Gecko
Shouldn't it detect that with the sizeof? It also doesn't seem to work with long numbers. My guess is that I'll have to do a custom one for each possible value, I don't really want to do that because I think it is possible to do it all in the default case. On Aug 14, 2010, at 11:37 AM, Keary Su

Re: va_list customize strings and objects.

2010-08-14 Thread Keary Suska
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,

Re: va_list customize strings and objects.

2010-08-14 Thread Mr. Gecko
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;

Re: va_list customize strings and objects.

2010-08-14 Thread Mr. Gecko
Update: So far this works, but I need to put everything else back in. The problem with this is that the only way I can think of doing this is following this http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html to do every single possible v

va_list customize strings and objects.

2010-08-13 Thread Mr . Gecko
Hello, I'm wanting to let's say escape strings and objects in a va_list before I use NSString to place the format together into one string. I know that on OS X va_list is just a char * that is an array, so I know I should be able to make one manually in code, but how is the question. I read htt