From b0f95b77744b7444524741a660bf46b4b2867e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Wed, 18 Sep 2013 13:31:17 +0200 Subject: [PATCH] use Erlang typedefs instead of hardcoded types for example, on Linux x86_64, ErlDrvSSizeT is long, not int --- c_src/sqlite3_drv.c | 4 ++-- c_src/sqlite3_drv.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index c24fb9e..fa29b41 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -148,9 +148,9 @@ static void stop(ErlDrvData handle) { } // Handle input from Erlang VM -static int control( +static ErlDrvSSizeT control( ErlDrvData drv_data, unsigned int command, char *buf, - int len, char **rbuf, int rlen) { + ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) { sqlite3_drv_t* driver_data = (sqlite3_drv_t*) drv_data; switch (command) { case CMD_SQL_EXEC: diff --git a/c_src/sqlite3_drv.h b/c_src/sqlite3_drv.h index 01ddeb4..f5c0f04 100644 --- a/c_src/sqlite3_drv.h +++ b/c_src/sqlite3_drv.h @@ -97,8 +97,8 @@ typedef struct async_sqlite3_command { static ErlDrvData start(ErlDrvPort port, char* cmd); static void stop(ErlDrvData handle); -static int control(ErlDrvData drv_data, unsigned int command, char *buf, - int len, char **rbuf, int rlen); +static ErlDrvSSizeT control(ErlDrvData drv_data, unsigned int command, char *buf, + ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen); static int sql_exec(sqlite3_drv_t *drv, char *buf, int len); static int sql_bind_and_exec(sqlite3_drv_t *drv, char *buf, int len); static int sql_exec_script(sqlite3_drv_t *drv, char *buf, int len);