From 49622888cd4954bf11544b2e43f58e523c9954b5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 13 Oct 2007 04:57:48 +0000 Subject: [PATCH] Use trunc module from gnulib instead of our home-grown solution. Patch #6224. * helpers.c: Don't need our own trunc function implementation anymore, since we now use the one from gnulib. * Smake: Add trunc to module list. * configure.ac: Don't need to check for trunc function any longer. --- ChangeLog | 9 +++++++++ Smake | 1 + configure.ac | 2 +- src/language/expressions/ChangeLog | 7 +++++++ src/language/expressions/helpers.c | 9 --------- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50a29eef..853b0724 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-10-12 Ben Pfaff + + Use trunc module from gnulib instead of our home-grown solution. + Patch #6224. + + * Smake: Add trunc to module list. + + * configure.ac: Don't need to check for trunc function any longer. + 2007-10-12 Ben Pfaff Use fseeko module from gnulib instead of our home-grown solution. diff --git a/Smake b/Smake index 21e6a224..d2dc497a 100644 --- a/Smake +++ b/Smake @@ -60,6 +60,7 @@ GNULIB_MODULES = \ strtoul \ sys_stat \ tmpfile \ + trunc \ unistd \ unlocked-io \ vasprintf-posix \ diff --git a/configure.ac b/configure.ac index d16c6f49..f738c50b 100644 --- a/configure.ac +++ b/configure.ac @@ -77,7 +77,7 @@ AC_CHECK_SIZEOF(long double) AC_C_BIGENDIAN -AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round trunc]) +AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round]) AC_PROG_LN_S diff --git a/src/language/expressions/ChangeLog b/src/language/expressions/ChangeLog index a5895b66..a59accb6 100644 --- a/src/language/expressions/ChangeLog +++ b/src/language/expressions/ChangeLog @@ -1,3 +1,10 @@ +2007-10-12 Ben Pfaff + + Patch #6224. + + * helpers.c: Don't need our own trunc function implementation + anymore, since we now use the one from gnulib. + 2007-07-17 Ben Pfaff Patch #19335. Reviewed by John Darrington. diff --git a/src/language/expressions/helpers.c b/src/language/expressions/helpers.c index a0f0c0fc..a28f1a66 100644 --- a/src/language/expressions/helpers.c +++ b/src/language/expressions/helpers.c @@ -131,15 +131,6 @@ enum date_unit DATE_SECONDS }; -#ifndef HAVE_TRUNC -/* Return X rounded toward zero. */ -static double -trunc (double x) -{ - return x >= 0.0 ? floor (x) : ceil (x); -} -#endif /* !HAVE_TRUNC */ - /* Stores in *UNIT the unit whose name is NAME. Return success. */ static enum date_unit -- 2.30.2