Hi Erik,

On 20/03/12 9:20 , Erik den Dekker wrote:
> There is still a similar warning that points to a fishy piece of code in the 
> DXF plugin:
> 
>     [ 75%] Building CXX object 
> src/osgPlugins/dxf/CMakeFiles/osgdb_dxf.dir/dxfEntity.cpp.o
>     
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
>     warning: use of logical '&&' with constant operand 
> [-Wconstant-logical-operand]
>     (cv._int && 128 /*i.e. vertex is actually a face*/))
>     ^ ~~~
>     
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
>     note: use '&' for a bitwise operation
>     (cv._int && 128 /*i.e. vertex is actually a face*/))
>     ^~
>     &
>     
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
>     note: remove constant to silence this warning
>     (cv._int && 128 /*i.e. vertex is actually a face*/))
>     ^~~~~~
>     1 warning generated.
> 
> But I am not sure what the correct code would be,.. (Use & instead of &&?),.. 
> So a fix is
> not included here.

This is most certainly a bug.
This code "cv._int && 128" evaluates as "cv._int != 0 && true" which does not 
make sense
in any context.  I'd change it to "cv._int & 0x80", using a hex to make it more 
obvious
that it's a bitmask.

Cheers,
/ulrich
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to