Bug 80888 - draw_cliptest_tmp.h computes zero/zero It is better to use NAN macro
Summary: draw_cliptest_tmp.h computes zero/zero It is better to use NAN macro
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 10.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-04 05:50 UTC by Vittorio
Modified: 2014-07-04 06:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vittorio 2014-07-04 05:50:11 UTC
draw_cliptest_tmp.h:180
"position[3] = zero / zero; /* MSVC doesn't accept 0.0 / 0.0 */"
is wrong in my opinion.
The NAN macro from math.h should be used instead
"position[3] = NAN;"
see man NAN.
I believe zero/zero is against any programming language standard that I know.
Comment 1 Roland Scheidegger 2014-07-04 06:27:29 UTC
Unfortunately msvc (at least pre 2013) doesn't support NAN.
There's only one other method I can think of to do it there which would be to use a float/uint union, set the uint to some nan bit pattern then use the float part. No idea if it would actually work and not really nicer neither.


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.