Changeset 11088
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/tr-core.c
r11087 r11088 543 543 } 544 544 545 static int546 tr_strcmp( const void * a,547 const void * b )548 {549 if( a && b ) return strcmp( a, b );550 if( a ) return 1;551 if( b ) return -1;552 return 0;553 }554 555 545 static char * 556 546 torrentTrackerString( tr_torrent * tor ) … … 719 709 struct TrCorePrivate * p = TR_CORE( core )->priv; 720 710 721 if( p->monitor && ( !isEnabled || tr_strcmp( filename, p->monitor_path ) ) )711 if( p->monitor && ( !isEnabled || gtr_strcmp0( filename, p->monitor_path ) ) ) 722 712 { 723 713 g_signal_handler_disconnect( p->monitor, p->monitor_tag ); … … 1340 1330 || ( newFinished != oldFinished ) 1341 1331 || ( newPriority != oldPriority ) 1342 || tr_strcmp( oldTrackers, newTrackers )1332 || gtr_strcmp0( oldTrackers, newTrackers ) 1343 1333 || gtr_compare_double( newUpSpeed, oldUpSpeed, 3 ) 1344 1334 || gtr_compare_double( newDownSpeed, oldDownSpeed, 3 ) ) … … 1535 1525 const char * oldval = pref_string_get( key ); 1536 1526 1537 if( tr_strcmp( oldval, newval ) )1527 if( gtr_strcmp0( oldval, newval ) ) 1538 1528 { 1539 1529 pref_string_set( key, newval ); -
trunk/gtk/util.c
r11087 r11088 479 479 #endif 480 480 return object; 481 } 482 483 int 484 gtr_strcmp0( const char * str1, const char * str2 ) 485 { 486 #if GLIB_CHECK_VERSION( 2, 16, 0 ) 487 return g_strcmp0( str1, str2 ); 488 #else 489 if( str1 && str2 ) return strcmp( str1, str2 ); 490 if( str1 ) return 1; 491 if( str2 ) return -1; 492 return 0; 493 #endif 481 494 } 482 495 -
trunk/gtk/util.h
r11045 r11088 159 159 gpointer gtr_object_ref_sink( gpointer object ); 160 160 161 /* backwards-comparible wrapper around g_strcmp0() */ 162 int gtr_strcmp0( const char * str1, const char * str2 ); 163 161 164 /*** 162 165 ****
Note: See TracChangeset
for help on using the changeset viewer.