Skip to content

Commit c1dcead

Browse files
committed
typedef fetch_row_func for clarity
1 parent e2f116f commit c1dcead

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ext/mysql2/result.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ typedef struct {
6666
VALUE block_given;
6767
} result_each_args;
6868

69+
typedef VALUE (*fetch_row_func_t)(VALUE, MYSQL_FIELD *fields, const result_each_args *args);
70+
6971
VALUE cBigDecimal, cDateTime, cDate;
7072
static VALUE cMysql2Result;
7173
static VALUE opt_decimal_zero, opt_float_zero, opt_time_year, opt_time_month, opt_utc_offset;
@@ -804,8 +806,8 @@ static VALUE rb_mysql_result_element(int argc, VALUE * argv, VALUE self) {
804806
MYSQL_FIELD *fields = NULL;
805807
VALUE seek, count, row, rows;
806808
long i, c_seek, c_count = 0;
807-
VALUE (*fetch_row_func)(VALUE, MYSQL_FIELD *fields, const result_each_args *args);
808809
VALUE block, opts;
810+
fetch_row_func_t fetch_row_func;
809811

810812
GET_RESULT(self);
811813

@@ -880,7 +882,7 @@ static VALUE rb_mysql_result_element(int argc, VALUE * argv, VALUE self) {
880882
}
881883

882884
static VALUE rb_mysql_result_each_(VALUE self,
883-
VALUE(*fetch_row_func)(VALUE, MYSQL_FIELD *fields, const result_each_args *args),
885+
fetch_row_func_t fetch_row_func,
884886
const result_each_args *args)
885887
{
886888
unsigned long i;
@@ -970,8 +972,8 @@ static VALUE rb_mysql_result_each_(VALUE self,
970972

971973
static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) {
972974
result_each_args args;
973-
VALUE (*fetch_row_func)(VALUE, MYSQL_FIELD *fields, const result_each_args *args);
974975
VALUE opts, block;
976+
fetch_row_func_t fetch_row_func;
975977

976978
GET_RESULT(self);
977979

0 commit comments

Comments
 (0)