Johannes Weißl
2011-04-07 15:52:34 UTC
---
track_info.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/track_info.c b/track_info.c
index 3eb4a74..d7ef92d 100644
--- a/track_info.c
+++ b/track_info.c
@@ -160,11 +160,13 @@ int track_info_matches(const struct track_info *ti, const char *text, unsigned i
static int doublecmp0(double a, double b)
{
+ double x;
if (isnan(a))
return isnan(b) ? 0 : -1;
if (isnan(b))
return 1;
- return (int) (a - b);
+ x = a - b;
+ return (x > 0) - (x < 0);
}
/* this function gets called *alot*, it must be very fast */
track_info.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/track_info.c b/track_info.c
index 3eb4a74..d7ef92d 100644
--- a/track_info.c
+++ b/track_info.c
@@ -160,11 +160,13 @@ int track_info_matches(const struct track_info *ti, const char *text, unsigned i
static int doublecmp0(double a, double b)
{
+ double x;
if (isnan(a))
return isnan(b) ? 0 : -1;
if (isnan(b))
return 1;
- return (int) (a - b);
+ x = a - b;
+ return (x > 0) - (x < 0);
}
/* this function gets called *alot*, it must be very fast */
--
1.7.4.1
1.7.4.1