[gnome-photos] search-match: Silence -Wformat-nonliteral
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] search-match: Silence -Wformat-nonliteral
- Date: Mon, 13 Apr 2015 11:08:41 +0000 (UTC)
commit a6ec1093410fca1b0f9d7786e27bf5cb1faf4b43
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Apr 1 13:37:08 2015 +0200
search-match: Silence -Wformat-nonliteral
Can't think of a better way than using a #pragma. The filter is the
template used to generate the SPARQL blurb, and term is the text input
by the user. We can't easily turn filter into a string literal because
we have to create multiple SearchMatch instances with different filter
templates. We can't construct a va_list either because our function is
not variadic.
src/photos-search-match.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-search-match.c b/src/photos-search-match.c
index f62f67d..3fee67f 100644
--- a/src/photos-search-match.c
+++ b/src/photos-search-match.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2014 Red Hat, Inc.
+ * Copyright © 2014, 2015 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -59,8 +59,16 @@ photos_search_match_get_filter (PhotosFilterable *iface)
{
PhotosSearchMatch *self = PHOTOS_SEARCH_MATCH (iface);
PhotosSearchMatchPrivate *priv = self->priv;
+ char *ret_val;
- return g_strdup_printf (priv->filter, priv->term);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
+ ret_val = g_strdup_printf (priv->filter, priv->term);
+
+ #pragma GCC diagnostic pop
+
+ return ret_val;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]