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



commit a5c77e9b87383c8f33b922c5ee642501eda7f49f
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Oct 29 21:16:55 2017 +0100

    GdaGeometricPoint: Use actual type in copy/free functions.
    
    As for other boxed types. This is as expected by language bindings
    such as libgdamm, and it is obviously correct.

 libgda/gda-value.c |   15 +++++++--------
 libgda/gda-value.h |    4 ++--
 2 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index 9341b55..4669291 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -915,25 +915,24 @@ gda_geometric_point_get_type (void)
  *
  * Returns: (transfer full):
  */
-gpointer
-gda_geometric_point_copy (gpointer boxed)
+GdaGeometricPoint*
+gda_geometric_point_copy (GdaGeometricPoint *gp)
 {
-       GdaGeometricPoint *val = (GdaGeometricPoint*) boxed;
        GdaGeometricPoint *copy;
 
-       g_return_val_if_fail( val, NULL);
+       g_return_val_if_fail (gp, NULL);
 
        copy = g_new0 (GdaGeometricPoint, 1);
-       copy->x = val->x;
-       copy->y = val->y;
+       copy->x = gp->x;
+       copy->y = gp->y;
 
        return copy;
 }
 
 void
-gda_geometric_point_free (gpointer boxed)
+gda_geometric_point_free (GdaGeometricPoint *gp)
 {
-       g_free (boxed);
+       g_free (gp);
 }
 
 
diff --git a/libgda/gda-value.h b/libgda/gda-value.h
index 746f140..a0f53dc 100644
--- a/libgda/gda-value.h
+++ b/libgda/gda-value.h
@@ -223,8 +223,8 @@ gdouble                           gda_geometric_point_get_x (GdaGeometricPoint*
 void                              gda_geometric_point_set_x (GdaGeometricPoint* gp, double x);
 gdouble                           gda_geometric_point_get_y (GdaGeometricPoint* gp);
 void                              gda_geometric_point_set_y (GdaGeometricPoint* gp, double y);
-gpointer                          gda_geometric_point_copy (gpointer boxed);
-void                              gda_geometric_point_free (gpointer boxed);
+GdaGeometricPoint                *gda_geometric_point_copy (GdaGeometricPoint *gp);
+void                              gda_geometric_point_free (GdaGeometricPoint *gp);
 const GdaGeometricPoint          *gda_value_get_geometric_point (const GValue *value);
 void                              gda_value_set_geometric_point (GValue *value, const GdaGeometricPoint 
*val);
 


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