[libgda] gda-util: Avoid warnings about const correctness.



commit 890b23139d7e2a70877bb78e52332880300a1cb4
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Oct 29 21:20:51 2017 +0100

    gda-util: Avoid warnings about const correctness.
    
    It is almost impossible to have const-correct APIs and use of those APIs
    in C, because it doesn't have function overloads based on constness
    and it doesn't have the mutable keyword.

 libgda/gda-util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-util.c b/libgda/gda-util.c
index 9e3bf09..799981e 100644
--- a/libgda/gda-util.c
+++ b/libgda/gda-util.c
@@ -504,9 +504,9 @@ gda_utility_data_model_dump_data_to_xml (GdaDataModel *model, xmlNodePtr parent,
                                        }
                                        else if (G_VALUE_TYPE (value) == GDA_TYPE_BLOB) {
                                                /* force reading the whole blob */
-                                               const GdaBlob *blob = gda_value_get_blob (value);
+                                               GdaBlob *blob = (GdaBlob*)gda_value_get_blob (value);
                                                if (blob) {
-                                                       const GdaBinary *bin = gda_blob_get_binary (blob);
+                                                       GdaBinary *bin = gda_blob_get_binary (blob);
                                                        if (gda_blob_get_op (blob) && 
                                                            (gda_binary_get_size (bin) != 
gda_blob_op_get_length (gda_blob_get_op (blob))))
                                                                gda_blob_op_read_all (gda_blob_get_op (blob), 
(GdaBlob*) blob);


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