Commit 716188f1 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix some warnings on Windows compilation

- silence warnings in ed25519 reference implementation
- fix signed/unsigned warning in popular header item_func.h
parent d7c35a99
...@@ -14,8 +14,12 @@ SET(REF10_SOURCES ...@@ -14,8 +14,12 @@ SET(REF10_SOURCES
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
ADD_CONVENIENCE_LIBRARY(ref10 ${REF10_SOURCES}) ADD_CONVENIENCE_LIBRARY(ref10 ${REF10_SOURCES})
IF(MSVC)
# Silence conversion (integer truncantion) warnings from reference code
SET_TARGET_PROPERTIES(ref10 PROPERTIES COMPILE_FLAGS "/wd4244 /wd4146")
ENDIF()
MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c ${REF10_SOURCES} MODULE_ONLY) MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c MODULE_ONLY LINK_LIBRARIES ref10)
MYSQL_ADD_PLUGIN(client_ed25519 client_ed25519.c MODULE_ONLY MYSQL_ADD_PLUGIN(client_ed25519 client_ed25519.c MODULE_ONLY
CLIENT LINK_LIBRARIES mysys_ssl ref10 COMPONENT ClientPlugins) CLIENT LINK_LIBRARIES mysys_ssl ref10 COMPONENT ClientPlugins)
......
...@@ -633,7 +633,7 @@ class Item_func_signed :public Item_int_func ...@@ -633,7 +633,7 @@ class Item_func_signed :public Item_int_func
Reserve max_length to fit at least one character for one digit, Reserve max_length to fit at least one character for one digit,
plus one character for the sign (if signed). plus one character for the sign (if signed).
*/ */
set_if_bigger(char_length, 1 + (unsigned_flag ? 0 : 1)); set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1));
fix_char_length(char_length); fix_char_length(char_length);
} }
virtual void print(String *str, enum_query_type query_type); virtual void print(String *str, enum_query_type query_type);
......
...@@ -469,7 +469,7 @@ int my_wc_mb_utf8_with_escape(CHARSET_INFO *cs, my_wc_t escape, my_wc_t wc, ...@@ -469,7 +469,7 @@ int my_wc_mb_utf8_with_escape(CHARSET_INFO *cs, my_wc_t escape, my_wc_t wc,
DBUG_ASSERT(escape > 0); DBUG_ASSERT(escape > 0);
if (str + 1 >= end) if (str + 1 >= end)
return MY_CS_TOOSMALL2; // Not enough space, need at least two bytes. return MY_CS_TOOSMALL2; // Not enough space, need at least two bytes.
*str= escape; *str= (uchar)escape;
int cnvres= my_charset_utf8_handler.wc_mb(cs, wc, str + 1, end); int cnvres= my_charset_utf8_handler.wc_mb(cs, wc, str + 1, end);
if (cnvres > 0) if (cnvres > 0)
return cnvres + 1; // The character was normally put return cnvres + 1; // The character was normally put
......
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