Commit 9ab4829b authored by Michael Widenius's avatar Michael Widenius

Fixed compiler warnings and a compilation failure on windows

extra/libevent/event.c:
  Tried to fix compiler warning on windows
extra/libevent/evutil.h:
  Define __attribute__ for not gcc compilers
extra/libevent/kqueue.c:
  Fixed compiler warnings
extra/libevent/signal.c:
  Tried to fix compiler warning on windows
storage/pbxt/src/ha_pbxt.cc:
  Fixed compiler warning about "variable might be clobbered by longjmp"
storage/pbxt/src/table_xt.cc:
  Fixed compiler warnings (on windows)
storage/xtradb/handler/i_s.cc:
  Fixed compiler warning by invoking the correct store function.
parent b8b3716a
...@@ -405,7 +405,7 @@ event_loopexit_cb(int fd __attribute__((unused)), ...@@ -405,7 +405,7 @@ event_loopexit_cb(int fd __attribute__((unused)),
int int
event_loopexit(struct timeval *tv) event_loopexit(struct timeval *tv)
{ {
return (event_once(-1, EV_TIMEOUT, event_loopexit_cb, return (event_once(-1, EV_TIMEOUT, &event_loopexit_cb,
current_base, tv)); current_base, tv));
} }
......
...@@ -171,4 +171,21 @@ ev_int64_t evutil_strtoll(const char *s, char **endptr, int base); ...@@ -171,4 +171,21 @@ ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
} }
#endif #endif
/* Define __attribute__ for platforms that doesn't suppor it */
#ifndef __attribute__
# if !defined(__GNUC__)
# define __attribute__(A)
# else
# ifndef GCC_VERSION
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
# endif
# if GCC_VERSION < 2008
# define __attribute__(A)
# elif defined(__cplusplus) && GCC_VERSION < 3004
# define __attribute__(A)
# endif
# endif
#endif
#endif /* _EVUTIL_H_ */ #endif /* _EVUTIL_H_ */
...@@ -95,7 +95,7 @@ const struct eventop kqops = { ...@@ -95,7 +95,7 @@ const struct eventop kqops = {
}; };
static void * static void *
kq_init(struct event_base *base) kq_init(struct event_base *base __attribute__((unused)))
{ {
int kq; int kq;
struct kqop *kqueueop; struct kqop *kqueueop;
...@@ -203,13 +203,14 @@ kq_insert(struct kqop *kqop, struct kevent *kev) ...@@ -203,13 +203,14 @@ kq_insert(struct kqop *kqop, struct kevent *kev)
} }
static void static void
kq_sighandler(int sig) kq_sighandler(int sig __attribute__((unused)))
{ {
/* Do nothing here */ /* Do nothing here */
} }
static int static int
kq_dispatch(struct event_base *base, void *arg, struct timeval *tv) kq_dispatch(struct event_base *base __attribute__((unused)), void *arg,
struct timeval *tv)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;
struct kevent *changes = kqop->changes; struct kevent *changes = kqop->changes;
...@@ -408,7 +409,7 @@ kq_del(void *arg, struct event *ev) ...@@ -408,7 +409,7 @@ kq_del(void *arg, struct event *ev)
} }
static void static void
kq_dealloc(struct event_base *base, void *arg) kq_dealloc(struct event_base *base __attribute__((unused)), void *arg)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;
......
...@@ -114,7 +114,7 @@ evsignal_init(struct event_base *base) ...@@ -114,7 +114,7 @@ evsignal_init(struct event_base *base)
evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]); evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1], event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1],
EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal); EV_READ | EV_PERSIST, &evsignal_cb, &base->sig.ev_signal);
base->sig.ev_signal.ev_base = base; base->sig.ev_signal.ev_base = base;
base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL; base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
} }
......
...@@ -1615,7 +1615,7 @@ static int pbxt_prepare(handlerton *hton, THD *thd, bool all) ...@@ -1615,7 +1615,7 @@ static int pbxt_prepare(handlerton *hton, THD *thd, bool all)
static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err) static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
{ {
THD *thd; THD *thd;
XTThreadPtr self = NULL; XTThreadPtr volatile self = NULL;
*temp_thread = 0; *temp_thread = 0;
if ((thd = current_thd)) if ((thd = current_thd))
......
...@@ -1822,8 +1822,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool ...@@ -1822,8 +1822,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool
} }
if (free_count != tab->tab_rec_fnum) { if (free_count != tab->tab_rec_fnum) {
if (correct_count) { if (correct_count) {
tab->tab_rec_fnum = free_count; tab->tab_rec_fnum = (uint) free_count;
tab->tab_head_rec_fnum = free_count; tab->tab_head_rec_fnum = (uint) free_count;
tab->tab_flush_pending = TRUE; tab->tab_flush_pending = TRUE;
xt_logf(XT_NT_INFO, "Table %s: free record count (%llu) has been set to the number of records on the list: %llu\n", table_name, (u_llong) tab->tab_rec_fnum, (u_llong) free_count); xt_logf(XT_NT_INFO, "Table %s: free record count (%llu) has been set to the number of records on the list: %llu\n", table_name, (u_llong) tab->tab_rec_fnum, (u_llong) free_count);
} }
...@@ -1875,8 +1875,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool ...@@ -1875,8 +1875,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool
* The correct way to do this at run time would be to add the change to the * The correct way to do this at run time would be to add the change to the
* transaction log, so that it is applied by the writer. * transaction log, so that it is applied by the writer.
*/ */
tab->tab_row_fnum = free_count; tab->tab_row_fnum = (uint) free_count;
tab->tab_head_row_fnum = free_count; tab->tab_head_row_fnum = (uint) free_count;
tab->tab_flush_pending = TRUE; tab->tab_flush_pending = TRUE;
xt_logf(XT_NT_INFO, "Table %s: free row count (%llu) has been set to the number of rows on the list: %llu\n", table_name, (u_llong) tab->tab_row_fnum, (u_llong) free_count); xt_logf(XT_NT_INFO, "Table %s: free row count (%llu) has been set to the number of rows on the list: %llu\n", table_name, (u_llong) tab->tab_row_fnum, (u_llong) free_count);
} }
......
...@@ -763,7 +763,7 @@ i_s_innodb_buffer_pool_pages_index_fill( ...@@ -763,7 +763,7 @@ i_s_innodb_buffer_pool_pages_index_fill(
if (fil_page_get_type(frame) == FIL_PAGE_INDEX) { if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
index_id = btr_page_get_index_id(frame); index_id = btr_page_get_index_id(frame);
table->field[0]->store(ut_conv_dulint_to_longlong(index_id)); table->field[0]->store(ut_conv_dulint_to_longlong(index_id), 0);
table->field[1]->store(block->page.space); table->field[1]->store(block->page.space);
table->field[2]->store(block->page.offset); table->field[2]->store(block->page.offset);
table->field[3]->store(page_get_n_recs(frame)); table->field[3]->store(page_get_n_recs(frame));
......
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