From 3a6db1d65f0459e0b7b993afbe247c8d6f62849b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Aug 2001 19:07:28 -0400 Subject: [PATCH 1/2] myisamchk.c Make --set-character-set actually do something. myisam/myisamchk.c: Make --set-character-set actually do something. --- myisam/myisamchk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 996e4749e53..8ee92debf56 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -39,7 +39,6 @@ static uint decode_bits; static char **default_argv; static const char *load_default_groups[]= { "myisamchk", 0 }; static const char *set_charset_name; -static uint8 set_charset_number; static CHARSET_INFO *set_charset; static const char *type_names[]= @@ -607,9 +606,9 @@ static int myisamchk(MI_CHECK *param, my_string filename) (((ulonglong) 1L << share->base.keys)-1)) || test_if_almost_full(info) || info->s->state.header.file_version[3] != myisam_file_magic[3] || - (set_charset && set_charset_number != share->state.header.language))) + (set_charset && set_charset->number != share->state.header.language))) { - check_param.language=set_charset_number; + check_param.language=set_charset->number; if (recreate_table(&check_param, &info,filename)) { VOID(fprintf(stderr, From 65bc433d812251e87920198b9c3ab981b142cc80 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Aug 2001 19:14:04 -0400 Subject: [PATCH 2/2] Portability fix in mysqlbinlog.cc (include my_pthread.h) Clean up 'unused argument' warnings Add extern "C" { ... } in my_pthread.h client/mysqlbinlog.cc: Include my_pthread.h before thr_alarm.h (otherwise pthread_t isn't declared yet). client/mysqltest.c: Fix unused argument warnings. client/thread_test.c: Fix unused argument warnings. include/my_pthread.h: Put extern "C" { ... } wrappers, because this file is included from some C++ files. --- client/mysqlbinlog.cc | 1 + client/mysqltest.c | 8 ++++---- client/thread_test.c | 2 +- include/my_pthread.h | 9 +++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 757e9dce810..f698ceaf5d4 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "log_event.h" diff --git a/client/mysqltest.c b/client/mysqltest.c index f6d87352a6c..6c5f1c57f6a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -247,10 +247,10 @@ static int eval_result = 0; /* Disable functions that only exist in MySQL 4.0 */ #if MYSQL_VERSION_ID < 40000 -static void mysql_enable_rpl_parse(MYSQL* mysql) {} -static void mysql_disable_rpl_parse(MYSQL* mysql) {} -static int mysql_rpl_parse_enabled(MYSQL* mysql) { return 1; } -static int mysql_rpl_probe(MYSQL *mysql) { return 1; } +static void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {} +static void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {} +static int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; } +static int mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; } #endif diff --git a/client/thread_test.c b/client/thread_test.c index 4d3ae6e7ddd..dbe2acee8db 100644 --- a/client/thread_test.c +++ b/client/thread_test.c @@ -19,7 +19,7 @@ #ifndef THREAD -int main(int argc, char **argv) +int main(void) { printf("This test must be compiled with multithread support to work\n"); exit(1); diff --git a/include/my_pthread.h b/include/my_pthread.h index 652bdd205c0..767722a2050 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -20,6 +20,10 @@ #ifndef _my_pthread_h #define _my_pthread_h +#ifdef __cplusplus +extern "C" { +#endif + #include #ifndef ETIME #define ETIME ETIMEDOUT /* For FreeBSD */ @@ -576,4 +580,9 @@ extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); #endif /* SAFE_STATISTICS */ #endif /* HAVE_ATOMIC_ADD */ #endif /* thread_safe_increment */ + +#ifdef __cplusplus +} +#endif + #endif /* _my_ptread_h */