Skip to content

Commit 20914c5

Browse files
authored
fix: Remove compiler warnings (#225)
* chore: add .ruby-version file and update version in GH workflow * fix: add `pragma once` to `logs.hpp` * fix: remove unused variables * chore: rename LOG_TAG * remove LOG_TAG from CMakeLists.txt
1 parent 06f8c9d commit 20914c5

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

package/android/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ endif()
6666
target_compile_options(
6767
${CMAKE_PROJECT_NAME}
6868
PRIVATE
69-
-DLOG_TAG=\"ReactNative\"
7069
-fexceptions
7170
-frtti
7271
-fstack-protector-all

package/cpp/logs.hpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
1+
#pragma once
2+
3+
#define NITRO_SQLITE_LOG_TAG "react-native-nitro-sqlite"
4+
15
#ifdef ANDROID
26
// LOGS ANDROID
37
#include <android/log.h>
4-
#define LOG_TAG "react-native-nitro-sqlite"
5-
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
6-
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
7-
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
8-
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
9-
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
8+
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, NITRO_SQLITE_LOG_TAG, __VA_ARGS__)
9+
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, NITRO_SQLITE_LOG_TAG, __VA_ARGS__)
10+
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, NITRO_SQLITE_LOG_TAG, __VA_ARGS__)
11+
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, NITRO_SQLITE_LOG_TAG, __VA_ARGS__)
12+
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, NITRO_SQLITE_LOG_TAG, __VA_ARGS__)
1013
#define LOGSIMPLE(...)
1114
#else
1215
// LOGS NO ANDROID
1316
#include <stdio.h>
14-
#define LOG_TAG "react-native-nitro-sqlite"
1517
#define LOGV(...) \
1618
printf(" "); \
1719
printf(__VA_ARGS__); \
18-
printf("\t - <%s> \n", LOG_TAG);
20+
printf("\t - <%s> \n", NITRO_SQLITE_LOG_TAG);
1921
#define LOGD(...) \
2022
printf(" "); \
2123
printf(__VA_ARGS__); \
22-
printf("\t - <%s> \n", LOG_TAG);
24+
printf("\t - <%s> \n", NITRO_SQLITE_LOG_TAG);
2325
#define LOGI(...) \
2426
printf(" "); \
2527
printf(__VA_ARGS__); \
26-
printf("\t - <%s> \n", LOG_TAG);
28+
printf("\t - <%s> \n", NITRO_SQLITE_LOG_TAG);
2729
#define LOGW(...) \
2830
printf(" * Warning: "); \
2931
printf(__VA_ARGS__); \
30-
printf("\t - <%s> \n", LOG_TAG);
32+
printf("\t - <%s> \n", NITRO_SQLITE_LOG_TAG);
3133
#define LOGE(...) \
3234
printf(" *** Error: "); \
3335
printf(__VA_ARGS__); \
34-
printf("\t - <%s> \n", LOG_TAG);
36+
printf("\t - <%s> \n", NITRO_SQLITE_LOG_TAG);
3537
#define LOGSIMPLE(...) \
3638
printf(" "); \
3739
printf(__VA_ARGS__);

package/cpp/operations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std:
257257
bool isConsuming = true;
258258
bool isFailed = false;
259259

260-
int result, i, count, column_type;
260+
int result;
261261
std::string column_name;
262262

263263
while (isConsuming) {

0 commit comments

Comments
 (0)