From 1ae47c697d547040d5e6cf3b6e7a64f2eea88006 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 23 Jun 2009 14:15:23 +0000 Subject: [PATCH] (trunk) silence some minor gcc warnings --- configure.ac | 4 ++++ gtk/details.c | 2 +- gtk/main.c | 2 +- gtk/tr-core.c | 7 +++---- gtk/tr-prefs.c | 4 ++-- gtk/util.c | 2 +- libtransmission/bencode.c | 2 +- libtransmission/fastresume.c | 4 ++-- libtransmission/port-forwarding.c | 2 +- libtransmission/rpc-server.c | 4 ++-- libtransmission/upnp.c | 2 +- libtransmission/verify.c | 4 ++-- 12 files changed, 21 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index de029ef78..cd55c1aa4 100644 --- a/configure.ac +++ b/configure.ac @@ -298,6 +298,10 @@ if test "x$build_gtk" = "xyes" -a "x$enable_nls" = "xno" ; then AC_MSG_ERROR("The gtk client cannot be built without nls support. Try adding either --enable-nls or --disable-gtk" ) fi +dnl This section is only used for internationalization. +dnl If you don't need translations and this section gives you trouble -- +dnl such as if you're building for a headless system -- +dnl it's okay to tear this section out and re-build the configure script. use_nls=no if test "x$enable_nls" = "xyes" ; then use_nls=yes diff --git a/gtk/details.c b/gtk/details.c index a9a634e86..8d5d1f292 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -499,7 +499,7 @@ options_page_new( struct DetailsImpl * d ) { guint tag; int row; - char *s; + const char *s; GSList *group; GtkWidget *t, *w, *tb, *h; diff --git a/gtk/main.c b/gtk/main.c index d330d0c06..c4650f2c7 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -370,7 +370,7 @@ main( int argc, g_thread_init( NULL ); gerr = NULL; - if( !gtk_init_with_args( &argc, &argv, _( "[torrent files]" ), entries, + if( !gtk_init_with_args( &argc, &argv, (char*)_( "[torrent files]" ), entries, (char*)domain, &gerr ) ) { fprintf( stderr, "%s\n", gerr->message ); diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 5b72152fb..9befb91ba 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -1163,11 +1163,10 @@ gtr_inhibit_hibernation( guint * cookie ) G_TYPE_UINT, cookie, G_TYPE_INVALID ); if( success ) - tr_inf( _( "Disallowing desktop hibernation" ) ); + tr_inf( "%s", _( "Disallowing desktop hibernation" ) ); else { - tr_err( _( - "Couldn't disable desktop hibernation: %s" ), + tr_err( _( "Couldn't disable desktop hibernation: %s" ), error->message ); g_error_free( error ); } @@ -1191,7 +1190,7 @@ gtr_uninhibit_hibernation( guint inhibit_cookie ) G_TYPE_INVALID, G_TYPE_INVALID ); if( success ) - tr_inf( _( "Allowing desktop hibernation" ) ); + tr_inf( "%s", _( "Allowing desktop hibernation" ) ); else { g_warning( "Couldn't uninhibit the system from suspending: %s.", diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index 5b8378ad5..9161ec10b 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -418,9 +418,9 @@ onBlocklistUpdate( GtkButton * w, gpointer gdata ) GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, - _( "Update Blocklist" ) ); + "%s", _( "Update Blocklist" ) ); gtk_widget_set_sensitive( data->updateBlocklistButton, FALSE ); - gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( d ), _( "Getting new blocklist..." ) ); + gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( d ), "%s", _( "Getting new blocklist..." ) ); data->updateBlocklistDialog = d; g_signal_connect( d, "response", G_CALLBACK(onBlocklistUpdateResponse), data ); gtk_widget_show( d ); diff --git a/gtk/util.c b/gtk/util.c index f39c96147..d8712ab3d 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -393,7 +393,7 @@ addTorrentErrorDialog( GtkWidget * child, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - _( "Error opening torrent" ) ); + "%s", _( "Error opening torrent" ) ); gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ), "%s", secondary ); g_signal_connect_swapped( w, "response", diff --git a/libtransmission/bencode.c b/libtransmission/bencode.c index aa433b03d..edcab98bf 100644 --- a/libtransmission/bencode.c +++ b/libtransmission/bencode.c @@ -1055,7 +1055,7 @@ bencWalk( const tr_benc * top, default: /* did caller give us an uninitialized val? */ - tr_err( _( "Invalid metadata" ) ); + tr_err( "%s", _( "Invalid metadata" ) ); break; } } diff --git a/libtransmission/fastresume.c b/libtransmission/fastresume.c index 41324e4a9..1a434ffba 100644 --- a/libtransmission/fastresume.c +++ b/libtransmission/fastresume.c @@ -550,7 +550,7 @@ fastResumeLoadImpl( tr_torrent * tor, if( !buf ) /* %s is the torrent name */ - tr_torinf( tor, _( "Couldn't read resume file" ) ); + tr_torinf( tor, "%s", _( "Couldn't read resume file" ) ); else { const uint8_t * walk = buf; @@ -563,7 +563,7 @@ fastResumeLoadImpl( tr_torrent * tor, ret |= parseVersion1 ( tor, walk, end, fieldsToLoad ); else /* %s is the torrent name */ - tr_torinf( tor, _( "Couldn't read resume file" ) ); + tr_torinf( tor, "%s", _( "Couldn't read resume file" ) ); } tr_free( buf ); diff --git a/libtransmission/port-forwarding.c b/libtransmission/port-forwarding.c index 86c838505..95046a74d 100644 --- a/libtransmission/port-forwarding.c +++ b/libtransmission/port-forwarding.c @@ -163,7 +163,7 @@ stop_timer( tr_shared * s ) static void stop_forwarding( tr_shared * s ) { - tr_ninf( getKey( ), _( "Stopped" ) ); + tr_ninf( getKey( ), "%s", _( "Stopped" ) ); natPulse( s, FALSE ); tr_natpmpClose( s->natpmp ); s->natpmp = NULL; diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c index 094e52c69..89d584ffd 100644 --- a/libtransmission/rpc-server.c +++ b/libtransmission/rpc-server.c @@ -945,10 +945,10 @@ tr_rpcInit( tr_session * session, tr_runInEventThread( session, startServer, s ); if( s->isWhitelistEnabled ) - tr_ninf( MY_NAME, _( "Whitelist enabled" ) ); + tr_ninf( MY_NAME, "%s", _( "Whitelist enabled" ) ); if( s->isPasswordEnabled ) - tr_ninf( MY_NAME, _( "Password required" ) ); + tr_ninf( MY_NAME, "%s", _( "Password required" ) ); } return s; diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c index 72ce3d02c..4e4a07243 100644 --- a/libtransmission/upnp.c +++ b/libtransmission/upnp.c @@ -194,7 +194,7 @@ tr_upnpPulse( tr_upnp * handle, handle->lanaddr, port ); if( handle->isMapped ) { - tr_ninf( getKey( ), _( "Port forwarding successful!" ) ); + tr_ninf( getKey( ), "%s", _( "Port forwarding successful!" ) ); handle->port = port; handle->state = TR_UPNP_IDLE; } diff --git a/libtransmission/verify.c b/libtransmission/verify.c index f9b75c898..9cab00218 100644 --- a/libtransmission/verify.c +++ b/libtransmission/verify.c @@ -209,7 +209,7 @@ verifyThreadFunc( void * unused UNUSED ) tr_free( node ); tr_lockUnlock( getVerifyLock( ) ); - tr_torinf( tor, _( "Verifying torrent" ) ); + tr_torinf( tor, "%s", _( "Verifying torrent" ) ); tr_torrentSetVerifyState( tor, TR_VERIFY_NOW ); changed = verifyTorrent( tor, &stopCurrent ); tr_torrentSetVerifyState( tor, TR_VERIFY_NONE ); @@ -244,7 +244,7 @@ tr_verifyAdd( tr_torrent * tor, { struct verify_node * node; - tr_torinf( tor, _( "Queued for verification" ) ); + tr_torinf( tor, "%s", _( "Queued for verification" ) ); node = tr_new( struct verify_node, 1 ); node->torrent = tor;