diff options
author | jstebbins <[email protected]> | 2012-05-26 08:58:22 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-05-26 08:58:22 +0000 |
commit | 776795b2995044dc92b02e10155fff2644776fe3 (patch) | |
tree | adb7de1cff613148b41bdd7195cb634540ddc5ea /gtk | |
parent | 89b5fd2675d556414ea988408193b8e21a63f159 (diff) |
LinGui: fix a bunch of compiler warnings
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4701 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/audiohandler.c | 12 | ||||
-rw-r--r-- | gtk/src/audiohandler.h | 2 | ||||
-rw-r--r-- | gtk/src/callbacks.c | 13 | ||||
-rw-r--r-- | gtk/src/ghbcompositor.c | 8 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 15 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 4 | ||||
-rw-r--r-- | gtk/src/icons.c | 2 | ||||
-rw-r--r-- | gtk/src/main.c | 2 | ||||
-rw-r--r-- | gtk/src/presets.c | 6 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 2 | ||||
-rw-r--r-- | gtk/src/renderer_button.c | 3 | ||||
-rw-r--r-- | gtk/src/subtitlehandler.c | 8 |
12 files changed, 21 insertions, 56 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 5a9169cc5..f2940bb81 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -190,7 +190,6 @@ ghb_sanitize_audio(GValue *settings, GValue *asettings) gint fallback = ghb_select_fallback(settings, mux, acodec); gint copy_mask = ghb_get_copy_mask(settings); select_acodec = ghb_select_audio_codec(mux, aconfig, acodec, fallback, copy_mask); - gboolean codec_defined_bitrate = FALSE; if (ghb_audio_is_passthru (select_acodec)) { if (aconfig) @@ -202,7 +201,6 @@ ghb_sanitize_audio(GValue *settings, GValue *asettings) ghb_settings_set_string(asettings, "AudioMixdown", ghb_lookup_combo_string("AudioMixdown", ghb_int_value(mix))); select_acodec &= aconfig->in.codec | HB_ACODEC_PASS_FLAG; - codec_defined_bitrate = TRUE; ghb_settings_set_string(asettings, "AudioSamplerate", ghb_lookup_combo_string("AudioSamplerate", ghb_int_value(0))); } @@ -336,11 +334,11 @@ free_audio_hash_key_value(gpointer data) g_free(data); } -gchar* +const gchar* ghb_get_user_audio_lang(GValue *settings, gint titleindex, gint track) { GValue *audio_list, *asettings; - gchar *lang; + const gchar *lang; audio_list = ghb_settings_get_value(settings, "audio_list"); if (ghb_array_len(audio_list) <= track) @@ -541,7 +539,6 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) { const gchar *track, *codec, *br, *sr, *mix; gchar *s_drc, *s_gain, *s_quality = NULL; - gint itrack; gdouble drc, gain; // Get the row number treepath = gtk_tree_model_get_path (store, &iter); @@ -556,7 +553,6 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) asettings = ghb_array_get_nth(audio_list, row); track = ghb_settings_combo_option(asettings, "AudioTrack"); - itrack = ghb_settings_combo_int(asettings, "AudioTrack"); codec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && @@ -615,7 +611,6 @@ ghb_audio_list_refresh(signal_user_data_t *ud) { const gchar *track, *codec, *br, *sr, *mix; gchar *s_drc, *s_gain, *s_quality = NULL; - gint itrack; gdouble drc, gain; GValue *asettings; @@ -625,7 +620,6 @@ ghb_audio_list_refresh(signal_user_data_t *ud) asettings = ghb_array_get_nth(audio_list, row); track = ghb_settings_combo_option(asettings, "AudioTrack"); - itrack = ghb_settings_combo_int(asettings, "AudioTrack"); codec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && @@ -1014,7 +1008,6 @@ ghb_add_audio_to_ui(GtkBuilder *builder, const GValue *settings) GtkTreeSelection *selection; const gchar *track, *codec, *br, *sr, *mix; gchar *s_drc, *s_gain, *s_quality = NULL; - gint itrack; gdouble drc; gdouble gain; @@ -1024,7 +1017,6 @@ ghb_add_audio_to_ui(GtkBuilder *builder, const GValue *settings) store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview)); track = ghb_settings_combo_option(settings, "AudioTrack"); - itrack = ghb_settings_combo_int(settings, "AudioTrack"); codec = ghb_settings_combo_option(settings, "AudioEncoderActual"); double quality = ghb_settings_get_double(settings, "AudioTrackQuality"); if (ghb_settings_get_boolean(settings, "AudioTrackQualityEnable") && diff --git a/gtk/src/audiohandler.h b/gtk/src/audiohandler.h index de0346225..0a3f98c3f 100644 --- a/gtk/src/audiohandler.h +++ b/gtk/src/audiohandler.h @@ -31,7 +31,7 @@ void ghb_adjust_audio_rate_combos(signal_user_data_t *ud); void ghb_set_pref_audio_settings(gint titleindex, GValue *settings); void ghb_set_pref_audio_from_settings(signal_user_data_t *ud, GValue *settings); void ghb_set_audio(signal_user_data_t *ud, GValue *settings); -gchar* ghb_get_user_audio_lang(GValue *settings, gint titleindex, gint track); +const gchar* ghb_get_user_audio_lang(GValue *settings, gint titleindex, gint track); void ghb_audio_list_refresh_selected(signal_user_data_t *ud); gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint fallback_acodec, gint copy_mask); int ghb_get_copy_mask(GValue *settings); diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index a3b71ebb0..5173a6b29 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2081,11 +2081,10 @@ G_MODULE_EXPORT void prefs_dialog_cb(GtkWidget *xwidget, signal_user_data_t *ud) { GtkWidget *dialog; - GtkResponseType response; g_debug("prefs_dialog_cb ()"); dialog = GHB_WIDGET(ud->builder, "prefs_dialog"); - response = gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_hide(dialog); } @@ -2232,15 +2231,14 @@ void ghb_error_dialog(GtkMessageType type, const gchar *message, const gchar *cancel) { GtkWidget *dialog; - GtkResponseType response; - + // Toss up a warning dialog dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, type, GTK_BUTTONS_NONE, "%s", message); gtk_dialog_add_buttons( GTK_DIALOG(dialog), cancel, GTK_RESPONSE_CANCEL, NULL); - response = gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); } @@ -5048,13 +5046,10 @@ notify_closed_cb(NotifyNotification *notification, signal_user_data_t *ud) void ghb_notify_done(signal_user_data_t *ud) { - GtkStatusIcon *si; if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 0) return; - si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); - #if !defined(_WIN32) NotifyNotification *notification; notification = notify_notification_new( @@ -5065,6 +5060,8 @@ ghb_notify_done(signal_user_data_t *ud) ); #else ,NULL); + + GtkStatusIcon *si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); notify_notification_attach_to_status_icon(notification, si); #endif g_signal_connect(notification, "closed", (GCallback)notify_closed_cb, ud); diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c index 93f533c3c..48ad9c400 100644 --- a/gtk/src/ghbcompositor.c +++ b/gtk/src/ghbcompositor.c @@ -139,10 +139,6 @@ ghb_compositor_get_property ( GValue *value, GParamSpec *pspec) { - GhbCompositor *compositor; - - compositor = GHB_COMPOSITOR (object); - switch (prop_id) { default: @@ -158,10 +154,6 @@ ghb_compositor_set_property ( const GValue *value, GParamSpec *pspec) { - GhbCompositor *compositor; - - compositor = GHB_COMPOSITOR (object); - switch (prop_id) { default: diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 52e94b9f3..2594d3d9a 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1469,7 +1469,7 @@ done: return name; } -gchar* +const gchar* ghb_subtitle_track_lang(GValue *settings, gint track) { gint titleindex; @@ -1929,10 +1929,6 @@ srt_codeset_opts_set(GtkBuilder *builder, const gchar *name) 4, srt_codeset_table[ii], -1); } - GtkComboBoxEntry *cbe; - - cbe = GTK_COMBO_BOX_ENTRY(GHB_WIDGET(builder, name)); - //gtk_combo_box_entry_set_text_column(cbe, 0); } static void @@ -2348,13 +2344,13 @@ ghb_longest_title() return titleindex; } -gchar* +const gchar* ghb_get_source_audio_lang(gint titleindex, gint track) { hb_list_t * list; hb_title_t * title; hb_audio_config_t * audio; - gchar *lang = "und"; + const gchar *lang = "und"; g_debug("ghb_lookup_1st_audio_lang ()\n"); if (h_scan == NULL) @@ -4170,12 +4166,11 @@ ghb_validate_filter_string(const gchar *str, gint max_fields) { gint fields = 0; gchar *end; - gdouble val; if (str == NULL || *str == 0) return TRUE; while (*str) { - val = g_strtod(str, &end); + g_strtod(str, &end); if (str != end) { // Found a numeric value fields++; @@ -4616,7 +4611,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) hb_job_t * job; static gchar *advanced_opts; gint sub_id = 0; - gboolean tweaks = FALSE; hb_filter_object_t * filter; gchar *filter_str; gchar *dest_str = NULL; @@ -4645,7 +4639,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) job->pts_to_stop = ghb_settings_get_int(js, "live_duration") * 90000LL; } - tweaks = ghb_settings_get_boolean(js, "allow_tweaks"); job->mux = ghb_settings_combo_int(js, "FileFormat"); if (job->mux == HB_MUX_MP4) { diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 22f3f6770..e1ff28a75 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -141,7 +141,7 @@ void ghb_set_bitrate_opts( void ghb_grey_combo_options(signal_user_data_t *ud); void ghb_update_ui_combo_box( signal_user_data_t *ud, const gchar *name, gint user_data, gboolean all); -gchar* ghb_get_source_audio_lang(gint titleindex, gint track); +const gchar* ghb_get_source_audio_lang(gint titleindex, gint track); gint ghb_find_audio_track( gint titleindex, const gchar *lang, gint acodec, gint fallback_acodec, GHashTable *track_indices); @@ -163,7 +163,7 @@ gint ghb_get_title_number(gint titleindex); int ghb_get_title_count(); gint ghb_subtitle_track_source(GValue *settings, gint track); const char* ghb_subtitle_track_source_name(GValue *settings, gint track); -gchar* ghb_subtitle_track_lang(GValue *settings, gint track); +const gchar* ghb_subtitle_track_lang(GValue *settings, gint track); gboolean ghb_validate_vquality(GValue *settings); gboolean ghb_validate_audio(GValue *settings); diff --git a/gtk/src/icons.c b/gtk/src/icons.c index 2fec1540e..a99deba03 100644 --- a/gtk/src/icons.c +++ b/gtk/src/icons.c @@ -36,6 +36,6 @@ ghb_load_icons() NULL, NULL); size = gdk_pixbuf_get_height(pb); gtk_icon_theme_add_builtin_icon(name, size, pb); - gdk_pixbuf_unref(pb); + g_object_unref(pb); } } diff --git a/gtk/src/main.c b/gtk/src/main.c index 86aa4515b..eede9b2ac 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -221,11 +221,9 @@ bind_chapter_tree_model (signal_user_data_t *ud) GtkTreeViewColumn *column; GtkListStore *treestore; GtkTreeView *treeview; - GtkTreeSelection *selection; g_debug("bind_chapter_tree_model ()\n"); treeview = GTK_TREE_VIEW(GHB_WIDGET (ud->builder, "chapters_list")); - selection = gtk_tree_view_get_selection (treeview); treestore = gtk_list_store_new(4, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore)); diff --git a/gtk/src/presets.c b/gtk/src/presets.c index d1eb0333f..56b9466e5 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1171,7 +1171,7 @@ ghb_write_pid_file() gchar *config, *path; pid_t pid; FILE *fp; - int fd, lock; + int fd; pid = getpid(); @@ -1183,7 +1183,7 @@ ghb_write_pid_file() fclose(fp); fd = open(path, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR); - lock = lockf(fd, F_TLOCK, 0); + lockf(fd, F_TLOCK, 0); g_free(config); g_free(path); @@ -2512,7 +2512,6 @@ import_value_xlat(GValue *dict) GValue *sdeflist; - GValue *sdefaults; GValue *slist; GValue *sdict; gint count, ii; @@ -2523,7 +2522,6 @@ import_value_xlat(GValue *dict) slist = ghb_dict_lookup(dict, "SubtitleList"); if (slist) { - sdefaults = ghb_array_get_nth(sdeflist, 0); count = ghb_array_len(slist); for (ii = 0; ii < count; ii++) { diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 978b1ec2b..3dcd54297 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -74,7 +74,6 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) gint source_width, source_height; gboolean pass2 = FALSE, keep_aspect, vqtype, turbo; gint pic_par; - gboolean tweaks; gchar *escape, *escape2; g_debug("update_queue_list ()"); @@ -82,7 +81,6 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "queue_list")); store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview)); - tweaks = ghb_settings_get_boolean(settings, "allow_tweaks"); title = ghb_settings_get_int(settings, "titlenum"); start_point = ghb_settings_get_int(settings, "start_point"); end_point = ghb_settings_get_int(settings, "end_point"); diff --git a/gtk/src/renderer_button.c b/gtk/src/renderer_button.c index c4df21ab3..c7e28f1ed 100644 --- a/gtk/src/renderer_button.c +++ b/gtk/src/renderer_button.c @@ -204,10 +204,7 @@ custom_cell_renderer_button_activate (GtkCellRenderer *cell, GdkRectangle *cell_area, GtkCellRendererState flags) { - CustomCellRendererButton *cellbutton; - g_debug("custom_cell_renderer_button_activate ()\n"); - cellbutton = CUSTOM_CELL_RENDERER_BUTTON (cell); g_signal_emit (cell, button_cell_signals[CLICKED], 0, path); return TRUE; } diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index fee75f75b..bf393f08c 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -325,7 +325,6 @@ add_all_pref_subtitles(signal_user_data_t *ud) for (ii = 0; ii < count; ii++) { subtitle = ghb_value_dup(ghb_array_get_nth(pref_subtitle, ii)); - gboolean force = ghb_settings_get_boolean(subtitle, "SubtitleForced"); lang = ghb_settings_get_string(subtitle, "SubtitleLanguage"); // If there are multiple subtitles using the same language, then // select sequential tracks for each. The hash keeps track @@ -355,7 +354,7 @@ ghb_set_pref_subtitle_settings(gint titleindex, GValue *settings) gint track; GHashTable *track_indices; gchar *lang, *pref_lang = NULL; - gchar *audio_lang; + const gchar *audio_lang; gint foreign_lang_index = -1; gboolean found_cc = FALSE; @@ -416,11 +415,12 @@ ghb_set_pref_subtitle_settings(gint titleindex, GValue *settings) g_free(lang); if (track >= -1) { + const gchar *track_lang; GValue *dup = ghb_value_dup(subtitle); - lang = ghb_subtitle_track_lang(settings, track); + track_lang = ghb_subtitle_track_lang(settings, track); ghb_settings_set_int(dup, "SubtitleTrack", track); if (foreign_lang_index < 0 && pref_lang != NULL && - strcmp(lang, pref_lang) == 0) + strcmp(track_lang, pref_lang) == 0) { foreign_lang_index = jj; ghb_settings_take_value(dup, "SubtitleForced", |