Bug 28845 - The GLU tesselator code has some warnings
Summary: The GLU tesselator code has some warnings
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLU (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 04:52 UTC by Neil Roberts
Modified: 2010-06-30 07:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix some compiler warnings in libtess (6.39 KB, patch)
2010-06-30 04:59 UTC, Neil Roberts
Details | Splinter Review

Description Neil Roberts 2010-06-30 04:52:19 UTC
In Clutter we are now using the libtess code from GLU in Mesa to draw paths. We've tried to keep the code without modifying it so that we can take updates easily. However Clutter by default uses more stringent compiler warning flags so it currently complains a lot. It would be nice if we could fix these warnings in Mesa so that we don't have to maintain a patch. Is that a possibility?
Comment 1 Neil Roberts 2010-06-30 04:59:56 UTC
Created attachment 36633 [details] [review]
Fix some compiler warnings in libtess

When compiled with the more aggressive compiler warnings such as
-Wshadow and -Wempty-body the libtess code gives a lot more
warnings. This fixes the following issues:

* The 'Swap' macro tries to combine multiple statements into one and
  then consume the trailing semicolon by using if(1){/*...*/}else.
  This gives warnings because the else part ends up with an empty
  statement. It also seems a bit dangerous because if the semicolon
  were missed then it would still be valid syntax but it would just
  ignore the following statement. This patch replaces it with the more
  common idiom do { /*...*/ } while(0).

* 'free' was being used as a local variable name but this shadows the
  global function. This has been renamed to 'free_handle'

* TRUE and FALSE were being unconditionally defined. Although this
  isn't currently a problem it seems better to guard them with #ifndef
  because it's quite common for them to be defined in other headers.
Comment 2 Brian Paul 2010-06-30 07:00:24 UTC
Thanks.  Committed to Mesa/master as commit 75acb896c6da758d03e86f8725d6ca0cb2c6ad82


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.