gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple string tokens


From: Riccardo Mottola
Subject: Re: multiple string tokens
Date: Wed, 17 Aug 2011 23:27:00 +0200
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.15) Gecko/20101113 SeaMonkey/2.0.10

Hi,
Hey,

I don't like using PRIdPTR because it took me a while to figure out why it 
works (I had to look up that it's a format string for intptr_t, and then check 
the NSInteger definition to verify that that is also intptr_t…), and PRIdPTR 
introduces a dependency on how NSInteger is defined everywhere you use it.

Personally I always cast NSInteger/CGFloat to a c89 type when I need to print them, since it will 
work on any Foundation implementation. Anyway, we just have to make sure we never have (@"foo: 
%f", someCGFloat) or  (@"foo: %d", someNSInteger)!
Putting an explicit cast sounds like a more readable idea too. It took me a bit to know what PRIdPTR actually does (well, I grep'd the headers and discovered that on sparc it is for example "lu" even if it is a 32bit sparc...).

David did already a lot of work which needs to be updated again :(

Any other have comments about this?

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]