[libgda] GdaTimestamp: Use actual type in copy/free functions.



commit 2fe820559c7ebd148da47467909d1301c651673d
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Oct 29 22:19:58 2017 +0100

    GdaTimestamp: Use actual type in copy/free functions.

 libgda/gda-value.c |   27 +++++++++++++--------------
 libgda/gda-value.h |    4 ++--
 2 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index 4669291..3aed672 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -1910,31 +1910,30 @@ gda_timestamp_new_from_values (gushort year, gushort month, gushort day, gushort
  *
  * Returns: (transfer full):
  */
-gpointer
-gda_timestamp_copy (gpointer boxed)
+GdaTimestamp*
+gda_timestamp_copy (GdaTimestamp *ts)
 {
-       GdaTimestamp *src = (GdaTimestamp*) boxed;
        GdaTimestamp *copy;
 
-       g_return_val_if_fail(src, NULL);
+       g_return_val_if_fail(ts, NULL);
 
        copy = gda_timestamp_new ();
-       copy->year = src->year;
-       copy->month = src->month;
-       copy->day = src->day;
-       copy->hour = src->hour;
-       copy->minute = src->minute;
-       copy->second = src->second;
-       copy->fraction = src->fraction;
-       copy->timezone = src->timezone;
+       copy->year = ts->year;
+       copy->month = ts->month;
+       copy->day = ts->day;
+       copy->hour = ts->hour;
+       copy->minute = ts->minute;
+       copy->second = ts->second;
+       copy->fraction = ts->fraction;
+       copy->timezone = ts->timezone;
 
        return copy;
 }
 
 void
-gda_timestamp_free (gpointer boxed)
+gda_timestamp_free (GdaTimestamp *ts)
 {
-       g_free (boxed);
+       g_free (ts);
 }
 
 /**
diff --git a/libgda/gda-value.h b/libgda/gda-value.h
index a0f53dc..17f3bf4 100644
--- a/libgda/gda-value.h
+++ b/libgda/gda-value.h
@@ -283,8 +283,8 @@ gulong                            gda_timestamp_get_fraction (const GdaTimestamp
 void                              gda_timestamp_set_fraction (GdaTimestamp* timestamp, glong fraction);
 glong                             gda_timestamp_get_timezone (const GdaTimestamp* timestamp);
 void                              gda_timestamp_set_timezone (GdaTimestamp* timestamp, glong timezone);
-gpointer                          gda_timestamp_copy (gpointer boxed);
-void                              gda_timestamp_free (gpointer boxed);
+GdaTimestamp                     *gda_timestamp_copy (GdaTimestamp *ts);
+void                              gda_timestamp_free (GdaTimestamp *ts);
 gboolean                          gda_timestamp_valid (const GdaTimestamp *timestamp);
 void                              gda_timestamp_change_timezone (GdaTimestamp *ts, glong ntz);
 const GdaTimestamp               *gda_value_get_timestamp (const GValue *value);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]