Changeset 5213 for trunk/gtk/util.c


Ignore:
Timestamp:
Mar 7, 2008, 4:09:21 PM (14 years ago)
Author:
charles
Message:

(gtk) fix the build for glib2 < 2.14, as reported by hudson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/util.c

    r5212 r5213  
    7070tr_strlsize( char * buf, guint64 size, size_t buflen )
    7171{
    72     const goffset s = (goffset)size;
    7372#if GLIB_CHECK_VERSION(2,16,0)
    7473    char * tmp = g_format_size_for_display( s );
     
    7675    g_free( tmp );
    7776#else
    78     if ( s < (goffset)KILOBYTE_FACTOR )
    79         g_snprintf( buf, buflen, ngettext("%u byte", "%u bytes", (guint)s), (guint)s );
     77    if( size < (guint64)KILOBYTE_FACTOR )
     78        g_snprintf( buf, buflen, ngettext("%u byte", "%u bytes", (guint)size), (guint)size );
    8079    else {
    8180        gdouble displayed_size;
    82         if (size < (goffset) MEGABYTE_FACTOR) {
     81        if (size < (guint64)MEGABYTE_FACTOR) {
    8382            displayed_size = (gdouble) size / KILOBYTE_FACTOR;
    8483            g_snprintf( buf, buflen, _("%.1f KB"), displayed_size );
    85         } else if (size < (goffset) GIGABYTE_FACTOR) {
     84        } else if (size < (guint64)GIGABYTE_FACTOR) {
    8685            displayed_size = (gdouble) size / MEGABYTE_FACTOR;
    8786            g_snprintf( buf, buflen, _("%.1f MB"), displayed_size );
Note: See TracChangeset for help on using the changeset viewer.