tomboy r1909 - in trunk: . libtomboy



Author: sdroege
Date: Thu Feb 28 15:33:39 2008
New Revision: 1909
URL: http://svn.gnome.org/viewvc/tomboy?rev=1909&view=rev

Log:
* configure.in:
* libtomboy/Makefile.am: Check for libm and link to it
libtomboy uses math functions.
* libtomboy/contrast.c: (lab_to_rgb): Use floor(x + 0.5) instead of
roundf(x) as the latter is C99 and not available (and declared) if
not compiling in C99 mode. Fixes bug #519237.


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/libtomboy/Makefile.am
   trunk/libtomboy/contrast.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Feb 28 15:33:39 2008
@@ -17,6 +17,9 @@
 AM_DISABLE_STATIC
 AM_PROG_LIBTOOL
 
+AC_CHECK_LIBM
+AC_SUBST(LIBM)
+
 #
 # Setup GETTEXT
 #

Modified: trunk/libtomboy/Makefile.am
==============================================================================
--- trunk/libtomboy/Makefile.am	(original)
+++ trunk/libtomboy/Makefile.am	Thu Feb 28 15:33:39 2008
@@ -24,7 +24,7 @@
 	eggtrayicon.c
 
 libtomboy_la_LDFLAGS = -export-dynamic -module -avoid-version
-libtomboy_la_LIBADD = $(LIBTOMBOY_LIBS)
+libtomboy_la_LIBADD = $(LIBTOMBOY_LIBS) $(LIBM)
 
 maintainer-clean-local:
 	rm -f Makefile.in

Modified: trunk/libtomboy/contrast.c
==============================================================================
--- trunk/libtomboy/contrast.c	(original)
+++ trunk/libtomboy/contrast.c	Thu Feb 28 15:33:39 2008
@@ -165,9 +165,9 @@
 	gs = -0.9692f * x + 1.8760f * y + 0.0416f * z;
 	bs =  0.0556f * x - 0.2040f * y + 1.0570f * z;
 
-	*R = CLAMP((int) roundf(xyz_to_srgb_C(rs) * 65535), 0, 65535);
-	*G = CLAMP((int) roundf(xyz_to_srgb_C(gs) * 65535), 0, 65535);
-	*B = CLAMP((int) roundf(xyz_to_srgb_C(bs) * 65535), 0, 65535);
+	*R = CLAMP((int) floorf(xyz_to_srgb_C(rs) * 65535 + 0.5), 0, 65535);
+	*G = CLAMP((int) floorf(xyz_to_srgb_C(gs) * 65535 + 0.5), 0, 65535);
+	*B = CLAMP((int) floorf(xyz_to_srgb_C(bs) * 65535 + 0.5), 0, 65535);
 }
 
 static inline float



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]