r2459 - trunk/varnish-cache/lib/libvarnish

des at projects.linpro.no des at projects.linpro.no
Wed Feb 13 18:19:52 CET 2008


Author: des
Date: 2008-02-13 18:19:52 +0100 (Wed, 13 Feb 2008)
New Revision: 2459

Modified:
   trunk/varnish-cache/lib/libvarnish/Makefile.am
   trunk/varnish-cache/lib/libvarnish/num.c
Log:
Never mind trying to avoid libm, we already use it anyway.


Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am
===================================================================
--- trunk/varnish-cache/lib/libvarnish/Makefile.am	2008-02-13 17:12:59 UTC (rev 2458)
+++ trunk/varnish-cache/lib/libvarnish/Makefile.am	2008-02-13 17:19:52 UTC (rev 2459)
@@ -20,7 +20,7 @@
 	vss.c \
 	vtmpfile.c
 
-libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS}
+libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM}
 
 TESTS = num_c_test
 
@@ -29,6 +29,7 @@
 
 num_c_test_SOURCES = num.c
 num_c_test_CFLAGS = -DNUM_C_TEST -include config.h
+num_c_test_LDADD = ${LIBM}
 
 test: ${TESTS}
 	@for test in ${TESTS} ; do ./$${test} ; done

Modified: trunk/varnish-cache/lib/libvarnish/num.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/num.c	2008-02-13 17:12:59 UTC (rev 2458)
+++ trunk/varnish-cache/lib/libvarnish/num.c	2008-02-13 17:19:52 UTC (rev 2459)
@@ -98,8 +98,7 @@
 			return ("Invalid suffix");
 	}
 
-	/* intentionally not round(fval) to avoid need for -lm */
-	*r = (uintmax_t)(fval + 0.5);
+	*r = (uintmax_t)round(fval);
 	return (NULL);
 }
 




More information about the varnish-commit mailing list