Skip to content

Commit e84b6ce

Browse files
authored
Merge pull request #910 from sodabrew/prefix_rb_mysql
Prefix more C functions with rb_mysql_
2 parents 105c9f0 + 7a684a7 commit e84b6ce

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

ext/mysql2/client.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static int opt_connect_attr_add_i(VALUE key, VALUE value, VALUE arg)
413413
}
414414
#endif
415415

416-
static VALUE rb_connect(VALUE self, VALUE user, VALUE pass, VALUE host, VALUE port, VALUE database, VALUE socket, VALUE flags, VALUE conn_attrs) {
416+
static VALUE rb_mysql_connect(VALUE self, VALUE user, VALUE pass, VALUE host, VALUE port, VALUE database, VALUE socket, VALUE flags, VALUE conn_attrs) {
417417
struct nogvl_connect_args args;
418418
time_t start_time, end_time, elapsed_time, connect_timeout;
419419
VALUE rv;
@@ -754,7 +754,7 @@ static VALUE rb_mysql_client_abandon_results(VALUE self) {
754754
* Query the database with +sql+, with optional +options+. For the possible
755755
* options, see default_query_options on the Mysql2::Client class.
756756
*/
757-
static VALUE rb_query(VALUE self, VALUE sql, VALUE current) {
757+
static VALUE rb_mysql_query(VALUE self, VALUE sql, VALUE current) {
758758
#ifndef _WIN32
759759
struct async_query_args async_args;
760760
#endif
@@ -1421,8 +1421,8 @@ void init_mysql2_client() {
14211421
rb_define_private_method(cMysql2Client, "ssl_mode=", rb_set_ssl_mode_option, 1);
14221422
rb_define_private_method(cMysql2Client, "enable_cleartext_plugin=", set_enable_cleartext_plugin, 1);
14231423
rb_define_private_method(cMysql2Client, "initialize_ext", initialize_ext, 0);
1424-
rb_define_private_method(cMysql2Client, "connect", rb_connect, 8);
1425-
rb_define_private_method(cMysql2Client, "_query", rb_query, 2);
1424+
rb_define_private_method(cMysql2Client, "connect", rb_mysql_connect, 8);
1425+
rb_define_private_method(cMysql2Client, "_query", rb_mysql_query, 2);
14261426

14271427
sym_id = ID2SYM(rb_intern("id"));
14281428
sym_version = ID2SYM(rb_intern("version"));

ext/mysql2/statement.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void rb_mysql_stmt_mark(void * ptr) {
2121
rb_gc_mark(stmt_wrapper->client);
2222
}
2323

24-
static void *nogvl_stmt_close(void * ptr) {
24+
static void *nogvl_stmt_close(void *ptr) {
2525
mysql_stmt_wrapper *stmt_wrapper = ptr;
2626
if (stmt_wrapper->stmt) {
2727
mysql_stmt_close(stmt_wrapper->stmt);
@@ -30,7 +30,7 @@ static void *nogvl_stmt_close(void * ptr) {
3030
return NULL;
3131
}
3232

33-
static void rb_mysql_stmt_free(void * ptr) {
33+
static void rb_mysql_stmt_free(void *ptr) {
3434
mysql_stmt_wrapper *stmt_wrapper = ptr;
3535
decr_mysql2_stmt(stmt_wrapper);
3636
}
@@ -145,7 +145,7 @@ VALUE rb_mysql_stmt_new(VALUE rb_client, VALUE sql) {
145145
*
146146
* Returns the number of parameters the prepared statement expects.
147147
*/
148-
static VALUE param_count(VALUE self) {
148+
static VALUE rb_mysql_stmt_param_count(VALUE self) {
149149
GET_STATEMENT(self);
150150

151151
return ULL2NUM(mysql_stmt_param_count(stmt_wrapper->stmt));
@@ -155,13 +155,13 @@ static VALUE param_count(VALUE self) {
155155
*
156156
* Returns the number of fields the prepared statement returns.
157157
*/
158-
static VALUE field_count(VALUE self) {
158+
static VALUE rb_mysql_stmt_field_count(VALUE self) {
159159
GET_STATEMENT(self);
160160

161161
return UINT2NUM(mysql_stmt_field_count(stmt_wrapper->stmt));
162162
}
163163

164-
static void *nogvl_execute(void *ptr) {
164+
static void *nogvl_stmt_execute(void *ptr) {
165165
MYSQL_STMT *stmt = ptr;
166166

167167
if (mysql_stmt_execute(stmt)) {
@@ -246,7 +246,7 @@ static int my_big2ll(VALUE bignum, LONG_LONG *ptr)
246246
*
247247
* Executes the current prepared statement, returns +result+.
248248
*/
249-
static VALUE execute(int argc, VALUE *argv, VALUE self) {
249+
static VALUE rb_mysql_stmt_execute(int argc, VALUE *argv, VALUE self) {
250250
MYSQL_BIND *bind_buffers = NULL;
251251
unsigned long *length_buffers = NULL;
252252
unsigned long bind_count;
@@ -401,7 +401,7 @@ static VALUE execute(int argc, VALUE *argv, VALUE self) {
401401
}
402402
}
403403

404-
if ((VALUE)rb_thread_call_without_gvl(nogvl_execute, stmt, RUBY_UBF_IO, 0) == Qfalse) {
404+
if ((VALUE)rb_thread_call_without_gvl(nogvl_stmt_execute, stmt, RUBY_UBF_IO, 0) == Qfalse) {
405405
FREE_BINDS;
406406
rb_raise_mysql2_stmt_error(stmt_wrapper);
407407
}
@@ -449,7 +449,7 @@ static VALUE execute(int argc, VALUE *argv, VALUE self) {
449449
*
450450
* Returns a list of fields that will be returned by this statement.
451451
*/
452-
static VALUE fields(VALUE self) {
452+
static VALUE rb_mysql_stmt_fields(VALUE self) {
453453
MYSQL_FIELD *fields;
454454
MYSQL_RES *metadata;
455455
unsigned int field_count;
@@ -542,10 +542,10 @@ static VALUE rb_mysql_stmt_close(VALUE self) {
542542
void init_mysql2_statement() {
543543
cMysql2Statement = rb_define_class_under(mMysql2, "Statement", rb_cObject);
544544

545-
rb_define_method(cMysql2Statement, "param_count", param_count, 0);
546-
rb_define_method(cMysql2Statement, "field_count", field_count, 0);
547-
rb_define_method(cMysql2Statement, "_execute", execute, -1);
548-
rb_define_method(cMysql2Statement, "fields", fields, 0);
545+
rb_define_method(cMysql2Statement, "param_count", rb_mysql_stmt_param_count, 0);
546+
rb_define_method(cMysql2Statement, "field_count", rb_mysql_stmt_field_count, 0);
547+
rb_define_method(cMysql2Statement, "_execute", rb_mysql_stmt_execute, -1);
548+
rb_define_method(cMysql2Statement, "fields", rb_mysql_stmt_fields, 0);
549549
rb_define_method(cMysql2Statement, "last_id", rb_mysql_stmt_last_id, 0);
550550
rb_define_method(cMysql2Statement, "affected_rows", rb_mysql_stmt_affected_rows, 0);
551551
rb_define_method(cMysql2Statement, "close", rb_mysql_stmt_close, 0);

0 commit comments

Comments
 (0)