Commit d315cc10 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 761170 - Warnings building with clang

Fix clang warnings along with some other minor stuff, no logic changes.
parent a223ba8f
......@@ -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);
......
......@@ -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,
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment