[libgda] Removing warnings on libgda



commit 0c9f5b7190caf1ca373b0d9674585e383da7a15e
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Jul 26 18:31:58 2018 -0500

    Removing warnings on libgda
    
    Changed LDAP provider's GType mapping

 libgda/gda-transaction-status.c          |   1 +
 libgda/sqlite/mkkeywordhash.c            |   2 +-
 providers/ldap/gda-ldap-util.c           | 182 ++++++++++++++++++++-----------
 providers/ldap/gda-ldap-util.h           |   1 +
 providers/ldap/gdaprov-data-model-ldap.c |  12 +-
 5 files changed, 129 insertions(+), 69 deletions(-)
---
diff --git a/libgda/gda-transaction-status.c b/libgda/gda-transaction-status.c
index ddfaccfa0..0dbe25eb1 100644
--- a/libgda/gda-transaction-status.c
+++ b/libgda/gda-transaction-status.c
@@ -138,6 +138,7 @@ gda_transaction_status_event_copy (GdaTransactionStatusEvent *src) {
        cp->pl.sql = g_strdup (src->pl.sql);
        cp->pl.sub_trans = src->pl.sub_trans;
        cp->conn_event = src->conn_event;
+  return cp;
 }
 void
 gda_transaction_status_event_free (GdaTransactionStatusEvent *te) {
diff --git a/libgda/sqlite/mkkeywordhash.c b/libgda/sqlite/mkkeywordhash.c
index 5c6276f4e..9ff61259e 100644
--- a/libgda/sqlite/mkkeywordhash.c
+++ b/libgda/sqlite/mkkeywordhash.c
@@ -261,7 +261,7 @@ main (int argc, char **argv)
        for(i=0; i<nKeyword; i++){
                Keyword *p = &aKeywordTable[i];
                p->len = strlen(p->zName);
-               assert( p->len<sizeof(p->zOrigName) );
+               assert( (uint) p->len < sizeof(p->zOrigName) );
                strcpy(p->zOrigName, p->zName);
                totalLen += p->len;
                p->hash = (UpperToLower[(int)p->zName[0]]*4) ^
diff --git a/providers/ldap/gda-ldap-util.c b/providers/ldap/gda-ldap-util.c
index da2c06641..55502aecf 100644
--- a/providers/ldap/gda-ldap-util.c
+++ b/providers/ldap/gda-ldap-util.c
@@ -59,235 +59,293 @@ ldap_class_free (GdaLdapClass *lcl)
 static LdapAttrType ldap_types [] = {
        { "1.3.6.1.4.1.1466.115.121.1.1",
          "ACI Item",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.2",
          "Access Point",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.3",
          "Attribute Type Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.4",
          "Audio",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.5",
          "Binary",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.6",
          "Bit String",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.7",
          "Boolean",
-         G_TYPE_BOOLEAN
+         G_TYPE_BOOLEAN,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.8",
          "Certificate",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.9",
          "Certificate List",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.10",
          "Certificate Pair",
-         -1 /*GDA_TYPE_BINARY*/,
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/,
        },
        { "1.3.6.1.4.1.1466.115.121.1.11",
          "Country String",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.12",
          "DN",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.13",
          "Data Quality Syntax",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.14",
          "Delivery Method",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.15",
          "Directory String",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.16",
          "DIT Content Rule Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.17",
          "DIT Structure Rule Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.18",
          "DL Submit Permission",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.19",
          "DSA Quality Syntax",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.20",
          "DSE Type",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.21",
          "Enhanced Guide",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.22",
          "Facsimile Telephone Number",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.23",
          "Fax",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.24",
          "Generalized Time",
-         -4 /*G_TYPE_DATE_TIME*/
+         G_TYPE_NONE,
+    -4 /*G_TYPE_DATE_TIME*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.25",
          "Guide",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.26",
          "IA5 String",
-         G_TYPE_STRING /* as ASCII */
+         G_TYPE_STRING, /* as ASCII */
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.27",
          "INTEGER",
-         G_TYPE_INT
+         G_TYPE_INT,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.28",
          "JPEG",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.29",
          "Master And Shadow Access Points",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.30",
          "Matching Rule Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.31",
          "Matching Rule Use Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.32",
          "Mail Preference",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.33",
          "MHS OR Address",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.34",
          "Name And Optional UID",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.35",
          "Name Form Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.36",
          "Numeric String",
-         -3 /*GDA_TYPE_NUMERIC*/
+         G_TYPE_NONE,
+    -3 /*GDA_TYPE_NUMERIC*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.37",
          "Object Class Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.38",
          "OID",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.39",
          "Other Mailbox",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.40",
          "Octet String",
-         -1 /*GDA_TYPE_BINARY*/
+         G_TYPE_NONE,
+    -1 /*GDA_TYPE_BINARY*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.41",
          "Postal Address",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.42",
          "Protocol Information",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.43",
          "Presentation Address",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.44",
          "Printable String",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.45",
          "Subtree Specification",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.46",
          "Supplier Information",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.47",
          "Supplier Or Consumer",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.48",
          "Supplier And Consumer",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.49",
          "Supported Algorithm",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.50",
          "Telephone Number",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.51",
          "Teletex Terminal Identifier",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.52",
          "Telex Number",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.53",
          "UTC Time",
-         -2 /*GDA_TYPE_TIME*/
+         G_TYPE_NONE,
+    -2 /*GDA_TYPE_TIME*/
        },
        { "1.3.6.1.4.1.1466.115.121.1.54",
          "LDAP Syntax Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.55",
          "Modify Rights",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.56",
          "LDAP Schema Definition",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.57",
          "LDAP Schema Description",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        },
        { "1.3.6.1.4.1.1466.115.121.1.58",
          "Substring Assertion",
-         G_TYPE_STRING
+         G_TYPE_STRING,
+    0
        }
 };
 
@@ -316,13 +374,13 @@ gda_ldap_get_type_info (const gchar *oid)
                for (i = 0; i < nb; i++) {
                        LdapAttrType *type;
                        type = & (ldap_types[i]);
-                       if (type->gtype == -1)
+                       if (g_type_is_a (type->gtype, G_TYPE_NONE) && type->gtype_custom == -1)
                                type->gtype = GDA_TYPE_BINARY;
-                       else if (type->gtype == -2)
+                       else if (g_type_is_a (type->gtype, G_TYPE_NONE) && type->gtype_custom == -2)
                                type->gtype = GDA_TYPE_TIME;
-                       else if (type->gtype == -3)
+                       else if (g_type_is_a (type->gtype, G_TYPE_NONE) && type->gtype_custom == -3)
                                type->gtype = GDA_TYPE_NUMERIC;
-                       else if (type->gtype == -4)
+                       else if (g_type_is_a (type->gtype, G_TYPE_NONE) && type->gtype_custom == -4)
                                type->gtype = G_TYPE_DATE_TIME;
                        g_hash_table_insert (hash, type->oid, type);
                }
diff --git a/providers/ldap/gda-ldap-util.h b/providers/ldap/gda-ldap-util.h
index 244e431c3..02001a3a5 100644
--- a/providers/ldap/gda-ldap-util.h
+++ b/providers/ldap/gda-ldap-util.h
@@ -35,6 +35,7 @@ typedef struct {
        gchar *oid;
        gchar *descr;
        GType  gtype;
+  gint  gtype_custom;
 } LdapAttrType;
 
 typedef struct {
diff --git a/providers/ldap/gdaprov-data-model-ldap.c b/providers/ldap/gdaprov-data-model-ldap.c
index 67073a739..33fe6f4ab 100644
--- a/providers/ldap/gdaprov-data-model-ldap.c
+++ b/providers/ldap/gdaprov-data-model-ldap.c
@@ -286,7 +286,7 @@ gda_data_model_ldap_dispose (GObject *object)
                 }
                if (model->priv->attributes) {
                        gint i;
-                       for (i = 0; i < model->priv->attributes->len; i++) {
+                       for (i = 0; (guint) i < model->priv->attributes->len; i++) {
                                gchar *tmp;
                                tmp = g_array_index (model->priv->attributes, gchar*, i);
                                g_free (tmp);
@@ -313,7 +313,7 @@ gda_data_model_ldap_dispose (GObject *object)
 
                if (model->priv->exceptions) {
                        gint i;
-                       for (i = 0; i < model->priv->exceptions->len; i++) {
+                       for (i = 0; (guint) i < model->priv->exceptions->len; i++) {
                                GError *e;
                                e = g_array_index (model->priv->exceptions, GError*, i);
                                g_error_free (e);
@@ -1660,7 +1660,7 @@ static void
 row_multiplier_set_holders (RowMultiplier *rm)
 {
        gint i;
-       for (i = 0; i < rm->cms->len; i++) {
+       for (i = 0; (guint) i < rm->cms->len; i++) {
                ColumnMultiplier *cm;
                GValue *value;
                cm = g_array_index (rm->cms, ColumnMultiplier*, i);
@@ -1676,11 +1676,11 @@ static void
 row_multiplier_free (RowMultiplier *rm)
 {
        gint i;
-       for (i = 0; i < rm->cms->len; i++) {
+       for (i = 0; (guint) i < rm->cms->len; i++) {
                ColumnMultiplier *cm;
                cm = g_array_index (rm->cms, ColumnMultiplier*, i);
                gint j;
-               for (j = 0; j < cm->values->len; j++) {
+               for (j = 0; (guint) j < cm->values->len; j++) {
                        GValue *value;
                        value = g_array_index (cm->values, GValue *, j);
                        if (value)
@@ -1713,7 +1713,7 @@ row_multiplier_index_next (RowMultiplier *rm)
 
        for (i = 0; ; i++) {
                ColumnMultiplier *cm;
-               if (i == rm->cms->len) {
+               if ((guint) i == rm->cms->len) {
 #ifdef GDA_DEBUG_NO
                        g_print ("RM %p [FALSE]:\n", rm);
                        for (i = 0; i < rm->cms->len; i++) {


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