From 003aa8a31a13bc280acea1fce4ec1ddd1cdbbaeb Mon Sep 17 00:00:00 2001 From: Chris Parker Date: Mon, 22 Feb 2016 01:03:40 -0600 Subject: [PATCH 1/2] Fixed issue #42 Mac OS X hash.c issue. --- c_src/sqlite3_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index 16f945d..c847337 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -94,7 +94,7 @@ static void driver_free_binary_fun(void *ptr) { } // sdbm from http://www.cse.yorku.ca/~oz/hash.html -unsigned int hash(const char *str) { +unsigned int do_hash(const char *str) { unsigned int hash = 0; unsigned int c = 0; @@ -113,7 +113,7 @@ static inline unsigned int sql_async_key(char *db_name, ErlDrvPort port) { const char *memory_db_name = ":memory:"; if (strcmp(db_name, memory_db_name)) { - return hash(db_name); + return do_hash(db_name); } else { #if ERL_DRV_EXTENDED_MAJOR_VERSION > 2 || \ (ERL_DRV_EXTENDED_MAJOR_VERSION == 2 && ERL_DRV_EXTENDED_MINOR_VERSION >= 2) From b054133c87ec141b42302d777063063f101f57cb Mon Sep 17 00:00:00 2001 From: Aram Antonyan Date: Mon, 9 May 2016 18:19:53 +0000 Subject: [PATCH 2/2] Fixed compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When you compile project it returns following warning: > c_src/sqlite3_drv.c: In function ‘exec_async_command’: > c_src/sqlite3_drv.c:459:7: warning: too many arguments for format > [-Wformat-extra-args] LOG_ERROR("driver_async call failed", 0); This patch fixes mentioned warning. --- c_src/sqlite3_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index c847337..f52ba45 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -456,7 +456,7 @@ static inline void exec_async_command( // see https://groups.google.com/d/msg/erlang-programming/XiFR6xxhGos/B6ARBIlvpMUJ if (status < 0) { - LOG_ERROR("driver_async call failed", 0); + LOG_ERROR("driver_async call failed: %ld", status); output_error(drv, SQLITE_ERROR, "driver_async call failed"); } } else {