From 433da8df9ab06faf28667dc30013e3e543a41d32 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 24 Mar 2011 18:32:05 +0000 Subject: [PATCH] (trunk gtk) gtr_compare_double() is only used in one place, so make it a private function there instead of leaving it public in utils.h --- gtk/tr-core.c | 11 +++++++++++ gtk/util.c | 15 --------------- gtk/util.h | 3 --- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/gtk/tr-core.c b/gtk/tr-core.c index b50dc59e0..874c1ff6f 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -22,6 +22,7 @@ * DEALINGS IN THE SOFTWARE. *****************************************************************************/ +#include /* pow() */ #include /* strcmp, strlen */ #include @@ -1344,6 +1345,16 @@ gtr_core_clear( TrCore * self ) **** ***/ +static int +gtr_compare_double( const double a, const double b, int decimal_places ) +{ + const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) ); + const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) ); + if( ia < ib ) return -1; + if( ia > ib ) return 1; + return 0; +} + static gboolean update_foreach( GtkTreeModel * model, GtkTreePath * path UNUSED, diff --git a/gtk/util.c b/gtk/util.c index 1d71256e1..abe7d3ae8 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -12,7 +12,6 @@ #include /* isxdigit() */ #include -#include /* pow() */ #include #include /* free() */ #include /* strcmp() */ @@ -115,20 +114,6 @@ gtr_lockfile( const char * filename ) **** ***/ -int -gtr_compare_double( const double a, const double b, int decimal_places ) -{ - const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) ); - const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) ); - if( ia < ib ) return -1; - if( ia > ib ) return 1; - return 0; -} - -/*** -**** -***/ - const char* gtr_get_unicode_string( int i ) { diff --git a/gtk/util.h b/gtk/util.h index e43532930..48bf932b9 100644 --- a/gtk/util.h +++ b/gtk/util.h @@ -63,9 +63,6 @@ char* tr_strlratio( char * buf, double ratio, size_t buflen ); /* return a human-readable string for the time given in seconds. */ char* tr_strltime( char * buf, int secs, size_t buflen ); -int gtr_compare_double( const double a, const double b, int decimal_places ); - - /*** **** ***/