[libgda] mysql: Fix compiler warnings.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] mysql: Fix compiler warnings.
- Date: Tue, 5 Jul 2011 07:10:13 +0000 (UTC)
commit 33433189574b731b6e5c2cc469e5488968f19022
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Jul 5 09:02:43 2011 +0200
mysql: Fix compiler warnings.
This includes one fix that allows for error checking to work.
providers/mysql/gda-mysql-blob-op.c | 3 ++-
providers/mysql/gda-mysql-handler-boolean.c | 3 ++-
providers/mysql/gda-mysql-provider.c | 5 +++--
providers/mysql/gda-mysql-pstmt.c | 3 ++-
providers/mysql/gda-mysql-recordset.c | 13 +++++--------
5 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/providers/mysql/gda-mysql-blob-op.c b/providers/mysql/gda-mysql-blob-op.c
index e16de22..0f333a7 100644
--- a/providers/mysql/gda-mysql-blob-op.c
+++ b/providers/mysql/gda-mysql-blob-op.c
@@ -58,7 +58,8 @@ gda_mysql_blob_op_get_type (void)
NULL,
sizeof (GdaMysqlBlobOp),
0,
- (GInstanceInitFunc) gda_mysql_blob_op_init
+ (GInstanceInitFunc) gda_mysql_blob_op_init,
+ NULL
};
g_static_mutex_lock (®istering);
if (type == 0)
diff --git a/providers/mysql/gda-mysql-handler-boolean.c b/providers/mysql/gda-mysql-handler-boolean.c
index 2d60043..874175a 100644
--- a/providers/mysql/gda-mysql-handler-boolean.c
+++ b/providers/mysql/gda-mysql-handler-boolean.c
@@ -66,7 +66,8 @@ gda_mysql_handler_boolean_get_type (void)
NULL,
sizeof (GdaMysqlHandlerBoolean),
0,
- (GInstanceInitFunc) gda_mysql_handler_boolean_init
+ (GInstanceInitFunc) gda_mysql_handler_boolean_init,
+ NULL
};
static const GInterfaceInfo data_entry_info = {
diff --git a/providers/mysql/gda-mysql-provider.c b/providers/mysql/gda-mysql-provider.c
index 5e13726..bf9a40d 100644
--- a/providers/mysql/gda-mysql-provider.c
+++ b/providers/mysql/gda-mysql-provider.c
@@ -409,7 +409,8 @@ gda_mysql_provider_get_type (void)
NULL, NULL,
sizeof (GdaMysqlProvider),
0,
- (GInstanceInitFunc) gda_mysql_provider_init
+ (GInstanceInitFunc) gda_mysql_provider_init,
+ NULL
};
g_static_mutex_lock (®istering);
if (type == 0)
@@ -2451,7 +2452,7 @@ gda_mysql_provider_statement_execute (GdaServerProvider *provider,
}
else {
gchar *str = NULL;
- gulong blob_len;
+ glong blob_len;
if (blob->op) {
blob_len = gda_blob_op_get_length (blob->op);
if ((blob_len != bin->binary_length) &&
diff --git a/providers/mysql/gda-mysql-pstmt.c b/providers/mysql/gda-mysql-pstmt.c
index e0f28fb..5708f68 100644
--- a/providers/mysql/gda-mysql-pstmt.c
+++ b/providers/mysql/gda-mysql-pstmt.c
@@ -52,7 +52,8 @@ gda_mysql_pstmt_get_type (void)
NULL,
sizeof (GdaMysqlPStmt),
0,
- (GInstanceInitFunc) gda_mysql_pstmt_init
+ (GInstanceInitFunc) gda_mysql_pstmt_init,
+ NULL
};
g_static_mutex_lock (®istering);
diff --git a/providers/mysql/gda-mysql-recordset.c b/providers/mysql/gda-mysql-recordset.c
index 83a66a5..51a0dbd 100644
--- a/providers/mysql/gda-mysql-recordset.c
+++ b/providers/mysql/gda-mysql-recordset.c
@@ -298,7 +298,8 @@ gda_mysql_recordset_get_type (void)
NULL,
sizeof (GdaMysqlRecordset),
0,
- (GInstanceInitFunc) gda_mysql_recordset_init
+ (GInstanceInitFunc) gda_mysql_recordset_init,
+ NULL
};
g_static_mutex_lock (®istering);
if (type == 0)
@@ -776,7 +777,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, gint rownum, GError **error)
long long longlongvalue = 0;
double doublevalue = 0.0;
float floatvalue = 0.;
- MYSQL_TIME timevalue = { 0 };
+ MYSQL_TIME timevalue = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
my_bool is_null = FALSE;
unsigned long length;
@@ -929,14 +930,10 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, gint rownum, GError **error)
gda_value_set_binary (value, &binary);
}
else if (type == GDA_TYPE_BLOB) {
- /* web don't use GdaMysqlBlobOp because it looks like the MySQL
+ /* we don't use GdaMysqlBlobOp because it looks like the MySQL
* API does not support BLOBs accessed in a random way,
* so we return the whole BLOB at once */
- GdaBlob blob = {
- .data.data = (guchar*) strvalue,
- .data.binary_length = length,
- .op = NULL
- };
+ GdaBlob blob = { {(guchar*) strvalue, length}, NULL };
gda_value_set_blob (value, &blob);
}
else if (type == G_TYPE_DOUBLE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]