[glib/wip/date-time-fixes: 4/5] datetime: Rename g_date_time_printf() to g_date_time_format()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/date-time-fixes: 4/5] datetime: Rename g_date_time_printf() to g_date_time_format()
- Date: Wed, 15 Sep 2010 15:30:48 +0000 (UTC)
commit 1be667041155290bc632fd180821d051da4f0a4a
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Sep 15 14:39:26 2010 +0100
datetime: Rename g_date_time_printf() to g_date_time_format()
The function does not use any printf() modifiers, so using printf() is a
misnomer.
Prior art: strftime, g_ascii_formatd
https://bugzilla.gnome.org/show_bug.cgi?id=50076
glib/gdatetime.c | 8 ++++----
glib/gdatetime.h | 2 +-
glib/tests/gdatetime.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index e5b55c6..7283fce 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -121,10 +121,10 @@
#define MONTH_FULL(d) (get_month_name (g_date_time_get_month (datetime)))
/* Translators: this is the preferred format for expressing the date */
-#define GET_PREFERRED_DATE(d) (g_date_time_printf ((d), C_("GDateTime", "%m/%d/%y")))
+#define GET_PREFERRED_DATE(d) (g_date_time_format ((d), C_("GDateTime", "%m/%d/%y")))
/* Translators: this is the preferred format for expressing the time */
-#define GET_PREFERRED_TIME(d) (g_date_time_printf ((d), C_("GDateTime", "%H:%M:%S")))
+#define GET_PREFERRED_TIME(d) (g_date_time_format ((d), C_("GDateTime", "%H:%M:%S")))
#define SECS_PER_MINUTE (60)
#define SECS_PER_HOUR (60 * SECS_PER_MINUTE)
@@ -2237,7 +2237,7 @@ g_date_time_new_now (void)
}
/**
- * g_date_time_printf:
+ * g_date_time_format:
* @datetime: A #GDateTime
* @format: a valid UTF-8 string, containing the format for the #GDateTime
*
@@ -2293,7 +2293,7 @@ g_date_time_new_now (void)
* Since: 2.26
*/
gchar *
-g_date_time_printf (const GDateTime *datetime,
+g_date_time_format (const GDateTime *datetime,
const gchar *format)
{
GString *outstr;
diff --git a/glib/gdatetime.h b/glib/gdatetime.h
index 53d62d9..727a855 100644
--- a/glib/gdatetime.h
+++ b/glib/gdatetime.h
@@ -192,7 +192,7 @@ gint64 g_date_time_to_epoch (const GDateTime *datet
void g_date_time_to_timeval (const GDateTime *datetime,
GTimeVal *tv);
GDateTime * g_date_time_to_utc (const GDateTime *datetime);
-gchar * g_date_time_printf (const GDateTime *datetime,
+gchar * g_date_time_format (const GDateTime *datetime,
const gchar *format) G_GNUC_MALLOC;
GTimeZone * g_time_zone_new (gint offset,
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index fdd62cf..a51afb0 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -899,21 +899,21 @@ test_GDateTime_printf (void)
#define TEST_PRINTF(f,o) G_STMT_START { \
GDateTime *__dt = g_date_time_new_from_date (2009, 10, 24); \
- gchar *__p = g_date_time_printf (__dt, (f)); \
+ gchar *__p = g_date_time_format (__dt, (f)); \
g_assert_cmpstr (__p, ==, (o)); \
g_date_time_unref (__dt); \
g_free (__p); } G_STMT_END
#define TEST_PRINTF_DATE(y,m,d,f,o) G_STMT_START { \
GDateTime *dt = g_date_time_new_from_date ((y), (m), (d)); \
- gchar *p = g_date_time_printf (dt, (f)); \
+ gchar *p = g_date_time_format (dt, (f)); \
g_assert_cmpstr (p, ==, (o)); \
g_date_time_unref (dt); \
g_free (p); } G_STMT_END
#define TEST_PRINTF_TIME(h,m,s,f,o) G_STMT_START { \
GDateTime *dt = g_date_time_new_full (2009, 10, 24, (h), (m), (s), NULL); \
- gchar *p = g_date_time_printf (dt, (f)); \
+ gchar *p = g_date_time_format (dt, (f)); \
g_assert_cmpstr (p, ==, (o)); \
g_date_time_unref (dt); \
g_free (p); } G_STMT_END
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]