[gnome-calendar] Use d_ngettext() in printf format directly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] Use d_ngettext() in printf format directly
- Date: Mon, 22 Dec 2014 15:03:13 +0000 (UTC)
commit 45601d39a23bc7fc3402cf1ea0201a3fa182854d
Author: Benjamin Otte <otte redhat com>
Date: Mon Dec 22 15:10:20 2014 +0100
Use d_ngettext() in printf format directly
.. instead of going via an intermediate variable.
This way, gcc is smart enough to detect that the format string is indeed
static and not throw a warning.
src/gcal-month-view.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index bddaf0b..24897d1 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -1207,15 +1207,14 @@ gcal_month_view_draw (GtkWidget *widget,
GList *l;
PangoLayout *overflow_layout;
PangoFontDescription *ofont_desc;
- const gchar *format;
gchar *overflow_str;
gdouble y_value;
l = g_hash_table_lookup (priv->overflow_cells, GINT_TO_POINTER (i));
/* TODO: Warning in some languages this string can be too long and may overlap wit the number */
- format = g_dngettext (GETTEXT_PACKAGE, "Other event", "Other %d events", g_list_length (l));
- overflow_str = g_strdup_printf (format, g_list_length (l));
+ overflow_str = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "Other event", "Other %d events",
g_list_length (l)),
+ g_list_length (l));
gtk_style_context_save (context);
gtk_style_context_add_class (context, "overflow");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]