Skip to content

Commit

Permalink
Reapply void* arithmetic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bpvgoncalves committed Aug 21, 2024
1 parent e7a0ad8 commit 3dc551d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vendor/sqlite3/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -107284,11 +107284,11 @@ static void sqlcipher_mlock(void *ptr, sqlite_uint64 sz) {

if(ptr == NULL || sz == 0) return;

sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: calling mlock(%p,%lu); _SC_PAGESIZE=%lu", ptr - offset, sz + offset, pagesize);
rc = mlock(ptr - offset, sz + offset);
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: calling mlock(%p,%lu); _SC_PAGESIZE=%lu", (unsigned long) ptr - offset, sz + offset, pagesize);
rc = mlock((int *)(unsigned long) ptr - offset, sz + offset);
if(rc!=0) {
sqlcipher_log(SQLCIPHER_LOG_ERROR, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: mlock() returned %d errno=%d", rc, errno);
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: mlock(%p,%lu) returned %d errno=%d", ptr - offset, sz + offset, rc, errno);
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_mlock: mlock(%p,%lu) returned %d errno=%d", (unsigned long) ptr - offset, sz + offset, rc, errno);
}
#elif defined(_WIN32)
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_PC_APP))
Expand All @@ -107313,10 +107313,10 @@ static void sqlcipher_munlock(void *ptr, sqlite_uint64 sz) {

if(ptr == NULL || sz == 0) return;

sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_munlock: calling munlock(%p,%lu)", ptr - offset, sz + offset);
rc = munlock(ptr - offset, sz + offset);
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MEMORY, "sqlcipher_munlock: calling munlock(%p,%lu)", (unsigned long) ptr - offset, sz + offset);
rc = munlock((int *)(unsigned long) ptr - offset, sz + offset);
if(rc!=0) {
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_munlock: munlock(%p,%lu) returned %d errno=%d", ptr - offset, sz + offset, rc, errno);
sqlcipher_log(SQLCIPHER_LOG_INFO, SQLCIPHER_LOG_MEMORY, "sqlcipher_munlock: munlock(%p,%lu) returned %d errno=%d", (unsigned long) ptr - offset, sz + offset, rc, errno);
}
#elif defined(_WIN32)
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_PC_APP))
Expand Down

0 comments on commit 3dc551d

Please sign in to comment.