[pulseaudio-discuss] Pull request for topic/osx
Colin Guthrie
gmane at colin.guthr.ie
Tue Dec 22 12:57:39 PST 2009
'Twas brillig, and Daniel Mack at 16/12/09 07:06 did gyre and gimble:
>> There are a couple places where it appears a final #else.... #endif has
>> been removed... this means code will be compiled that isn't needed (the
>> previous matching #if/#elif block ends with a return) Some compilers
>> throw up warnings about unreachable code in this case. It's probably
>> best to ensure the #else #endif is restored (although, personally I
>> prefer to have a return right before the closing brace, I don't want to
>> mess with compiler warnings nor Lennart's current code style :))
>>
>> Files affected:
>> src/pulsecore/core-rtclock.c (two occurrences relating to
>> HAVE_CLOCK_GETTIME)
>
> Hmm, not sure whether I follow here. The way it is now (with my patch
> applied), all functions have a proper return value at the end. If it was
> different before, that was a mistake the patch fixes :)
>
> Everything else the patch does is shifting blocks around, which is
> necessary due to the fact that on Mac OS X, HAVE_CLOCK_GETTIME is
> defined but the actual functions are not implemented. Gna.
Sorry, it doesn't make much sense now I reread it.
I was meaning that you now have code that looks like:
int func()
{
#if something
return 1;
#endif
return 1;
}
where as before it was:
int func()
{
#if something
return 1;
#else
return 1;
#endif
}
Personally I prefer the first version (as I know that there will always
be a return processed just by looking at the last line of the function)
but like I say the second layout was how it was in the past and should
avoid any compiler warning about "unreachable code" - could be that I've
made up that last warning - could have just been in an IDE :)
This point is mostly nitpicking tho', so probably best to ignore it :)
>> Would this be better as a:
>> #define pa_poll poll
>
> Yes, agreed. I replaced it by a macro now, but by one which has
> arguments, so whoever searches for the implementation will get an idea
> of what's going on.
>
> The changed tree is again at
>
> git://github.com/zonque/pulseaudio.git topic/osx
Cool. I'll pull it soon if Lennart doesn't beat me to it (seeing as he's
back soon) Probably tomorrow when I can do a few build tests etc. just
in case :)
Sorry for the delayed reply - mailing list borked :s
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
More information about the pulseaudio-discuss
mailing list