@@ -133,7 +133,7 @@ static VALUE rb_raise_mysql2_error(mysql_client_wrapper *wrapper) {
133
133
134
134
static void * nogvl_init (void * ptr ) {
135
135
MYSQL * client ;
136
- mysql_client_wrapper * wrapper = ( mysql_client_wrapper * ) ptr ;
136
+ mysql_client_wrapper * wrapper = ptr ;
137
137
138
138
/* may initialize embedded server and read /etc/services off disk */
139
139
client = mysql_init (wrapper -> client );
@@ -224,7 +224,7 @@ static void *nogvl_close(void *ptr) {
224
224
225
225
/* this is called during GC */
226
226
static void rb_mysql_client_free (void * ptr ) {
227
- mysql_client_wrapper * wrapper = ( mysql_client_wrapper * ) ptr ;
227
+ mysql_client_wrapper * wrapper = ptr ;
228
228
decr_mysql2_client (wrapper );
229
229
}
230
230
@@ -437,10 +437,9 @@ static void *nogvl_read_query_result(void *ptr) {
437
437
}
438
438
439
439
static void * nogvl_do_result (void * ptr , char use_result ) {
440
- mysql_client_wrapper * wrapper ;
440
+ mysql_client_wrapper * wrapper = ptr ;
441
441
MYSQL_RES * result ;
442
442
443
- wrapper = (mysql_client_wrapper * )ptr ;
444
443
if (use_result ) {
445
444
result = mysql_use_result (wrapper -> client );
446
445
} else {
@@ -533,14 +532,13 @@ static VALUE disconnect_and_raise(VALUE self, VALUE error) {
533
532
}
534
533
535
534
static VALUE do_query (void * args ) {
536
- struct async_query_args * async_args ;
535
+ struct async_query_args * async_args = args ;
537
536
struct timeval tv ;
538
537
struct timeval * tvp ;
539
538
long int sec ;
540
539
int retval ;
541
540
VALUE read_timeout ;
542
541
543
- async_args = (struct async_query_args * )args ;
544
542
read_timeout = rb_iv_get (async_args -> self , "@read_timeout" );
545
543
546
544
tvp = NULL ;
@@ -578,11 +576,9 @@ static VALUE do_query(void *args) {
578
576
}
579
577
#else
580
578
static VALUE finish_and_mark_inactive (void * args ) {
581
- VALUE self ;
579
+ VALUE self = args ;
582
580
MYSQL_RES * result ;
583
581
584
- self = (VALUE )args ;
585
-
586
582
GET_CLIENT (self );
587
583
588
584
if (!NIL_P (wrapper -> active_thread )) {
0 commit comments