[gimp] Bug 761170 - Warnings building with clang
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 761170 - Warnings building with clang
- Date: Fri, 14 Jul 2017 10:26:49 +0000 (UTC)
commit d315cc1034158cae0d12d9e81557babc550df160
Author: Michael Natterer <mitch gimp org>
Date: Fri Jul 14 12:26:10 2017 +0200
Bug 761170 - Warnings building with clang
Fix clang warnings along with some other minor stuff, no logic changes.
plug-ins/metadata/metadata-editor.c | 6 +++---
plug-ins/metadata/metadata-impexp.c | 10 ++++++++--
plug-ins/metadata/metadata-tags.h | 2 +-
plug-ins/metadata/metadata-xml.c | 25 +++++++++----------------
plug-ins/metadata/metadata-xml.h | 2 +-
5 files changed, 22 insertions(+), 23 deletions(-)
---
diff --git a/plug-ins/metadata/metadata-editor.c b/plug-ins/metadata/metadata-editor.c
index 26be665..4fb21f9 100644
--- a/plug-ins/metadata/metadata-editor.c
+++ b/plug-ins/metadata/metadata-editor.c
@@ -5263,7 +5263,7 @@ metadata_editor_write_callback (GtkWidget *dialog,
alt_d = atof (gtk_entry_get_text (entry));
if (msr == 1)
- alt_d = (alt_d * 12 * 2.54d) / 100;
+ alt_d = (alt_d * 12 * 2.54) / 100;
alt_d *= 10.f;
g_snprintf(alt_str, sizeof (alt_str), "%d/10", (gint) alt_d);
@@ -5716,7 +5716,7 @@ gpsaltsys_combo_callback (GtkComboBoxText *combo,
if (last_gpsaltsys_sel != 0)
{
alt_d = atof (gtk_entry_get_text (GTK_ENTRY (entry)));
- alt_d = (alt_d * (12 * 2.54d)) / 100;
+ alt_d = (alt_d * (12 * 2.54)) / 100;
g_snprintf (alt_str, sizeof (alt_str), "%2f", (float)alt_d);
@@ -5728,7 +5728,7 @@ gpsaltsys_combo_callback (GtkComboBoxText *combo,
if (last_gpsaltsys_sel != 1)
{
alt_d = atof (gtk_entry_get_text (GTK_ENTRY (entry)));
- alt_d = alt_d * 3.28d;
+ alt_d = alt_d * 3.28;
g_snprintf (alt_str, sizeof (alt_str), "%2f", (float)alt_d);
diff --git a/plug-ins/metadata/metadata-impexp.c b/plug-ins/metadata/metadata-impexp.c
index 1b8b00b..343b8e4 100644
--- a/plug-ins/metadata/metadata-impexp.c
+++ b/plug-ins/metadata/metadata-impexp.c
@@ -98,7 +98,7 @@ import_file_metadata(metadata_editor *args)
* ============================================================================
*/
void
-export_file_metadata(metadata_editor *args)
+export_file_metadata (metadata_editor *args)
{
GError *error = NULL;
FILE *file;
@@ -135,6 +135,8 @@ export_file_metadata(metadata_editor *args)
if (!strcmp("single", default_metadata_tags[index].mode) ||
!strcmp("multi", default_metadata_tags[index].mode))
{
+ const gchar *value;
+
value = get_tag_ui_text (args, default_metadata_tags[index].tag,
default_metadata_tags[index].mode);
@@ -176,6 +178,8 @@ export_file_metadata(metadata_editor *args)
if (!strcmp("single", default_metadata_tags[i].mode) ||
!strcmp("multi", default_metadata_tags[i].mode))
{
+ const gchar *value;
+
xmldata = g_strconcat (xmldata, "\t\t<tag-value>", NULL);
value = get_tag_ui_text (args, default_metadata_tags[i].tag,
default_metadata_tags[i].mode);
@@ -191,6 +195,7 @@ export_file_metadata(metadata_editor *args)
else if (!strcmp("combo", default_metadata_tags[i].mode))
{
gint data;
+
xmldata = g_strconcat (xmldata, "\t\t<tag-value>", NULL);
data = get_tag_ui_combo (args, default_metadata_tags[i].tag,
@@ -204,7 +209,8 @@ export_file_metadata(metadata_editor *args)
}
else if (!strcmp("list", default_metadata_tags[i].mode))
{
- gchar* data;
+ gchar *data;
+
xmldata = g_strconcat (xmldata, "\t\t<tag-list-value>\n", NULL);
data = get_tag_ui_list (args, default_metadata_tags[i].tag,
diff --git a/plug-ins/metadata/metadata-tags.h b/plug-ins/metadata/metadata-tags.h
index 74ed450..4806f9a 100644
--- a/plug-ins/metadata/metadata-tags.h
+++ b/plug-ins/metadata/metadata-tags.h
@@ -220,7 +220,7 @@ static const metadata_tag default_metadata_tags[] =
};
-static const metadata_tag const equivalent_metadata_tags[] =
+static const metadata_tag equivalent_metadata_tags[] =
{
{ "Iptc.Application2.DateCreated", "single", 10, TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 0
{ "Iptc.Application2.TransmissionReference", "single", 12, TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 1
diff --git a/plug-ins/metadata/metadata-xml.c b/plug-ins/metadata/metadata-xml.c
index 517378a..53e735f 100644
--- a/plug-ins/metadata/metadata-xml.c
+++ b/plug-ins/metadata/metadata-xml.c
@@ -161,8 +161,11 @@ xml_parser_data (GMarkupParseContext *context,
}
void
-set_tag_ui (metadata_editor *args, int index,
- gchar *name, gchar *value, gchar* mode)
+set_tag_ui (metadata_editor *args,
+ gint index,
+ gchar *name,
+ gchar *value,
+ gchar* mode)
{
GtkWidget *widget;
gchar *value_utf;
@@ -197,11 +200,9 @@ set_tag_ui (metadata_editor *args, int index,
}
else if (!strcmp ("list", mode))
{
- GtkTreePath *path;
GtkTreeModel *treemodel;
GtkListStore *liststore;
GtkTreeIter iter;
- gchar tag[1024];
gint number_of_rows;
gint row;
gint item;
@@ -544,8 +545,10 @@ set_tag_ui (metadata_editor *args, int index,
}
}
-gchar *
-get_tag_ui_text (metadata_editor *args, gchar *name, gchar *mode)
+const gchar *
+get_tag_ui_text (metadata_editor *args,
+ gchar *name,
+ gchar *mode)
{
GObject *object;
@@ -647,8 +650,6 @@ get_tag_ui_list (metadata_editor *args, gchar *name, gchar *mode)
if ((tagdata[row][0] != NULL && strlen(tagdata[row][0]) > 0) ||
(tagdata[row][1] != NULL && strlen(tagdata[row][1]) > 0))
{
- gint types;
-
has_data = TRUE;
xmldata = g_strconcat (xmldata, "\t\t\t<list-element>\n", NULL);
@@ -781,8 +782,6 @@ get_tag_ui_list (metadata_editor *args, gchar *name, gchar *mode)
if ((tagdata[row][0] != NULL && strlen(tagdata[row][0]) > 0))
{
- gint types;
-
has_data = TRUE;
xmldata = g_strconcat (xmldata, "\t\t\t<list-element>\n", NULL);
@@ -800,8 +799,6 @@ get_tag_ui_list (metadata_editor *args, gchar *name, gchar *mode)
if ((tagdata[row][0] != NULL && strlen(tagdata[row][0]) > 0))
{
- gint types;
-
has_data = TRUE;
xmldata = g_strconcat (xmldata, "\t\t\t<list-element>\n", NULL);
@@ -819,8 +816,6 @@ get_tag_ui_list (metadata_editor *args, gchar *name, gchar *mode)
if ((tagdata[row][0] != NULL && strlen(tagdata[row][0]) > 0))
{
- gint types;
-
has_data = TRUE;
xmldata = g_strconcat (xmldata, "\t\t\t<list-element>\n", NULL);
@@ -838,8 +833,6 @@ get_tag_ui_list (metadata_editor *args, gchar *name, gchar *mode)
if ((tagdata[row][0] != NULL && strlen(tagdata[row][0]) > 0))
{
- gint types;
-
has_data = TRUE;
xmldata = g_strconcat (xmldata, "\t\t\t<list-element>\n", NULL);
diff --git a/plug-ins/metadata/metadata-xml.h b/plug-ins/metadata/metadata-xml.h
index 2f59726..f89b03b 100644
--- a/plug-ins/metadata/metadata-xml.h
+++ b/plug-ins/metadata/metadata-xml.h
@@ -51,7 +51,7 @@ set_tag_ui (metadata_editor *args,
gchar *value,
gchar *mode);
-gchar *
+const gchar *
get_tag_ui_text (metadata_editor *args,
gchar *name,
gchar *mode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]