[cairo-bugs] [Bug 12717] CLAMP macro instead of _cairo_restrict_value

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Oct 7 06:38:01 PDT 2007


------- Comment #5 from freedesktop at behdad.org  2007-10-07 06:40 PST -------
(In reply to comment #4)
> Just to clarify, the intention of the patch is not to fix a non-existent
> bottleneck. It is to make part of the code more readable. YMMV, but then you
> are wrong. :) And as you can see in the patch it doesn't matter if the
> constants 0.0 and 1.0 are expanded multiple times. 

+#define CLAMP(x, lo, hi)  (((x) > (hi)) ? (hi) : (((x) < (lo)) ? (lo) : (x)))

x is expanded at least twice.  There's no point in fixing what's not broken.

Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the cairo-bugs mailing list