From 49555ec0da0816ef0f8649106f2239e371e87777 Mon Sep 17 00:00:00 2001 From: tobozo Date: Thu, 12 Oct 2023 13:04:32 +0000 Subject: [PATCH 1/2] Fix for compilation error ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Open(sqlite3_vfs*, const char*, sqlite3_file*, int, int*)': ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:457:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int') 457 | if( p->fp<=0){ | ~~~~~^~~ ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Delete(sqlite3_vfs*, const char*, int)': ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:499:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int') 499 | if( dfd<=0 ){ | ~~~^~~ --- src/esp32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esp32.cpp b/src/esp32.cpp index 3774401..fccc8a0 100644 --- a/src/esp32.cpp +++ b/src/esp32.cpp @@ -447,7 +447,7 @@ static int ESP32Open( //p->fd = open(zName, oflags, 0600); //p->fd = open(zName, oflags, S_IRUSR | S_IWUSR); p->fp = fopen(zName, mode); - if( p->fp<=0){ + if( p->fp == (void *)NULL ) { if (aBuf) sqlite3_free(aBuf); //Serial.println("Can't open"); @@ -489,7 +489,7 @@ static int ESP32Delete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ /* Open a file-descriptor on the directory. Sync. Close. */ dfd = fopen(zDir, "r"); - if( dfd<=0 ){ + if( dfd == (void *)NULL ){ rc = -1; }else{ rc = fflush(dfd); From 9b85a1dfc94d84eadc98e3efb9a91fe16e8a8616 Mon Sep 17 00:00:00 2001 From: tobozo Date: Thu, 12 Oct 2023 13:06:15 +0000 Subject: [PATCH 2/2] Fix for compilation error xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:60: multiple definition of `c_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:36: first defined here xtensa-esp32s3-elf/bin/ld: /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(unishox1.c.o):~/Arduino/libraries/Sqlite3Esp32/src/unishox1.c:61: multiple definition of `l_95'; /tmp/arduino/sketches/187BF6CB77363D60470B1CC6568AB0AA/libraries/Sqlite3Esp32/objs.a(shox96_0_2.cpp.o):~/Arduino/libraries/Sqlite3Esp32/src/shox96_0_2.cpp:37: first defined here collect2: error: ld returned 1 exit status --- src/shox96_0_2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shox96_0_2.cpp b/src/shox96_0_2.cpp index d6cf987..95d4556 100755 --- a/src/shox96_0_2.cpp +++ b/src/shox96_0_2.cpp @@ -33,10 +33,10 @@ typedef unsigned char byte; -unsigned int c_95[95] = {16384, 16256, 15744, 16192, 15328, 15344, 15360, 16064, 15264, 15296, 15712, 15200, 14976, 15040, 14848, 15104, 14528, 14592, 14656, 14688, 14720, 14752, 14784, 14816, 14832, 14464, 15552, 15488, 15616, 15168, 15680, 16000, 15872, 10752, 8576, 8192, 8320, 9728, 8672, 8608, 8384, 11264, 9024, 8992, 12160, 8544, 11520, 11008, 8512, 9008, 12032, 11776, 10240, 8448, 8960, 8640, 9040, 8688, 9048, 15840, 16288, 15856, 16128, 16224, 16368, 40960, 6144, 0, 2048, 24576, 7680, 6656, 3072, 49152, 13312, 12800, 63488, 5632, 53248, 45056, 5120, 13056, 61440, 57344, 32768, 4096, 12288, 7168, 13568, 7936, 13696, 15776, 16320, 15808, 16352}; -unsigned char l_95[95] = { 3, 11, 11, 11, 12, 12, 9, 10, 11, 11, 11, 11, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 10, 10, 10, 10, 11, 11, 10, 9, 8, 11, 9, 10, 7, 12, 11, 10, 8, 12, 12, 9, 11, 8, 8, 11, 12, 9, 8, 7, 10, 11, 11, 13, 12, 13, 12, 11, 12, 10, 11, 12, 4, 7, 5, 6, 3, 8, 7, 6, 4, 8, 8, 5, 7, 4, 4, 7, 8, 5, 4, 3, 6, 7, 7, 9, 8, 9, 11, 11, 11, 12}; +static unsigned int c_95[95] = {16384, 16256, 15744, 16192, 15328, 15344, 15360, 16064, 15264, 15296, 15712, 15200, 14976, 15040, 14848, 15104, 14528, 14592, 14656, 14688, 14720, 14752, 14784, 14816, 14832, 14464, 15552, 15488, 15616, 15168, 15680, 16000, 15872, 10752, 8576, 8192, 8320, 9728, 8672, 8608, 8384, 11264, 9024, 8992, 12160, 8544, 11520, 11008, 8512, 9008, 12032, 11776, 10240, 8448, 8960, 8640, 9040, 8688, 9048, 15840, 16288, 15856, 16128, 16224, 16368, 40960, 6144, 0, 2048, 24576, 7680, 6656, 3072, 49152, 13312, 12800, 63488, 5632, 53248, 45056, 5120, 13056, 61440, 57344, 32768, 4096, 12288, 7168, 13568, 7936, 13696, 15776, 16320, 15808, 16352}; +static unsigned char l_95[95] = { 3, 11, 11, 11, 12, 12, 9, 10, 11, 11, 11, 11, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 10, 10, 10, 10, 11, 11, 10, 9, 8, 11, 9, 10, 7, 12, 11, 10, 8, 12, 12, 9, 11, 8, 8, 11, 12, 9, 8, 7, 10, 11, 11, 13, 12, 13, 12, 11, 12, 10, 11, 12, 4, 7, 5, 6, 3, 8, 7, 6, 4, 8, 8, 5, 7, 4, 4, 7, 8, 5, 4, 3, 6, 7, 7, 9, 8, 9, 11, 11, 11, 12}; //unsigned char c[] = { ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'}; -char SET2_STR[] = {'9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '.', ',', '-', '/', '=', '+', ' ', '(', ')', '$', '%', '&', ';', ':', '<', '>', '*', '"', '{', '}', '[', ']', '@', '?', '\'', '^', '#', '_', '!', '\\', '|', '~', '`', '\0'}; +static char SET2_STR[] = {'9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '.', ',', '-', '/', '=', '+', ' ', '(', ')', '$', '%', '&', ';', ':', '<', '>', '*', '"', '{', '}', '[', ']', '@', '?', '\'', '^', '#', '_', '!', '\\', '|', '~', '`', '\0'}; enum {SHX_STATE_1 = 1, SHX_STATE_2};