From a1315d2a2d1620da82fd1f542c17f3d03ce7b1ec Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 6 Mar 2017 15:04:47 +0100 Subject: [PATCH] Fixed compiler warnings in bulk1.c and features-10_2.c --- unittest/libmariadb/bulk1.c | 10 +++++----- unittest/libmariadb/features-10_2.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/unittest/libmariadb/bulk1.c b/unittest/libmariadb/bulk1.c index 711b54c2..efaa1850 100644 --- a/unittest/libmariadb/bulk1.c +++ b/unittest/libmariadb/bulk1.c @@ -291,7 +291,7 @@ static int bulk4(MYSQL *mysql) rc= mysql_query(mysql, "SELECT * FROM bulk4 WHERE row=3"); check_mysql_rc(rc, mysql); res= mysql_store_result(mysql); - rc= mysql_num_rows(res); + rc= (int)mysql_num_rows(res); mysql_free_result(res); FAIL_IF(rc != 3, "expected 3 rows"); rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk4"); @@ -307,7 +307,7 @@ static int bulk_null(MYSQL *mysql) unsigned int param_count= 2; unsigned int array_size= 2; unsigned long lengths[2]= {-1, -1}; - const char **buf= calloc(1, 2 * sizeof(char *)); + char **buf= calloc(1, 2 * sizeof(char *)); if (!bulk_enabled) { @@ -401,7 +401,7 @@ static int bulk5(MYSQL *mysql) check_mysql_rc(rc, mysql); res= mysql_store_result(mysql); - rows= mysql_num_rows(res); + rows= (unsigned long)mysql_num_rows(res); mysql_free_result(res); FAIL_IF(rows != 5, "expected 5 rows"); @@ -467,7 +467,7 @@ static int bulk6(MYSQL *mysql) check_mysql_rc(rc, mysql); res= mysql_store_result(mysql); - rows= mysql_num_rows(res); + rows= (unsigned long)mysql_num_rows(res); mysql_free_result(res); FAIL_IF(rows != 5, "expected 5 rows"); @@ -501,7 +501,7 @@ static int bulk6(MYSQL *mysql) check_mysql_rc(rc, mysql); res= mysql_store_result(mysql); - rows= mysql_num_rows(res); + rows= (unsigned long)mysql_num_rows(res); mysql_free_result(res); FAIL_IF(rows != 10, "expected 10 rows"); diff --git a/unittest/libmariadb/features-10_2.c b/unittest/libmariadb/features-10_2.c index 85023f37..12bf46f5 100644 --- a/unittest/libmariadb/features-10_2.c +++ b/unittest/libmariadb/features-10_2.c @@ -86,7 +86,7 @@ static int execute_direct_example(MYSQL *mysql) bind[0].buffer= &intval; bind[1].buffer_type= MYSQL_TYPE_STRING; bind[1].buffer= (char *)strval; - bind[1].buffer_length= strlen(strval); + bind[1].buffer_length= (unsigned long)strlen(strval); /* set number of parameters */ rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶m_count);