Skip to content

Commit

Permalink
all: don't use math.h or link with libm.so
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Mar 23, 2017
1 parent e15966a commit 54344bc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ AM_PROG_LIBTOOL
AC_PROG_MKDIR_P
AC_CHECK_PROGS(FLEX, 'flex')
AC_CHECK_PROGS(YACC, 'bison -y')
AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))

AC_C_CONST
AC_C_INLINE
Expand Down
1 change: 0 additions & 1 deletion include/netlink-private/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include <time.h>
#include <stdarg.h>
#include <ctype.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ long nl_prob2int(const char *str)
if (*p && strcmp(p, "%") != 0)
return -NLE_INVAL;

return rint(d * NL_PROB_MAX);
return (long) (((d * NL_PROB_MAX) + 0.5));
}

/** @} */
Expand Down

0 comments on commit 54344bc

Please sign in to comment.