Changeset 12222


Ignore:
Timestamp:
Mar 24, 2011, 6:32:05 PM (11 years ago)
Author:
jordan
Message:

(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

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r12219 r12222  
    2323 *****************************************************************************/
    2424
     25#include <math.h> /* pow() */
    2526#include <string.h> /* strcmp, strlen */
    2627
     
    13451346***/
    13461347
     1348static int
     1349gtr_compare_double( const double a, const double b, int decimal_places )
     1350{
     1351    const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) );
     1352    const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) );
     1353    if( ia < ib ) return -1;
     1354    if( ia > ib ) return  1;
     1355    return 0;
     1356}
     1357
    13471358static gboolean
    13481359update_foreach( GtkTreeModel * model,
  • trunk/gtk/util.c

    r12221 r12222  
    1313#include <ctype.h> /* isxdigit() */
    1414#include <errno.h>
    15 #include <math.h> /* pow() */
    1615#include <stdarg.h>
    1716#include <stdlib.h> /* free() */
     
    110109
    111110    return ret;
    112 }
    113 
    114 /***
    115 ****
    116 ***/
    117 
    118 int
    119 gtr_compare_double( const double a, const double b, int decimal_places )
    120 {
    121     const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) );
    122     const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) );
    123     if( ia < ib ) return -1;
    124     if( ia > ib ) return  1;
    125     return 0;
    126111}
    127112
  • trunk/gtk/util.h

    r12221 r12222  
    6363/* return a human-readable string for the time given in seconds. */
    6464char* tr_strltime( char * buf, int secs, size_t buflen );
    65 
    66 int gtr_compare_double( const double a, const double b, int decimal_places );
    67 
    6865
    6966/***
Note: See TracChangeset for help on using the changeset viewer.