GDateTime: cosmetics

Don't hide the recursion in g_date_time_format() behind
a macro, make it explicit.
This commit is contained in:
Matthias Clasen 2011-08-21 23:32:28 -04:00
parent 76856241d0
commit 6fae33b10a

View File

@ -158,10 +158,10 @@ struct _GDateTime
#define MONTH_FULL(d) (get_month_name (g_date_time_get_month (datetime))) #define MONTH_FULL(d) (get_month_name (g_date_time_get_month (datetime)))
/* Translators: this is the preferred format for expressing the date */ /* Translators: this is the preferred format for expressing the date */
#define GET_PREFERRED_DATE(d) (g_date_time_format ((d), C_("GDateTime", "%m/%d/%y"))) #define PREFERRED_DATE_FMT C_("GDateTime", "%m/%d/%y")
/* Translators: this is the preferred format for expressing the time */ /* Translators: this is the preferred format for expressing the time */
#define GET_PREFERRED_TIME(d) (g_date_time_format ((d), C_("GDateTime", "%H:%M:%S"))) #define PREFERRED_TIME_FMT C_("GDateTime", "%H:%M:%S")
#define SECS_PER_MINUTE (60) #define SECS_PER_MINUTE (60)
#define SECS_PER_HOUR (60 * SECS_PER_MINUTE) #define SECS_PER_HOUR (60 * SECS_PER_MINUTE)
@ -2314,8 +2314,8 @@ get_numeric_format (gchar *fmt,
* Since: 2.26 * Since: 2.26
*/ */
gchar * gchar *
g_date_time_format (GDateTime *datetime, g_date_time_format (GDateTime *datetime,
const gchar *format) const gchar *format)
{ {
GString *outstr; GString *outstr;
gchar *tmp; gchar *tmp;
@ -2482,14 +2482,14 @@ g_date_time_format (GDateTime *datetime,
break; break;
case 'x': case 'x':
{ {
tmp = GET_PREFERRED_DATE (datetime); tmp = g_date_time_format (datetime, PREFERRED_DATE_FMT);
g_string_append (outstr, tmp); g_string_append (outstr, tmp);
g_free (tmp); g_free (tmp);
} }
break; break;
case 'X': case 'X':
{ {
tmp = GET_PREFERRED_TIME (datetime); tmp = g_date_time_format (datetime, PREFERRED_TIME_FMT);
g_string_append (outstr, tmp); g_string_append (outstr, tmp);
g_free (tmp); g_free (tmp);
} }