gallium: fix reference counting functions to be strict-aliasing compliant
authorRoland Scheidegger <sroland@vmware.com>
Thu, 3 Dec 2009 22:15:38 +0000 (23:15 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 3 Dec 2009 22:15:38 +0000 (23:15 +0100)
commit35a15f02634a31c1517363d91aaef8f190e24687
treecfeb5f3a64265812737faab11788706728d1c56e
parentcdb6849fc1fa0c6e360c89a6388dc8bf19a746ca
gallium: fix reference counting functions to be strict-aliasing compliant

Historically, parts of mesa code are not strict-aliasing safe, hence
-fno-strict-aliasing is needed to compile (this got forgotten for scons
builds for gallium, which indeed not only caused compiler warnings but also
unexplicable crashes in non-debug builds). However, we should try to eliminate
code not complying with strict-aliasing code at least for gallium.
Hence change pipe_reference functions to make them strict-aliasing compliant.
This adds a bit more complexity (especially for derived classes) but is the
right thing to do, and it does in fact fix a segfault.
src/gallium/auxiliary/pipebuffer/pb_buffer.h
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/drivers/svga/svga_screen_texture.h
src/gallium/include/pipe/p_refcnt.h
src/gallium/include/pipe/p_state.h
src/gallium/include/pipe/p_video_state.h