Skip to content

Commit 034dc40

Browse files
committed
Use casts for finicky comparison signedness
1 parent c89b21b commit 034dc40

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/mysql2/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static VALUE rb_connect(VALUE self, VALUE user, VALUE pass, VALUE host, VALUE po
349349
/* avoid an early timeout due to time truncating milliseconds off the start time */
350350
if (elapsed_time > 0)
351351
elapsed_time--;
352-
if (elapsed_time >= wrapper->connect_timeout)
352+
if (elapsed_time >= (time_t)wrapper->connect_timeout)
353353
break;
354354
connect_timeout = wrapper->connect_timeout - elapsed_time;
355355
mysql_options(wrapper->client, MYSQL_OPT_CONNECT_TIMEOUT, &connect_timeout);

ext/mysql2/result.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ static VALUE rb_mysql_result_fetch_fields(VALUE self) {
747747
wrapper->fields = rb_ary_new2(wrapper->numberOfFields);
748748
}
749749

750-
if (RARRAY_LEN(wrapper->fields) != wrapper->numberOfFields) {
750+
if ((unsigned)RARRAY_LEN(wrapper->fields) != wrapper->numberOfFields) {
751751
for (i=0; i<wrapper->numberOfFields; i++) {
752752
rb_mysql_result_fetch_field(self, i, symbolizeKeys);
753753
}

0 commit comments

Comments
 (0)