[easytag/wip/ax-compile-warnings: 9/12] Fix const correctness warnings
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/ax-compile-warnings: 9/12] Fix const correctness warnings
- Date: Tue, 3 Feb 2015 23:26:36 +0000 (UTC)
commit 769dec55be974923ff40c172f0ffbc2ab48b949d
Author: David King <amigadave amigadave com>
Date: Fri Jan 30 14:10:57 2015 +0000
Fix const correctness warnings
src/file_area.c | 21 +++++++++++++--------
src/scan_dialog.c | 6 ++++--
src/tag_area.c | 4 ++--
src/tags/ogg_header.c | 2 +-
4 files changed, 20 insertions(+), 13 deletions(-)
---
diff --git a/src/file_area.c b/src/file_area.c
index dddc311..30eb8f9 100644
--- a/src/file_area.c
+++ b/src/file_area.c
@@ -58,7 +58,7 @@ struct _EtFileAreaPrivate
static void
on_file_show_header_changed (EtFileArea *self,
- gchar *key,
+ const gchar *key,
GSettings *settings)
{
EtFileAreaPrivate *priv;
@@ -184,26 +184,31 @@ et_file_area_clear (EtFileArea *self)
{
EtFileAreaPrivate *priv;
EtFileHeaderFields fields;
+ gchar *empty_str;
g_return_if_fail (ET_FILE_AREA (self));
priv = et_file_area_get_instance_private (self);
+ empty_str = g_strdup ("");
+
/* Default values are MPEG data. */
fields.description = _("File");
fields.version_label = _("Encoder:");
- fields.version = "";
- fields.bitrate = "";
- fields.samplerate = "";
+ fields.version = empty_str;
+ fields.bitrate = empty_str;
+ fields.samplerate = empty_str;
fields.mode_label = _("Mode:");
- fields.mode = "";
- fields.size = "";
- fields.duration = "";
+ fields.mode = empty_str;
+ fields.size = empty_str;
+ fields.duration = empty_str;
et_file_area_set_header_fields (self, &fields);
- gtk_entry_set_text (GTK_ENTRY (priv->name_entry), "");
+ gtk_entry_set_text (GTK_ENTRY (priv->name_entry), empty_str);
gtk_label_set_text (GTK_LABEL (priv->index_label), "0/0:");
+
+ g_free (empty_str);
}
void
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index fcf4b3f..7c58eb5 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -1579,7 +1579,9 @@ Scan_Process_Fields (EtScanDialog *self, ET_File *ETFile)
* Function when you select an item of the option menu
*/
static void
-on_scan_mode_changed (EtScanDialog *self, gchar *key, GSettings *settings)
+on_scan_mode_changed (EtScanDialog *self,
+ const gchar *key,
+ GSettings *settings)
{
EtScanDialogPrivate *priv;
EtScanMode mode;
@@ -1827,7 +1829,7 @@ Process_Fields_First_Letters_Check_Button_Toggled (EtScanDialog *self)
*/
static void
on_process_fields_changed (EtScanDialog *self,
- gchar *key,
+ const gchar *key,
GSettings *settings)
{
EtScanDialogPrivate *priv;
diff --git a/src/tag_area.c b/src/tag_area.c
index 9ef3ce5..cb452a8 100644
--- a/src/tag_area.c
+++ b/src/tag_area.c
@@ -2107,8 +2107,8 @@ create_tag_area (EtTagArea *self)
GtkBuilder *builder;
GError *error = NULL;
- /* For Picture. */
- static const GtkTargetEntry drops[] = { { "text/uri-list", 0,
+ /* For Picture. Ignore const string warning. */
+ static const GtkTargetEntry drops[] = { { (gchar *)"text/uri-list", 0,
TARGET_URI_LIST } };
GtkTreeSelection *selection;
diff --git a/src/tags/ogg_header.c b/src/tags/ogg_header.c
index beb585b..ed601ef 100644
--- a/src/tags/ogg_header.c
+++ b/src/tags/ogg_header.c
@@ -274,7 +274,7 @@ et_ogg_header_read_file_info (GFile *file,
message = _("Internal logic fault, indicates a bug or heap/stack corruption");
break;
default:
- message = "";
+ message = _("Error reading tags from file");
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]