diff --git a/ext/mysql2_ext.c b/ext/mysql2_ext.c index ef97a00..95491f6 100644 --- a/ext/mysql2_ext.c +++ b/ext/mysql2_ext.c @@ -175,7 +175,7 @@ static VALUE rb_mysql_client_init(RB_MYSQL_UNUSED int argc, RB_MYSQL_UNUSED VALU return self; } -void rb_mysql_client_free(void * client) { +static void rb_mysql_client_free(void * client) { MYSQL * c = client; if (c) { /* @@ -366,7 +366,7 @@ static VALUE rb_mysql_result_to_obj(MYSQL_RES * r) { return obj; } -void rb_mysql_result_free(void * wrapper) { +static void rb_mysql_result_free(void * wrapper) { mysql2_result_wrapper * w = wrapper; if (w && w->resultFreed != 1) { /* FIXME: this may call flush_use_result, which can hit the socket */ @@ -375,7 +375,7 @@ void rb_mysql_result_free(void * wrapper) { } } -void rb_mysql_result_mark(void * wrapper) { +static void rb_mysql_result_mark(void * wrapper) { mysql2_result_wrapper * w = wrapper; if (w) { rb_gc_mark(w->fields); @@ -649,4 +649,4 @@ void Init_mysql2_ext() { utf8Encoding = rb_enc_find_index("UTF-8"); binaryEncoding = rb_enc_find_index("binary"); #endif -} \ No newline at end of file +} diff --git a/ext/mysql2_ext.h b/ext/mysql2_ext.h index e576a31..77005e6 100644 --- a/ext/mysql2_ext.h +++ b/ext/mysql2_ext.h @@ -14,7 +14,7 @@ #ifdef HAVE_RUBY_ENCODING_H #include -int utf8Encoding, binaryEncoding; +static int utf8Encoding, binaryEncoding; #endif #if defined(__GNUC__) && (__GNUC__ >= 3) @@ -24,10 +24,10 @@ int utf8Encoding, binaryEncoding; #endif static VALUE cBigDecimal, cDate, cDateTime; -ID intern_new, intern_local; +static ID intern_new, intern_local; /* Mysql2::Error */ -VALUE cMysql2Error; +static VALUE cMysql2Error; /* Mysql2::Client */ #define GetMysql2Client(obj, sval) (sval = (MYSQL*)DATA_PTR(obj)); @@ -45,7 +45,7 @@ static VALUE rb_mysql_client_socket(VALUE self); static VALUE rb_mysql_client_async_result(VALUE self); static VALUE rb_mysql_client_last_id(VALUE self); static VALUE rb_mysql_client_affected_rows(VALUE self); -void rb_mysql_client_free(void * client); +static void rb_mysql_client_free(void * client); /* Mysql2::Result */ typedef struct { @@ -58,12 +58,12 @@ typedef struct { MYSQL_RES *result; } mysql2_result_wrapper; #define GetMysql2Result(obj, sval) (sval = (mysql2_result_wrapper*)DATA_PTR(obj)); -VALUE cMysql2Result; +static VALUE cMysql2Result; static VALUE rb_mysql_result_to_obj(MYSQL_RES * res); static VALUE rb_mysql_result_fetch_row(int argc, VALUE * argv, VALUE self); static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self); -void rb_mysql_result_free(void * wrapper); -void rb_mysql_result_mark(void * wrapper); +static void rb_mysql_result_free(void * wrapper); +static void rb_mysql_result_mark(void * wrapper); /* * used to pass all arguments to mysql_real_connect while inside @@ -113,4 +113,4 @@ rb_thread_blocking_region( return rv; } -#endif /* ! HAVE_RB_THREAD_BLOCKING_REGION */ \ No newline at end of file +#endif /* ! HAVE_RB_THREAD_BLOCKING_REGION */