Skip to content

Commit 9249f54

Browse files
committed
correct warnings for UAP builds
1 parent 537dcf7 commit 9249f54

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/crypto.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
336336
if( sqlite3StrICmp(zLeft,"cipher_hmac_algorithm")==0 ){
337337
if(ctx) {
338338
if(zRight) {
339-
int rc = SQLITE_ERROR;
339+
rc = SQLITE_ERROR;
340340
if(sqlite3StrICmp(zRight, SQLCIPHER_HMAC_SHA1_LABEL) == 0) {
341341
rc = sqlcipher_codec_ctx_set_hmac_algorithm(ctx, SQLCIPHER_HMAC_SHA1);
342342
} else if(sqlite3StrICmp(zRight, SQLCIPHER_HMAC_SHA256_LABEL) == 0) {
@@ -361,7 +361,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
361361
}else
362362
if( sqlite3StrICmp(zLeft,"cipher_default_hmac_algorithm")==0 ){
363363
if(zRight) {
364-
int rc = SQLITE_ERROR;
364+
rc = SQLITE_ERROR;
365365
if(sqlite3StrICmp(zRight, SQLCIPHER_HMAC_SHA1_LABEL) == 0) {
366366
rc = sqlcipher_set_default_hmac_algorithm(SQLCIPHER_HMAC_SHA1);
367367
} else if(sqlite3StrICmp(zRight, SQLCIPHER_HMAC_SHA256_LABEL) == 0) {
@@ -384,7 +384,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
384384
if( sqlite3StrICmp(zLeft,"cipher_kdf_algorithm")==0 ){
385385
if(ctx) {
386386
if(zRight) {
387-
int rc = SQLITE_ERROR;
387+
rc = SQLITE_ERROR;
388388
if(sqlite3StrICmp(zRight, SQLCIPHER_PBKDF2_HMAC_SHA1_LABEL) == 0) {
389389
rc = sqlcipher_codec_ctx_set_kdf_algorithm(ctx, SQLCIPHER_PBKDF2_HMAC_SHA1);
390390
} else if(sqlite3StrICmp(zRight, SQLCIPHER_PBKDF2_HMAC_SHA256_LABEL) == 0) {
@@ -407,7 +407,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
407407
}else
408408
if( sqlite3StrICmp(zLeft,"cipher_default_kdf_algorithm")==0 ){
409409
if(zRight) {
410-
int rc = SQLITE_ERROR;
410+
rc = SQLITE_ERROR;
411411
if(sqlite3StrICmp(zRight, SQLCIPHER_PBKDF2_HMAC_SHA1_LABEL) == 0) {
412412
rc = sqlcipher_set_default_kdf_algorithm(SQLCIPHER_PBKDF2_HMAC_SHA1);
413413
} else if(sqlite3StrICmp(zRight, SQLCIPHER_PBKDF2_HMAC_SHA256_LABEL) == 0) {

src/crypto_impl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ int sqlcipher_memcmp(const void *v0, const void *v1, int len) {
301301

302302
void sqlcipher_mlock(void *ptr, int sz) {
303303
#ifndef OMIT_MEMLOCK
304-
int rc;
305304
#if defined(__unix__) || defined(__APPLE__)
305+
int rc;
306306
unsigned long pagesize = sysconf(_SC_PAGESIZE);
307307
unsigned long offset = (unsigned long) ptr % pagesize;
308308

@@ -315,6 +315,7 @@ void sqlcipher_mlock(void *ptr, int sz) {
315315
}
316316
#elif defined(_WIN32)
317317
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
318+
int rc;
318319
CODEC_TRACE("sqlcipher_mem_lock: calling VirtualLock(%p,%d)\n", ptr, sz);
319320
rc = VirtualLock(ptr, sz);
320321
if(rc==0) {
@@ -327,8 +328,8 @@ void sqlcipher_mlock(void *ptr, int sz) {
327328

328329
void sqlcipher_munlock(void *ptr, int sz) {
329330
#ifndef OMIT_MEMLOCK
330-
int rc;
331331
#if defined(__unix__) || defined(__APPLE__)
332+
int rc;
332333
unsigned long pagesize = sysconf(_SC_PAGESIZE);
333334
unsigned long offset = (unsigned long) ptr % pagesize;
334335

@@ -341,6 +342,7 @@ void sqlcipher_munlock(void *ptr, int sz) {
341342
}
342343
#elif defined(_WIN32)
343344
#if !(defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP))
345+
int rc;
344346
CODEC_TRACE("sqlcipher_mem_lock: calling VirtualUnlock(%p,%d)\n", ptr, sz);
345347
rc = VirtualUnlock(ptr, sz);
346348
if(!rc) {

0 commit comments

Comments
 (0)