Re:A nice, little known C feature: Static array indices in p...
by tolmasky on Monday February 18, 2013 @09:13PM
(#5242195)
I prefer the objective-c method of putting @ in front of every keyword.
[ Parent
| on HN ]
Re:A nice, little known C feature: Static array indices in p...
by dietrichepp on Tuesday February 19, 2013 @02:37AM
(#5243140)
Well, I might be upset if this were true for all keywords.
@static @inline @unsigned @int ilog2(@unsigned @int x)
{
@for (@unsigned @int i = 0; i < 32; i++)
@if ((x >> i) == 0)
@return i;
@return 32;
}
I'm a bit dizzy looking at that code, let me sit down for a moment.
Re:A nice, little known C feature: Static array indices in p...
by redial on Tuesday February 19, 2013 @03:41AM
(#5243319)
I believe the @ is used only by the obj-c keywords and not the ones from C. So it'll be something more like this
@autoreleasepool{
for (int index = 0; index < 100; index++){
int error = [MyObject performSelector:@selector(addCoolFilterToImage:)];
if (error) {
return 32;
}
}
}
Re:A nice, little known C feature: Static array indices in p...
by dietrichepp on Tuesday February 19, 2013 @05:52AM
(#5243644)
Yeah, that was kind of my point.