diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-05-31 17:17:13 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-05-31 17:17:13 +0400 |
commit | 0612e84b3cec508c3d62d38c4e2682c85cc808bb (patch) | |
tree | db777e38f9c528127e195ad01da6a3088dc6da4a /src/cfg_utils.c | |
parent | ae3eb4dfd787052bebc732c3e37b56f0800e1aa2 (diff) | |
download | rspamd-0612e84b3cec508c3d62d38c4e2682c85cc808bb.tar.gz rspamd-0612e84b3cec508c3d62d38c4e2682c85cc808bb.zip |
* Fix strict aliasing while compiling with optimization
* Fix tanhl detection for platforms that have not implementation of it
* Remove several compile warnings
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r-- | src/cfg_utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c index d63e6bc93..21cf57481 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -727,7 +727,15 @@ internal_normalizer_func (struct config_file *cfg, long double score, void *data return score; } else { +#ifdef HAVE_TANHL return max * tanhl (score / max); +#else + /* + * As some implementations of libm does not support tanhl, try to use + * tanh + */ + return max * tanh ((double) (score / max)); +#endif } return score; |