[gnac/devel] Code cleanup



commit 6662c60ff3b63cad36261e4c5caab1ee36c6a8d0
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date:   Sat Oct 22 17:43:33 2011 +0100

    Code cleanup

 src/profiles/formats/gnac-profiles-aac.c     |   10 ++++----
 src/profiles/formats/gnac-profiles-flac.c    |    2 +-
 src/profiles/formats/gnac-profiles-lame.c    |   20 ++++++++--------
 src/profiles/formats/gnac-profiles-speex.c   |    8 +++---
 src/profiles/formats/gnac-profiles-unknown.c |    4 +-
 src/profiles/formats/gnac-profiles-vorbis.c  |    8 +++---
 src/profiles/formats/gnac-profiles-wav.c     |    2 +-
 src/profiles/formats/gnac-profiles-wavpack.c |   12 +++++-----
 src/profiles/gnac-profiles-utils.c           |   32 +++++++++++++-------------
 src/profiles/gnac-profiles.c                 |    2 +-
 10 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c
index 89b081f..9d57d97 100755
--- a/src/profiles/formats/gnac-profiles-aac.c
+++ b/src/profiles/formats/gnac-profiles-aac.c
@@ -128,7 +128,7 @@ gnac_profiles_aac_generate_pipeline(GtkWidget *w)
   
   update_text_buffer_call_back(pipeline);
 
-  if (aac_bfi.pipeline != NULL) g_free(aac_bfi.pipeline);
+  g_free(aac_bfi.pipeline);
 
   aac_bfi.pipeline = pipeline;
 }
@@ -168,10 +168,10 @@ gnac_profiles_aac_free_audio_profile(AudioProfileAAC *profile)
 {
   gnac_profiles_utils_free_audio_profile_generic(profile->generic); 
 
-  if (profile->bitrate != NULL) g_free(profile->bitrate);
-  if (profile->outputformat != NULL) g_free(profile->outputformat);
-  if (profile->profile != NULL) g_free(profile->profile);
-  if (profile->tns != NULL) g_free(profile->tns);
+  g_free(profile->bitrate);
+  g_free(profile->outputformat);
+  g_free(profile->profile);
+  g_free(profile->tns);
   g_free(profile);
 }
 
diff --git a/src/profiles/formats/gnac-profiles-flac.c b/src/profiles/formats/gnac-profiles-flac.c
index b92382c..d064eb6 100755
--- a/src/profiles/formats/gnac-profiles-flac.c
+++ b/src/profiles/formats/gnac-profiles-flac.c
@@ -100,7 +100,7 @@ gnac_profiles_flac_generate_pipeline(GtkWidget *w)
   
   update_text_buffer_call_back(pipeline);
 
-  if (flac_bfi.pipeline != NULL) g_free(flac_bfi.pipeline);
+  g_free(flac_bfi.pipeline);
 
   flac_bfi.pipeline = pipeline;
 }
diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c
index b16214f..2b6cbf7 100755
--- a/src/profiles/formats/gnac-profiles-lame.c
+++ b/src/profiles/formats/gnac-profiles-lame.c
@@ -292,7 +292,7 @@ gnac_profiles_lame_generate_pipeline(GtkWidget *w)
       lame_bfi.pipeline_multiplexers);
   update_text_buffer_call_back(pipeline);
 
-  if (lame_bfi.pipeline != NULL) g_free(lame_bfi.pipeline);
+  g_free(lame_bfi.pipeline);
 
   lame_bfi.pipeline = pipeline;
 }
@@ -406,12 +406,12 @@ gnac_profiles_lame_free_audio_profile(AudioProfileLame *profile)
 {
   gnac_profiles_utils_free_audio_profile_generic(profile->generic); 
   
-  if (profile->encoding_mode != NULL) g_free(profile->encoding_mode);
-  if (profile->mode != NULL) g_free(profile->mode);
-  if (profile->bitrate != NULL) g_free(profile->bitrate);
-  if (profile->min_bitrate != NULL) g_free(profile->min_bitrate);
-  if (profile->max_bitrate != NULL) g_free(profile->max_bitrate);
-  if (profile->preset != NULL) g_free(profile->preset);
+  g_free(profile->encoding_mode);
+  g_free(profile->mode);
+  g_free(profile->bitrate);
+  g_free(profile->min_bitrate);
+  g_free(profile->max_bitrate);
+  g_free(profile->preset);
   g_free(profile);
 }
 
@@ -543,9 +543,9 @@ gnac_profiles_lame_save_profile(AudioProfileLame *profile)
 
   /* Cleanup */
   gnac_profiles_xml_engine_free_doc_xpath(doc);
