[tarantool-patches] Re: [PATCH v1 1/1] sql: drop useless code from os_unix.c

Kirill Shcherbatov kshcherbatov at tarantool.org
Mon Jul 2 17:55:25 MSK 2018


> Hello. Thanks for the patch! See 2 comments below.
Hi! Thank you for review and fixes.

> 1. These functions still are visible in grep results.
> 2. And much more functions and constants are either unused, or just
> declared, but has no implementation. Please, complete the patch. I have
> pushed some of removals on the branch as a separate commit. Please,
> squash and finalize.
I've find a few functions to drop. Is it enough?

diff --git a/src/box/sql/os.c b/src/box/sql/os.c
index bec868b..7c11318 100644
--- a/src/box/sql/os.c
+++ b/src/box/sql/os.c
@@ -70,11 +70,7 @@ int sqlite3_open_file_count = 0;
  *
  *     sqlite3OsRead()
  *     sqlite3OsWrite()
- *     sqlite3OsShmMap()
  *     sqlite3OsOpen()
- *     sqlite3OsDelete()
- *     sqlite3OsAccess()
- *     sqlite3OsFullPathname()
  *
  */
 #if defined(SQLITE_TEST)
diff --git a/src/box/sql/os.h b/src/box/sql/os.h
index aaadd80..9476583 100644
--- a/src/box/sql/os.h
+++ b/src/box/sql/os.h
@@ -41,13 +41,6 @@
 #ifndef _SQLITE_OS_H_
 #define _SQLITE_OS_H_
 
-/* If the SET_FULLSYNC macro is not defined above, then make it
- * a no-op
- */
-#ifndef SET_FULLSYNC
-#define SET_FULLSYNC(x,y)
-#endif
-
 /*
  * The default size of a disk sector
  */
@@ -128,11 +121,7 @@
  * 1GB boundary.
  *
  */
-#ifdef SQLITE_OMIT_WSD
-#define PENDING_BYTE     (0x40000000)
-#else
 #define PENDING_BYTE      sqlite3PendingByte
-#endif
 #define RESERVED_BYTE     (PENDING_BYTE+1)
 #define SHARED_FIRST      (PENDING_BYTE+2)
 #define SHARED_SIZE       510
@@ -149,12 +138,6 @@ void sqlite3OsClose(sqlite3_file *);
 int sqlite3OsRead(sqlite3_file *, void *, int amt, i64 offset);
 int sqlite3OsWrite(sqlite3_file *, const void *, int amt, i64 offset);
 void sqlite3OsFileControlHint(sqlite3_file *, int, void *);
-#define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0
-int sqlite3OsDeviceCharacteristics(sqlite3_file * id);
-int sqlite3OsShmMap(sqlite3_file *, int, int, int, void volatile **);
-int sqlite3OsShmLock(sqlite3_file * id, int, int, int);
-void sqlite3OsShmBarrier(sqlite3_file * id);
-int sqlite3OsShmUnmap(sqlite3_file * id, int);
 int sqlite3OsFetch(sqlite3_file * id, i64, int, void **);
 int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
 
@@ -162,14 +145,6 @@ int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
  * Functions for accessing sqlite3_vfs methods
  */
 int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int *);
-int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
-int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut);
-int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
-#ifndef SQLITE_OMIT_LOAD_EXTENSION
-void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
-void sqlite3OsDlError(sqlite3_vfs *, int, char *);
-void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *)) (void);
-#endif				/* SQLITE_OMIT_LOAD_EXTENSION */
 int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
 int sqlite3OsSleep(sqlite3_vfs *, int);
 int sqlite3OsGetLastError(sqlite3_vfs *);
diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
index 5fb29c7..334a257 100644
--- a/src/box/sql/pragma.c
+++ b/src/box/sql/pragma.c
@@ -43,14 +43,6 @@
 #include "box/schema.h"
 #include "box/session.h"
 
-#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
-#if defined(__APPLE__)
-#define SQLITE_ENABLE_LOCKING_STYLE 1
-#else
-#define SQLITE_ENABLE_LOCKING_STYLE 0
-#endif
-#endif
-
 /*
  ************************************************************************
  * pragma.h contains several pragmas, including utf's pragmas.






More information about the Tarantool-patches mailing list