Commit 477a1bc4 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Windows : fix compile warnings C4267, on 32bit first

parent db28f0f8
...@@ -140,8 +140,11 @@ IF(MSVC) ...@@ -140,8 +140,11 @@ IF(MSVC)
#TODO: update the code and remove the disabled warnings #TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4291 /wd4996 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
# Temporarily disable size_t warnings, due to their amount
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
ENDIF()
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR") IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
......
...@@ -613,7 +613,8 @@ uchar *engine_option_value::frm_image(uchar *buff) ...@@ -613,7 +613,8 @@ uchar *engine_option_value::frm_image(uchar *buff)
{ {
if (value.str) if (value.str)
{ {
*buff++= name.length; DBUG_ASSERT(name.length <= 0xff);
*buff++= (uchar)name.length;
memcpy(buff, name.str, name.length); memcpy(buff, name.str, name.length);
buff+= name.length; buff+= name.length;
int2store(buff, value.length | (quoted_value ? FRM_QUOTED_VALUE : 0)); int2store(buff, value.length | (quoted_value ? FRM_QUOTED_VALUE : 0));
......
...@@ -11791,7 +11791,8 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len, ...@@ -11791,7 +11791,8 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
cnt += header_len; cnt += header_len;
// Write new db name length and new name // Write new db name length and new name
*ptr++ = new_len; DBUG_ASSERT(new_len < 0xff);
*ptr++ = (char)new_len;
memcpy(ptr, new_db, new_len + 1); memcpy(ptr, new_db, new_len + 1);
ptr += new_len + 1; ptr += new_len + 1;
cnt += m_dblen + 2; cnt += m_dblen + 2;
......
...@@ -3007,7 +3007,8 @@ ulong acl_get(const char *host, const char *ip, ...@@ -3007,7 +3007,8 @@ ulong acl_get(const char *host, const char *ip,
(entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length))) (entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
{ {
entry->access=(db_access & host_access); entry->access=(db_access & host_access);
entry->length=key_length; DBUG_ASSERT(key_length < 0xffff);
entry->length=(uint16)key_length;
memcpy((uchar*) entry->key,key,key_length); memcpy((uchar*) entry->key,key,key_length);
acl_cache->add(entry); acl_cache->add(entry);
} }
......
...@@ -2250,10 +2250,10 @@ class SQLQualifiedName ...@@ -2250,10 +2250,10 @@ class SQLQualifiedName
return (SQLCHAR *) (m_part[i].length ? m_part[i].str : NULL); return (SQLCHAR *) (m_part[i].length ? m_part[i].str : NULL);
} // end of ptr } // end of ptr
size_t length(uint i) SQLSMALLINT length(uint i)
{ {
DBUG_ASSERT(i < max_parts); DBUG_ASSERT(i < max_parts);
return m_part[i].length; return (SQLSMALLINT)m_part[i].length;
} // end of length } // end of length
}; // end of class SQLQualifiedName }; // end of class SQLQualifiedName
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment