[PATCH xserver 1/3] xfree86/modes: Move gamma initialization to xf86RandR12Init12 v2

Keith Packard keithp at keithp.com
Wed Jul 27 20:51:02 UTC 2016


Matt Turner <mattst88 at gmail.com> writes:

> I feel confident the compiler is already doing that transformation.

I just tried and couldn't get the compiler to do it as the 'pow'
function isn't declared with the 'const' attribute. That appears to be a
bug in glibc.

This code does what you'd expect:

#include <math.h>

extern double mypow(double a, double b) __attribute__ ((const));

double foo (double a, double b, double c, int x[], int q)
{
	int i;
	for (i = 0; i < q; i++)
		x[i] = (int) (mypow(a, c)*b);
}

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160727/9411f773/attachment-0001.sig>


More information about the xorg-devel mailing list