-  if (quality_str != NULL) g_free(quality_str);
-  if (mean_bitrate_str != NULL) g_free(mean_bitrate_str);
-  if (compression_ratio_str != NULL) g_free(compression_ratio_str);
+  g_free(quality_str);
+  g_free(mean_bitrate_str);
+  g_free(compression_ratio_str);
 }
 
 
diff --git a/src/profiles/formats/gnac-profiles-speex.c b/src/profiles/formats/gnac-profiles-speex.c
index bfced70..57e45f1 100644
--- a/src/profiles/formats/gnac-profiles-speex.c
+++ b/src/profiles/formats/gnac-profiles-speex.c
@@ -300,7 +300,7 @@ gnac_profiles_speex_generate_pipeline(GtkWidget *w)
 
   update_text_buffer_call_back(pipeline);
 
-  if (speex_bfi.pipeline != NULL) g_free(speex_bfi.pipeline);
+  g_free(speex_bfi.pipeline);
 
   speex_bfi.pipeline = pipeline;
 }
@@ -430,9 +430,9 @@ gnac_profiles_speex_free_audio_profile(AudioProfileSpeex *profile)
 {
   gnac_profiles_utils_free_audio_profile_generic(profile->generic); 
   
-  if (profile->mode != NULL) g_free(profile->mode);
-  if (profile->vad != NULL) g_free(profile->vad);
-  if (profile->dtx != NULL) g_free(profile->dtx);
+  g_free(profile->mode);
+  g_free(profile->vad);
+  g_free(profile->dtx);
   g_free(profile);
 }
 
diff --git a/src/profiles/formats/gnac-profiles-unknown.c b/src/profiles/formats/gnac-profiles-unknown.c
index 51703e4..f7126d0 100644
--- a/src/profiles/formats/gnac-profiles-unknown.c
+++ b/src/profiles/formats/gnac-profiles-unknown.c
@@ -259,7 +259,7 @@ gnac_profiles_unknown_clean_up(void) {
 
   widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder,
       "properties-alignment"));
-  if (unknown_bfi.pipeline != NULL) g_free(unknown_bfi.pipeline);
+  g_free(unknown_bfi.pipeline);
   g_object_unref(unknown_bfi.builder);
   gtk_widget_destroy(widget);
 }
@@ -287,7 +287,7 @@ gnac_profiles_unknown_text_view_handler(GtkWidget *widget,
   GtkTextIter start;
   GtkTextIter end;
   
-  if (unknown_bfi.pipeline != NULL) g_free(unknown_bfi.pipeline);
+  g_free(unknown_bfi.pipeline);
 
   text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pipeline_text_view));
   gtk_text_buffer_get_start_iter(text_buffer, &start);
diff --git a/src/profiles/formats/gnac-profiles-vorbis.c b/src/profiles/formats/gnac-profiles-vorbis.c
index ac8f902..df251e5 100755
--- a/src/profiles/formats/gnac-profiles-vorbis.c
+++ b/src/profiles/formats/gnac-profiles-vorbis.c
@@ -199,7 +199,7 @@ gnac_profiles_vorbis_generate_pipeline(GtkWidget *w)
       vorbis_bfi.pipeline_multiplexers);
   update_text_buffer_call_back(pipeline);
 
-  if (vorbis_bfi.pipeline != NULL) g_free(vorbis_bfi.pipeline);
+  g_free(vorbis_bfi.pipeline);
 
   vorbis_bfi.pipeline = pipeline;
 }
@@ -285,9 +285,9 @@ gnac_profiles_vorbis_free_audio_profile(AudioProfileVorbis *profile)
 {
   gnac_profiles_utils_free_audio_profile_generic(profile->generic); 
   
-  if (profile->bitrate != NULL) g_free(profile->bitrate);
-  if (profile->min_bitrate != NULL) g_free(profile->min_bitrate);
-  if (profile->max_bitrate != NULL) g_free(profile->max_bitrate);
+  g_free(profile->bitrate);
+  g_free(profile->min_bitrate);
+  g_free(profile->max_bitrate);
   g_free(profile);
 }
 
diff --git a/src/profiles/formats/gnac-profiles-wav.c b/src/profiles/formats/gnac-profiles-wav.c
index 4e2a654..e69fb0c 100755
--- a/src/profiles/formats/gnac-profiles-wav.c
+++ b/src/profiles/formats/gnac-profiles-wav.c
@@ -93,7 +93,7 @@ gnac_profiles_wav_generate_pipeline(GtkWidget *w)
   
   update_text_buffer_call_back(pipeline);
 
-  if (wav_bfi.pipeline != NULL) g_free(wav_bfi.pipeline);
+  g_free(wav_bfi.pipeline);
 
   wav_bfi.pipeline = pipeline;
 }
