Skip to content

Commit

Permalink
Hopefully fix FFA.sort() bug, caused by my questionable casting. @nwe…
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Jan 16, 2013
1 parent 94e9219 commit 80b318e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pmc/fixedfloatarray.pmc
Expand Up @@ -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

Expand All @@ -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;
}

/*
Expand Down

0 comments on commit 80b318e

Please sign in to comment.