Modified:
branches/guffert/driver/ansi.c
branches/guffert/driver/catalog.c
branches/guffert/driver/results.c
branches/guffert/driver/unicode.c
branches/guffert/util/MYODBCUtil.h
Log:
Add some casts and fix a macro definition to eliminate warnings with
Microsoft Visual Studio 2005.
Modified: branches/guffert/driver/ansi.c
- branches/guffert/driver/ansi.c 2007-08-31 23:41:59 UTC (rev 731)
+++ branches/guffert/driver/ansi.c 2007-09-01 00:41:01 UTC (rev 732)
@@ -150,7 +150,7 @@
}
if (char_attr_len)
- *char_attr_len= len;
+ *char_attr_len= (SQLSMALLINT)len;
if (free_value)
x_free(value);
@@ -351,7 +351,7 @@
}
if (name_len)
- *name_len= len;
+ *name_len= (SQLSMALLINT)len;
if (free_value)
x_free(value);
@@ -607,7 +607,7 @@
}
if (cursor_len)
- *cursor_len= len;
+ *cursor_len= (SQLSMALLINT)len;
if (free_name)
x_free(name);
@@ -664,7 +664,7 @@
rc= set_conn_error(dbc, MYERR_01004, NULL, 0);
if (info_len)
- *info_len= len;
+ *info_len= (SQLSMALLINT)len;
if (info && info_max > 1)
{
@@ -739,7 +739,7 @@
rc= set_conn_error(dbc, MYERR_01004, NULL, 0);
if (message_len)
- *message_len= len;
+ *message_len= (SQLSMALLINT)len;
if (message && message_max > 1)
{
@@ -809,7 +809,7 @@
}
if (value_len)
- *value_len= len;
+ *value_len= (SQLSMALLINT)len;
if (free_value)
x_free(char_value);
Modified: branches/guffert/driver/catalog.c
- branches/guffert/driver/catalog.c 2007-08-31 23:41:59 UTC (rev 731)
+++ branches/guffert/driver/catalog.c 2007-09-01 00:41:01 UTC (rev 732)
@@ -746,7 +746,8 @@
/* Get list of columns matching szColumn for each table. */
lengths= mysql_fetch_lengths(res);
table_res= mysql_list_dbcolumns(stmt, szCatalog, cbCatalog,
- (SQLCHAR *)table_row[0], lengths[0],
+ (SQLCHAR *)table_row[0],
+ (SQLSMALLINT)lengths[0],
szColumn, cbColumn);
if (!table_res)
Modified: branches/guffert/driver/results.c
- branches/guffert/driver/results.c 2007-08-31 23:41:59 UTC (rev 731)
+++ branches/guffert/driver/results.c 2007-09-01 00:41:01 UTC (rev 732)
@@ -530,7 +530,7 @@
if (size)
*size= get_column_size(stmt, field, FALSE);
if (scale)
- *scale= max(0, get_decimal_digits(stmt, field));
+ *scale= (SQLSMALLINT)max(0, get_decimal_digits(stmt, field));
if (nullable)
*nullable= ((field->flags & NOT_NULL_FLAG) ? SQL_NO_NULLS : SQL_NULLABLE);
Modified: branches/guffert/driver/unicode.c
- branches/guffert/driver/unicode.c 2007-08-31 23:41:59 UTC (rev 731)
+++ branches/guffert/driver/unicode.c 2007-09-01 00:41:01 UTC (rev 732)
@@ -36,8 +36,6 @@
/* Forward declarations. */
SQLCHAR *sqlwchar_as_utf8(SQLWCHAR *str, SQLINTEGER *len);
-SQLINTEGER utf8_as_sqlwchar(SQLWCHAR *out, SQLINTEGER out_max, SQLCHAR *in,
- SQLINTEGER in_len);
SQLRETURN SQL_API
SQLColAttributeWImpl(SQLHSTMT hstmt, SQLUSMALLINT column,
@@ -273,8 +271,8 @@
@return Number of characters stored in the @c out buffer
*/
-SQLINTEGER utf8_as_sqlwchar(SQLWCHAR *out, SQLINTEGER out_max, SQLCHAR *in,
- SQLINTEGER in_len)
+SQLSMALLINT utf8_as_sqlwchar(SQLWCHAR *out, SQLINTEGER out_max, SQLCHAR *in,
+ SQLINTEGER in_len)
{
SQLINTEGER i;
SQLWCHAR *pos, *out_end;
@@ -501,8 +499,8 @@
((DBC *)hdbc)->unicode= TRUE; /* Hooray, a Unicode connection! */
- rc= MySQLDriverConnect(hdbc, hwnd, in8, in_len, out8, out8_max, out_len,
- completion);
+ rc= MySQLDriverConnect(hdbc, hwnd, in8, (SQLSMALLINT)in_len, out8, out8_max,
+ out_len, completion);
#ifdef WIN32
/*
@@ -567,7 +565,7 @@
rc= set_error(stmt, MYERR_01004, NULL, 0);
if (name_len)
- *name_len= len;
+ *name_len= (SQLSMALLINT)len;
if (name_max > 0)
{
@@ -772,7 +770,7 @@
MySQLGetCursorName(hstmt), &len, &errors);
if (cursor_len)
- *cursor_len= len;
+ *cursor_len= (SQLSMALLINT)len;
/* Warn if name truncated */
if (len > cursor_max - 1)
@@ -831,7 +829,7 @@
rc= set_conn_error(dbc, MYERR_01004, NULL, 0);
if (info_len)
- *info_len= len * sizeof(SQLWCHAR);
+ *info_len= (SQLSMALLINT)len * sizeof(SQLWCHAR);
if (info_max > 0)
{
@@ -900,7 +898,7 @@
rc= set_conn_error(dbc, MYERR_01004, NULL, 0);
if (message_len)
- *message_len= len;
+ *message_len= (SQLSMALLINT)len;
if (message_max > 0)
{
@@ -957,7 +955,7 @@
rc= set_conn_error(dbc, MYERR_01004, NULL, 0);
if (value_len)
- *value_len= len * sizeof(SQLWCHAR);
+ *value_len= (SQLSMALLINT)len * sizeof(SQLWCHAR);
if (value_max > 0)
{
Modified: branches/guffert/util/MYODBCUtil.h
- branches/guffert/util/MYODBCUtil.h 2007-08-31 23:41:59 UTC (rev 731)
+++ branches/guffert/util/MYODBCUtil.h 2007-09-01 00:41:01 UTC (rev 732)
@@ -37,7 +37,7 @@
#include "../MYODBC_CONF.h"
#include "../MYODBC_ODBC.h"
-#ifdef WIN32
+#if defined(WIN32) && !defined(strcasecmp)
#define strcasecmp( a, b ) stricmp( a, b )
#endif
@@ -232,6 +232,7 @@
# define _global_strndup(s, n) strnglobaldup(s, n)
# define _global_alloc(n) GlobalAlloc(GMEM_FIXED, (n))
# define _global_free(p) GlobalFree(p)
+ char *myodbc_strndup( const char *s, size_t n );
#else
# define _global_strdup(s) strdup(s)
# ifdef HAVE_STRNDUP
--
MySQL Code Commits Mailing List
For list archives:
http://lists.mysql.com/commits
To unsubscribe:
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Fri Aug 31 20:42:53 2007