diff --git a/src/profiles/formats/gnac-profiles-wavpack.c b/src/profiles/formats/gnac-profiles-wavpack.c
index 0251747..aa6a084 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.c
+++ b/src/profiles/formats/gnac-profiles-wavpack.c
@@ -230,7 +230,7 @@ gnac_profiles_wavpack_generate_pipeline(GtkWidget *w)
 
   update_text_buffer_call_back(pipeline);
 
-  if (wavpack_bfi.pipeline != NULL) g_free(wavpack_bfi.pipeline);
+  g_free(wavpack_bfi.pipeline);
 
   wavpack_bfi.pipeline = pipeline;
 }
@@ -358,9 +358,9 @@ gnac_profiles_wavpack_free_audio_profile(AudioProfileWavpack *profile)
 {
   gnac_profiles_utils_free_audio_profile_generic(profile->generic); 
   
-  if (profile->mode != NULL) g_free(profile->mode);
-  if (profile->joint_stereo_mode != NULL) g_free(profile->joint_stereo_mode);
-  if (profile->md5 != NULL) g_free(profile->md5);
+  g_free(profile->mode);
+  g_free(profile->joint_stereo_mode);
+  g_free(profile->md5);
   g_free(profile);
 }
 
@@ -455,8 +455,8 @@ gnac_profiles_wavpack_save_profile(AudioProfileWavpack *profile)
 
   /* Cleanup */
   gnac_profiles_xml_engine_free_doc_xpath(doc);
-  if (bitrate_str != NULL) g_free(bitrate_str);
-  if (bits_per_sample_str != NULL) g_free(bits_per_sample_str);
+  g_free(bitrate_str);
+  g_free(bits_per_sample_str);
   g_free(extra_processing_str);
 }
 
diff --git a/src/profiles/gnac-profiles-utils.c b/src/profiles/gnac-profiles-utils.c
index 792dbdf..78aef1e 100755
--- a/src/profiles/gnac-profiles-utils.c
+++ b/src/profiles/gnac-profiles-utils.c
@@ -1103,14 +1103,14 @@ gnac_profiles_utils_allocate_audio_profile_generic(void)
 void
 gnac_profiles_utils_free_audio_profile_generic(AudioProfileGeneric *profile)
 {
-  if (profile->name != NULL) g_free(profile->name);
-  if (profile->description != NULL) g_free(profile->description);
-  if (profile->format_id != NULL) g_free(profile->format_id);
-  if (profile->format_name != NULL) g_free(profile->format_name);
-  if (profile->extension != NULL) g_free(profile->extension);
-  if (profile->pipeline != NULL) g_free(profile->pipeline);
-  if (profile->rate != NULL) g_free(profile->rate);
-  if (profile->channels != NULL) g_free(profile->channels);
+  g_free(profile->name);
+  g_free(profile->description);
+  g_free(profile->format_id);
+  g_free(profile->format_name);
+  g_free(profile->extension);
+  g_free(profile->pipeline);
+  g_free(profile->rate);
+  g_free(profile->channels);
   g_free(profile);
 }
 
@@ -1120,14 +1120,14 @@ gnac_profiles_utils_free_basic_format_info_content(BasicFormatInfo *bfi)
 {
   g_object_unref(bfi->builder);
   if (bfi->doc != NULL) gnac_profiles_xml_engine_free_doc_xpath(bfi->doc);
-  if (bfi->pipeline != NULL) g_free(bfi->pipeline);
-  if (bfi->pipeline_encoder != NULL) g_free(bfi->pipeline_encoder);
-  if (bfi->pipeline_multiplexers != NULL) g_free(bfi->pipeline_multiplexers);
-  if (bfi->format_id != NULL) g_free(bfi->format_id);
-  if (bfi->format_plugin_name != NULL) g_free(bfi->format_plugin_name);
-  if (bfi->format_name != NULL) g_free(bfi->format_name);
-  if (bfi->file_extension != NULL) g_free(bfi->file_extension);
-  if (bfi->description != NULL) g_free(bfi->description);
+  g_free(bfi->pipeline);
+  g_free(bfi->pipeline_encoder);
+  g_free(bfi->pipeline_multiplexers);
+  g_free(bfi->format_id);
+  g_free(bfi->format_plugin_name);
+  g_free(bfi->format_name);
+  g_free(bfi->file_extension);
+  g_free(bfi->description);
 }
 
 
diff --git a/src/profiles/gnac-profiles.c b/src/profiles/gnac-profiles.c
index f42dfea..97fef1b 100755
--- a/src/profiles/gnac-profiles.c
+++ b/src/profiles/gnac-profiles.c
@@ -243,7 +243,7 @@ gnac_profiles_populate_combo(void)
   }
 
   /* Cleanup */
-  if (active_text != NULL) g_free(active_text);
+  g_free(active_text);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]