Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hopefully fix FFA.sort() bug, caused by my questionable casting. @nwe…

  • Loading branch information...
commit 80b318eb33f6e793c5bc05b1c6c1d078e8b71179 1 parent 94e9219
@leto leto authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/pmc/fixedfloatarray.pmc
View
6 src/pmc/fixedfloatarray.pmc
@@ -583,7 +583,7 @@ Reverse the contents of the array.
=item C<static int auxcmpfunc(const FLOATVAL *i, const FLOATVAL *j)>
-INTVAL compare function for qsort usage.
+FLOATVAL compare function for qsort usage.
=cut
@@ -594,7 +594,9 @@ static int
auxcmpfunc(ARGIN(const FLOATVAL *i), ARGIN(const FLOATVAL *j))
{
ASSERT_ARGS(auxcmpfunc)
- return (int) (*i - *j);
+ if (*i == *j) return 0;
+ if (*i < *j) return -1;
+ else return 1;
}
/*
Please sign in to comment.
Something went wrong with that request. Please try again.