Skip to content

Commit 958e1f8

Browse files
committed
fix some warnings with Ruby 1.8
1 parent 21c30c0 commit 958e1f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/mysql2/client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ static VALUE rb_mysql_client_info(VALUE self) {
750750
#ifdef HAVE_RUBY_ENCODING_H
751751
rb_encoding *default_internal_enc;
752752
rb_encoding *conn_enc;
753-
#endif
754753
GET_CLIENT(self);
754+
#endif
755755
version = rb_hash_new();
756756

757757
#ifdef HAVE_RUBY_ENCODING_H
@@ -1050,18 +1050,18 @@ static VALUE set_write_timeout(VALUE self, VALUE value) {
10501050

10511051
static VALUE set_charset_name(VALUE self, VALUE value) {
10521052
char *charset_name;
1053+
#ifdef HAVE_RUBY_ENCODING_H
10531054
size_t charset_name_len;
10541055
const struct mysql2_mysql_enc_name_to_rb_map *mysql2rb;
1055-
#ifdef HAVE_RUBY_ENCODING_H
10561056
rb_encoding *enc;
10571057
VALUE rb_enc;
10581058
#endif
10591059
GET_CLIENT(self);
10601060

10611061
charset_name = RSTRING_PTR(value);
1062-
charset_name_len = RSTRING_LEN(value);
10631062

10641063
#ifdef HAVE_RUBY_ENCODING_H
1064+
charset_name_len = RSTRING_LEN(value);
10651065
mysql2rb = mysql2_mysql_enc_name_to_rb(charset_name, charset_name_len);
10661066
if (mysql2rb == NULL || mysql2rb->rb_name == NULL) {
10671067
VALUE inspect = rb_inspect(value);

ext/mysql2/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
typedef void rb_unblock_function_t(void *);
2121
static void *
2222
rb_thread_call_without_gvl(
23-
void *(*func), void *data1,
23+
void *(*func)(void *), void *data1,
2424
RB_MYSQL_UNUSED rb_unblock_function_t *ubf,
2525
RB_MYSQL_UNUSED void *data2)
2626
{

0 commit comments

Comments
 (0)