Skip to content

Commit a85e09d

Browse files
committed
ext: address int-to-long compiler warnings on darwin/clang
1 parent 86a2fdd commit a85e09d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/sqlite3/database.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static VALUE total_changes(VALUE self)
127127
Data_Get_Struct(self, sqlite3Ruby, ctx);
128128
REQUIRE_OPEN_DB(ctx);
129129

130-
return INT2NUM((long)sqlite3_total_changes(ctx->db));
130+
return INT2NUM(sqlite3_total_changes(ctx->db));
131131
}
132132

133133
static void tracefunc(void * data, const char *sql)
@@ -168,7 +168,7 @@ static int rb_sqlite3_busy_handler(void * ctx, int count)
168168
{
169169
VALUE self = (VALUE)(ctx);
170170
VALUE handle = rb_iv_get(self, "@busy_handler");
171-
VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
171+
VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM(count));
172172

173173
if(Qfalse == result) return 0;
174174

@@ -413,7 +413,7 @@ static VALUE errcode_(VALUE self)
413413
Data_Get_Struct(self, sqlite3Ruby, ctx);
414414
REQUIRE_OPEN_DB(ctx);
415415

416-
return INT2NUM((long)sqlite3_errcode(ctx->db));
416+
return INT2NUM(sqlite3_errcode(ctx->db));
417417
}
418418

419419
/* call-seq: complete?(sql)

ext/sqlite3/statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static VALUE column_count(VALUE self)
348348
Data_Get_Struct(self, sqlite3StmtRuby, ctx);
349349
REQUIRE_OPEN_STMT(ctx);
350350

351-
return INT2NUM((long)sqlite3_column_count(ctx->st));
351+
return INT2NUM(sqlite3_column_count(ctx->st));
352352
}
353353

354354
/* call-seq: stmt.column_name(index)
@@ -397,7 +397,7 @@ static VALUE bind_parameter_count(VALUE self)
397397
Data_Get_Struct(self, sqlite3StmtRuby, ctx);
398398
REQUIRE_OPEN_STMT(ctx);
399399

400-
return INT2NUM((long)sqlite3_bind_parameter_count(ctx->st));
400+
return INT2NUM(sqlite3_bind_parameter_count(ctx->st));
401401
}
402402

403403
#ifdef HAVE_SQLITE3_COLUMN_DATABASE_NAME

0 commit comments

Comments
 (0)