6 Commits

Author SHA1 Message Date
Anthony Minessale
0c3ba1e378 FS-9978: [mod_expr] mod_expr random seed function not working for Windows #resolve 2017-01-25 12:48:07 -06:00
Travis Cross
65e678ba1d Fix mod_expr clamp function
The clamp(v,a,b) function wraps v around the interval [a,b).

However prior to this commit, `clamp` was ignoring the third argument
and using the second argument again in its place.  This resulted in a
division by zero.  Hence `clamp` didn't work at all.

Even if the arguments were treated correctly, `clamp` incorrectly
multiplied rather than added whenever v < a.  This would have produced
bogus results.  (Thanks to Shona McNeill for pointing this out.)

Note that as implemented, `clamp` is undefined for b >= a.

These errors are present in the last upstream C version, v2.7.
They've been corrected in the C++ version that upstream now maintains
instead.

Thanks-to: Shona McNeill <prufrax@googlemail.com>

FS-7070 #resolve
2014-12-25 10:18:31 +00:00
Anthony Minessale
886e1ddb4d run indent on the whole tree and update copyright dates in prep for 1.0.5
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16579 d0543943-73ff-0310-b7d9-9358b9ac24b2
2010-02-06 03:38:24 +00:00
Michael Jerris
2737686af5 build cleanup.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6824 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-12-16 01:56:20 +00:00
Michael Jerris
89ecc93992 dos2unix
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6242 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-11-13 20:23:26 +00:00
Anthony Minessale
713afbd975 add some logic tools
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6189 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-11-08 23:46:26 +00:00