GDateTime: G_GNUC_WARN_UNUSED_RESULT for modifiers
authorRyan Lortie <desrt@desrt.ca>
Sat, 18 Sep 2010 20:31:00 +0000 (16:31 -0400)
committerRyan Lortie <desrt@desrt.ca>
Sat, 18 Sep 2010 20:31:00 +0000 (16:31 -0400)
Emmanuele suggested adding G_GNUC_WARN_UNUSED_RESULT to all of the
g_date_time_add_* functions to help deal with the situation where people
may mistakenly believe that these functions are inplace modifiers.

glib/gdatetime.h

index 8f8533a9ba7d834897800536a49a46608aab0a37..276a170845f12f0555649b32913b09061ab39342 100644 (file)
@@ -131,25 +131,34 @@ GDateTime *             g_date_time_new_utc                             (gint
                                                                          gint            minute,
                                                                          gdouble         seconds);
 
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add                                 (GDateTime      *datetime,
                                                                          GTimeSpan       timespan);
 
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_years                           (GDateTime      *datetime,
                                                                          gint            years);
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_months                          (GDateTime      *datetime,
                                                                          gint            months);
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_weeks                           (GDateTime      *datetime,
                                                                          gint            weeks);
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_days                            (GDateTime      *datetime,
                                                                          gint            days);
 
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_hours                           (GDateTime      *datetime,
                                                                          gint            hours);
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_minutes                         (GDateTime      *datetime,
                                                                          gint            minutes);
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_seconds                         (GDateTime      *datetime,
                                                                          gdouble         seconds);
 
+G_GNUC_WARN_UNUSED_RESULT
 GDateTime *             g_date_time_add_full                            (GDateTime      *datetime,
                                                                          gint            years,
                                                                          gint            months,