[Ffmpeg-devel] More signed fun

Loren Merritt lorenm
Mon Mar 27 02:42:10 CEST 2006


On Sun, 26 Mar 2006, Ivan Kalvachev wrote:

> Giving that the code that use is:
> CHECK_BIDIR2( 0,-1, 0, 1)
> I was wondering how it compiles at all, well gcc -E reveield
> something like this:
> ...
> (- -1<=0 || motion_fx+- -1<=xmax) && (-0<=0 || motion_fy+-0<=ymax) &&
> (-1<=0 || motion_bx+-1<=xmax) && (-1<=0 || motion_by+-1<=ymax) &&(-
> -1>=0 || motion_fx+- -1>=xmin) && (-0>=0 ||
> ...
> For these who don't use monospace font, there is space between both - -.
> I'm not sure where this space have came from, but i doubt it is part
> of the standard.

The C preprocessor operates on tokens, not plain text. It will never 
concatenate two tokens into one unless you explicitely use the ## 
operator. In this case, one token is `-' and another token is `-1'.
It's not "works because spaces are added", it's "spaces are added because 
otherwise the tokens would be concatenated".

--Loren Merritt





More information about the ffmpeg-devel mailing list