|
|
Christoph Hormann wrote:
> Ray Gardener wrote:
>> Line 393 of module hdr.cpp rev 1.16, MegaPOV 1.2,
>> function void HDR_Image::Write_Line(COLOUR *line_data):
>>
>> if (width < MINELEN | width > MAXELEN)
>>
>> The '|' symbol might need to be '||'.
>>
>
> This making what difference for both arguments 0 or 1?
>
> Note BTW that the original Radiance code does exactly the same.
It's actually a good example of code that might work most or all of the
time, but it reduces readability because it's not a standard way to code
a logical OR expression. The second version has parantheses around the
inequality tests, so I suspect the original author ran into trouble and
'fixed' that line by forcing the operator precedence, but '||' would
have been the better choice.
Ray
Post a reply to this message
|
|