1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)

Handle string length as size_t, consistently (almost always:))
Change function prototypes to accept size_t, where in the past
ulong or uint were used. change local/member variables to size_t
when appropriate.

This fix excludes rocksdb, spider,spider, sphinx and connect for now.
This commit is contained in:
Vladislav Vaintroub
2018-02-06 12:55:58 +00:00
parent f271100836
commit 6c279ad6a7
257 changed files with 1514 additions and 1543 deletions

View File

@@ -572,7 +572,7 @@ inline_mysql_socket_bind
#ifdef HAVE_PSI_SOCKET_INTERFACE
const char *src_file, uint src_line,
#endif
MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, size_t len)
{
int result;
@@ -586,11 +586,11 @@ inline_mysql_socket_bind
(&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);
/* Instrumented code */
result= bind(mysql_socket.fd, addr, len);
result= bind(mysql_socket.fd, addr, (int)len);
/* Instrumentation end */
if (result == 0)
PSI_SOCKET_CALL(set_socket_info)(mysql_socket.m_psi, NULL, addr, len);
PSI_SOCKET_CALL(set_socket_info)(mysql_socket.m_psi, NULL, addr, (socklen_t)len);
if (locker != NULL)
PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
@@ -600,7 +600,7 @@ inline_mysql_socket_bind
#endif
/* Non instrumented code */
result= bind(mysql_socket.fd, addr, len);
result= bind(mysql_socket.fd, addr, (int)len);
return result;
}

View File

@@ -145,14 +145,14 @@ inline_mysql_digest_end(PSI_digest_locker *locker, const sql_digest_storage *dig
static inline struct PSI_statement_locker *
inline_mysql_start_statement(PSI_statement_locker_state *state,
PSI_statement_key key,
const char *db, uint db_len,
const char *db, size_t db_len,
const CHARSET_INFO *charset,
const char *src_file, uint src_line)
{
PSI_statement_locker *locker;
locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset);
if (likely(locker != NULL))
PSI_STATEMENT_CALL(start_statement)(locker, db, db_len, src_file, src_line);
PSI_STATEMENT_CALL(start_statement)(locker, db, (uint)db_len, src_file, src_line);
return locker;
}