From 029a5df87044dd392d3c393a2ba1c882722c94e0 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 21 Dec 2010 13:00:26 +0100 Subject: Bug #58699 cannot build with gcc dbg on solaris cmake/os/SunOS.cmake: Remove TARGET_OS_SOLARIS config.h.cmake: Remove TARGET_OS_SOLARIS Add PTHREAD_ONCE_INITIALIZER configure.cmake: Add function for testing whether we need { PTHREAD_ONCE_INIT } rather than PTHREAD_ONCE_INIT include/my_pthread.h: Use PTHREAD_ONCE_INITIALIZER if set by cmake. include/mysql/psi/mysql_file.h: Include my_global.h first, to get correct platform definitions. mysys/ptr_cmp.c: Hide the unused static functions in #ifdef's on solaris. Use __sun (defined by both gcc and SunPro cc) rather than TARGET_OS_SOLARIS sql/my_decimal.cc: Include my_global.h first, to get correct platform definitions. sql/mysqld.cc: Fix signed/unsigned comparison warning. sql/sql_audit.h: Include my_global.h first, to get correct platform definitions. sql/sql_plugin.h: Include my_global.h first, to get correct platform definitions. sql/sql_show.cc: Fix: warning: cast from pointer to integer of different size sql/sys_vars.h: Use reinterpret_cast rather than c-style cast. storage/perfschema/pfs_instr.cc: Include my_global.h first, to get correct platform definitions. --- sql/my_decimal.cc | 1 + sql/mysqld.cc | 4 ++-- sql/sql_audit.h | 2 ++ sql/sql_plugin.h | 2 ++ sql/sql_show.cc | 2 +- sql/sys_vars.h | 8 ++++++-- 6 files changed, 14 insertions(+), 5 deletions(-) (limited to 'sql') diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 8a31cec6721..a5b60739b26 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -13,6 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "sql_priv.h" #include diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d56b6715d6e..c3afa1a5399 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3247,8 +3247,8 @@ static int init_common_variables() size_t *pagesize = (size_t *) malloc(sizeof(size_t) * nelem); if (pagesize != NULL && getpagesizes(pagesize, nelem) > 0) { - size_t i, max_page_size= 0; - for (i= 0; i < nelem; i++) + size_t max_page_size= 0; + for (int i= 0; i < nelem; i++) { if (pagesize[i] > max_page_size && pagesize[i] <= max_desired_page_size) diff --git a/sql/sql_audit.h b/sql/sql_audit.h index d676c3974bc..da44c4a023b 100644 --- a/sql/sql_audit.h +++ b/sql/sql_audit.h @@ -17,6 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "sql_class.h" diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 0cbd5a519c1..1b7838ea085 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -16,6 +16,8 @@ #ifndef _sql_plugin_h #define _sql_plugin_h +#include + /* the following #define adds server-only members to enum_mysql_show_type, that is defined in plugin.h diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 0421cc35c5d..80dfde5343e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2255,7 +2255,7 @@ static bool show_status_array(THD *thd, const char *wild, end= int10_to_str(*(long*) value, buff, 10); break; case SHOW_LONGLONG_STATUS: - value= ((char *) status_var + (ulonglong) value); + value= ((char *) status_var + (ulong) value); /* fall through */ case SHOW_LONGLONG: end= longlong10_to_str(*(longlong*) value, buff, 10); diff --git a/sql/sys_vars.h b/sql/sys_vars.h index e16bd3c5330..c9987ed4674 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -1191,7 +1191,8 @@ public: void global_save_default(THD *thd, set_var *var) { LEX_STRING pname; - pname.str= *(char**)option.def_value; + char **default_value= reinterpret_cast(option.def_value); + pname.str= *default_value; pname.length= strlen(pname.str); plugin_ref plugin; @@ -1556,7 +1557,10 @@ public: void session_save_default(THD *thd, set_var *var) { var->save_result.ptr= global_var(void*); } void global_save_default(THD *thd, set_var *var) - { var->save_result.ptr= *(void**)option.def_value; } + { + void **default_value= reinterpret_cast(option.def_value); + var->save_result.ptr= *default_value; + } bool check_update_type(Item_result type) { return type != INT_RESULT && type != STRING_RESULT; } uchar *session_value_ptr(THD *thd, LEX_STRING *base) -- cgit v1.2.1