Remove a lot of pointless g_return_if_fail() checks. (#169859, Morten
authorMatthias Clasen <mclasen@redhat.com>
Fri, 11 Mar 2005 04:10:53 +0000 (04:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 11 Mar 2005 04:10:53 +0000 (04:10 +0000)
2005-03-10  Matthias Clasen  <mclasen@redhat.com>

* glib/gdate.c: Remove a lot of pointless g_return_if_fail()
checks.  (#169859, Morten Welinder)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/gdate.c

index 618d820..918bd8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/gdate.c: Remove a lot of pointless g_return_if_fail()
+       checks.  (#169859, Morten Welinder)
+
 2005-03-10  Sven Neumann  <sven@gimp.org>
 
        * tests/file-test.c: include <gstdio.h>.
index 618d820..918bd8a 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/gdate.c: Remove a lot of pointless g_return_if_fail()
+       checks.  (#169859, Morten Welinder)
+
 2005-03-10  Sven Neumann  <sven@gimp.org>
 
        * tests/file-test.c: include <gstdio.h>.
index 618d820..918bd8a 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/gdate.c: Remove a lot of pointless g_return_if_fail()
+       checks.  (#169859, Morten Welinder)
+
 2005-03-10  Sven Neumann  <sven@gimp.org>
 
        * tests/file-test.c: include <gstdio.h>.
index 618d820..918bd8a 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/gdate.c: Remove a lot of pointless g_return_if_fail()
+       checks.  (#169859, Morten Welinder)
+
 2005-03-10  Sven Neumann  <sven@gimp.org>
 
        * tests/file-test.c: include <gstdio.h>.
index b29524c..b4297a7 100644 (file)
@@ -251,7 +251,6 @@ g_date_update_dmy (const GDate *const_d)
 GDateWeekday 
 g_date_get_weekday (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, G_DATE_BAD_WEEKDAY);
   g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_WEEKDAY);
   
   if (!d->julian) 
@@ -266,7 +265,6 @@ g_date_get_weekday (const GDate *d)
 GDateMonth   
 g_date_get_month (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, G_DATE_BAD_MONTH);
   g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_MONTH);
   
   if (!d->dmy) 
@@ -281,7 +279,6 @@ g_date_get_month (const GDate *d)
 GDateYear    
 g_date_get_year (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, G_DATE_BAD_YEAR);
   g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_YEAR);
   
   if (!d->dmy) 
@@ -296,7 +293,6 @@ g_date_get_year (const GDate *d)
 GDateDay     
 g_date_get_day (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, G_DATE_BAD_DAY);
   g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_DAY);
   
   if (!d->dmy) 
@@ -311,7 +307,6 @@ g_date_get_day (const GDate *d)
 guint32      
 g_date_get_julian (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, G_DATE_BAD_JULIAN);
   g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_JULIAN);
   
   if (!d->julian) 
@@ -328,7 +323,6 @@ g_date_get_day_of_year (const GDate *d)
 {
   gint index;
   
-  g_return_val_if_fail (d != NULL, 0);
   g_return_val_if_fail (g_date_valid (d), 0);
   
   if (!d->dmy) 
@@ -349,7 +343,6 @@ g_date_get_monday_week_of_year (const GDate *d)
   guint day;
   GDate first;
   
-  g_return_val_if_fail (d != NULL, 0);
   g_return_val_if_fail (g_date_valid (d), 0);
   
   if (!d->dmy) 
@@ -375,7 +368,6 @@ g_date_get_sunday_week_of_year (const GDate *d)
   guint day;
   GDate first;
   
-  g_return_val_if_fail (d != NULL, 0);
   g_return_val_if_fail (g_date_valid (d), 0);
   
   if (!d->dmy) 
@@ -411,7 +403,6 @@ g_date_get_iso8601_week_of_year (const GDate *d)
 {
   guint j, d4, L, d1, w;
 
-  g_return_val_if_fail (d != NULL, 0);
   g_return_val_if_fail (g_date_valid (d), 0);
   
   if (!d->julian)
@@ -435,9 +426,6 @@ gint
 g_date_days_between (const GDate *d1,
                     const GDate *d2)
 {
-  g_return_val_if_fail (d1 != NULL, 0);
-  g_return_val_if_fail (d2 != NULL, 0);
-
   g_return_val_if_fail (g_date_valid (d1), 0);
   g_return_val_if_fail (g_date_valid (d2), 0);
 
@@ -445,7 +433,7 @@ g_date_days_between (const GDate *d1,
 }
 
 void         
-g_date_clear (GDate       *d, guint ndates)
+g_date_clear (GDate *d, guint ndates)
 {
   g_return_if_fail (d != NULL);
   g_return_if_fail (ndates != 0);
@@ -1001,7 +989,6 @@ g_date_set_julian (GDate *d, guint32 j)
 gboolean     
 g_date_is_first_of_month (const GDate *d)
 {
-  g_return_val_if_fail (d != NULL, FALSE);
   g_return_val_if_fail (g_date_valid (d), FALSE);
   
   if (!d->dmy) 
@@ -1019,7 +1006,6 @@ g_date_is_last_of_month (const GDate *d)
 {
   gint index;
   
-  g_return_val_if_fail (d != NULL, FALSE);
   g_return_val_if_fail (g_date_valid (d), FALSE);
   
   if (!d->dmy) 
@@ -1037,7 +1023,6 @@ g_date_is_last_of_month (const GDate *d)
 void         
 g_date_add_days (GDate *d, guint ndays)
 {
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->julian)
@@ -1053,7 +1038,6 @@ g_date_add_days (GDate *d, guint ndays)
 void         
 g_date_subtract_days (GDate *d, guint ndays)
 {
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->julian)
@@ -1074,7 +1058,6 @@ g_date_add_months (GDate       *d,
   guint years, months;
   gint index;
   
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->dmy) 
@@ -1108,7 +1091,6 @@ g_date_subtract_months (GDate       *d,
   guint years, months;
   gint index;
   
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->dmy) 
@@ -1146,7 +1128,6 @@ void
 g_date_add_years (GDate       *d, 
                   guint        nyears)
 {
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->dmy) 
@@ -1172,7 +1153,6 @@ void
 g_date_subtract_years (GDate       *d, 
                        guint        nyears)
 {
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   
   if (!d->dmy) 
@@ -1320,7 +1300,6 @@ g_date_to_struct_tm (const GDate *d,
 {
   GDateWeekday day;
      
-  g_return_if_fail (d != NULL);
   g_return_if_fail (g_date_valid (d));
   g_return_if_fail (tm != NULL);
   
@@ -1358,8 +1337,8 @@ g_date_clamp (GDate *date,
              const GDate *min_date,
              const GDate *max_date)
 {
-  g_return_if_fail (date);
   g_return_if_fail (g_date_valid (date));
+
   if (min_date != NULL)
     g_return_if_fail (g_date_valid (min_date));
   if (max_date != NULL)
@@ -1378,8 +1357,6 @@ void
 g_date_order (GDate *date1,
               GDate *date2)
 {
-  g_return_if_fail (date1 != NULL);
-  g_return_if_fail (date2 != NULL);
   g_return_if_fail (g_date_valid (date1));
   g_return_if_fail (g_date_valid (date2));
 
@@ -1408,7 +1385,6 @@ g_date_strftime (gchar       *s,
   GError *error = NULL;
   gsize retval;
 
-  g_return_val_if_fail (d != NULL, 0);
   g_return_val_if_fail (g_date_valid (d), 0);
   g_return_val_if_fail (slen > 0, 0); 
   g_return_val_if_fail (format != 0, 0);