socsvn commit: r295787 - soc2015/clord/head/sys/contrib/ficl
clord at FreeBSD.org
clord at FreeBSD.org
Wed Dec 23 22:09:03 UTC 2015
Author: clord
Date: Wed Dec 23 22:09:02 2015
New Revision: 295787
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=295787
Log:
Fix some math bugs. Credit to Toomas Soome from the Illumos project.
Obtained from: http://cr.illumos.org/~webrev/tsoome/ficl/usr/src/common/ficl/double.c.patch
Modified:
soc2015/clord/head/sys/contrib/ficl/double.c
Modified: soc2015/clord/head/sys/contrib/ficl/double.c
==============================================================================
--- soc2015/clord/head/sys/contrib/ficl/double.c Wed Dec 23 21:59:38 2015 (r295786)
+++ soc2015/clord/head/sys/contrib/ficl/double.c Wed Dec 23 22:09:02 2015 (r295787)
@@ -159,7 +159,7 @@
ficl2Integer ficl2IntegerDecrement(ficl2Integer x)
{
- if (x.low == INT_MIN)
+ if (x.low == INTMAX_MIN)
x.high--;
x.low--;
@@ -170,16 +170,11 @@
ficl2Unsigned ficl2UnsignedAdd(ficl2Unsigned x, ficl2Unsigned y)
{
ficl2Unsigned result;
- int carry;
result.high = x.high + y.high;
result.low = x.low + y.low;
-
- carry = ((x.low | y.low) & FICL_CELL_HIGH_BIT) && !(result.low & FICL_CELL_HIGH_BIT);
- carry |= ((x.low & y.low) & FICL_CELL_HIGH_BIT);
-
- if (carry)
+ if(result.low < y.low)
{
result.high++;
}
More information about the svn-soc-all
mailing list