summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-08-29 09:56:57 +0800
committerluwenpeng <[email protected]>2024-08-30 18:55:14 +0800
commit419d12760ea8c83a981b3f00fc84427b385c8408 (patch)
treed61e2c54a8723c43f8ef8925f2b002912e96979d
parentce49357bbc12d96e2f471ab706983ec7dcac44b0 (diff)
refactor(deps): from *.cpp to *.c
-rw-r--r--deps/dablooms/CMakeLists.txt4
-rw-r--r--deps/dablooms/dablooms.c (renamed from deps/dablooms/dablooms.cpp)0
-rw-r--r--deps/dablooms/murmur.c (renamed from deps/dablooms/murmur.cpp)28
-rw-r--r--deps/dablooms/murmur.h9
-rw-r--r--deps/interval_tree/CMakeLists.txt2
-rw-r--r--deps/interval_tree/interval_tree.c (renamed from deps/interval_tree/interval_tree.cpp)0
-rw-r--r--deps/interval_tree/interval_tree_generic.h1
-rw-r--r--deps/rbtree/CMakeLists.txt2
-rw-r--r--deps/rbtree/rbtree.c (renamed from deps/rbtree/rbtree.cpp)0
-rw-r--r--deps/rbtree/rbtree.h1
-rw-r--r--deps/timeout/CMakeLists.txt2
-rw-r--r--deps/timeout/timeout-bitops.c (renamed from deps/timeout/timeout-bitops.cpp)0
-rw-r--r--deps/timeout/timeout.c (renamed from deps/timeout/timeout.cpp)2
-rw-r--r--deps/toml/CMakeLists.txt2
-rw-r--r--deps/toml/toml.c (renamed from deps/toml/toml.cpp)0
15 files changed, 32 insertions, 21 deletions
diff --git a/deps/dablooms/CMakeLists.txt b/deps/dablooms/CMakeLists.txt
index e0618d7..f8dee88 100644
--- a/deps/dablooms/CMakeLists.txt
+++ b/deps/dablooms/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_library(dablooms dablooms.cpp murmur.cpp)
+add_library(dablooms dablooms.c murmur.c)
target_include_directories(dablooms PUBLIC ${CMAKE_CURRENT_LIST_DIR})
-target_link_libraries(dablooms)
+target_link_libraries(dablooms m)
add_subdirectory(test) \ No newline at end of file
diff --git a/deps/dablooms/dablooms.cpp b/deps/dablooms/dablooms.c
index d6f8c4d..d6f8c4d 100644
--- a/deps/dablooms/dablooms.cpp
+++ b/deps/dablooms/dablooms.c
diff --git a/deps/dablooms/murmur.cpp b/deps/dablooms/murmur.c
index 83baeb4..02e942f 100644
--- a/deps/dablooms/murmur.cpp
+++ b/deps/dablooms/murmur.c
@@ -92,50 +92,50 @@ void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, vo
{
case 15:
k2 ^= ((uint64_t)tail[14]) << 48;
- [[fallthrough]];
+ /* fallthrough */
case 14:
k2 ^= ((uint64_t)tail[13]) << 40;
- [[fallthrough]];
+ /* fallthrough */
case 13:
k2 ^= ((uint64_t)tail[12]) << 32;
- [[fallthrough]];
+ /* fallthrough */
case 12:
k2 ^= ((uint64_t)tail[11]) << 24;
- [[fallthrough]];
+ /* fallthrough */
case 11:
k2 ^= ((uint64_t)tail[10]) << 16;
- [[fallthrough]];
+ /* fallthrough */
case 10:
k2 ^= ((uint64_t)tail[9]) << 8;
- [[fallthrough]];
+ /* fallthrough */
case 9:
k2 ^= ((uint64_t)tail[8]) << 0;
k2 *= c2;
k2 = ROTL64(k2, 33);
k2 *= c1;
h2 ^= k2;
- [[fallthrough]];
+ /* fallthrough */
case 8:
k1 ^= ((uint64_t)tail[7]) << 56;
- [[fallthrough]];
+ /* fallthrough */
case 7:
k1 ^= ((uint64_t)tail[6]) << 48;
- [[fallthrough]];
+ /* fallthrough */
case 6:
k1 ^= ((uint64_t)tail[5]) << 40;
- [[fallthrough]];
+ /* fallthrough */
case 5:
k1 ^= ((uint64_t)tail[4]) << 32;
- [[fallthrough]];
+ /* fallthrough */
case 4:
k1 ^= ((uint64_t)tail[3]) << 24;
- [[fallthrough]];
+ /* fallthrough */
case 3:
k1 ^= ((uint64_t)tail[2]) << 16;
- [[fallthrough]];
+ /* fallthrough */
case 2:
k1 ^= ((uint64_t)tail[1]) << 8;
- [[fallthrough]];
+ /* fallthrough */
case 1:
k1 ^= ((uint64_t)tail[0]) << 0;
k1 *= c1;
diff --git a/deps/dablooms/murmur.h b/deps/dablooms/murmur.h
index 6e3c133..f30ac3f 100644
--- a/deps/dablooms/murmur.h
+++ b/deps/dablooms/murmur.h
@@ -5,8 +5,17 @@
#ifndef _MURMURHASH3_H_
#define _MURMURHASH3_H_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include <stdint.h>
void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out);
+#ifdef __cplusplus
+}
+#endif
+
#endif // _MURMURHASH3_H_
diff --git a/deps/interval_tree/CMakeLists.txt b/deps/interval_tree/CMakeLists.txt
index 2b297fa..8553f14 100644
--- a/deps/interval_tree/CMakeLists.txt
+++ b/deps/interval_tree/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(interval_tree STATIC interval_tree.cpp)
+add_library(interval_tree STATIC interval_tree.c)
target_include_directories(interval_tree PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(interval_tree PUBLIC ${CMAKE_SOURCE_DIR}/deps/rbtree)
target_link_libraries(interval_tree rbtree)
diff --git a/deps/interval_tree/interval_tree.cpp b/deps/interval_tree/interval_tree.c
index da6d2c5..da6d2c5 100644
--- a/deps/interval_tree/interval_tree.cpp
+++ b/deps/interval_tree/interval_tree.c
diff --git a/deps/interval_tree/interval_tree_generic.h b/deps/interval_tree/interval_tree_generic.h
index bf452c8..0c04395 100644
--- a/deps/interval_tree/interval_tree_generic.h
+++ b/deps/interval_tree/interval_tree_generic.h
@@ -12,6 +12,7 @@ extern "C"
{
#endif
+#include <stdbool.h>
#include "rbtree_augmented.h"
/*
diff --git a/deps/rbtree/CMakeLists.txt b/deps/rbtree/CMakeLists.txt
index c7debda..c67f638 100644
--- a/deps/rbtree/CMakeLists.txt
+++ b/deps/rbtree/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_library(rbtree STATIC rbtree.cpp)
+add_library(rbtree STATIC rbtree.c)
target_include_directories(rbtree PUBLIC ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file
diff --git a/deps/rbtree/rbtree.cpp b/deps/rbtree/rbtree.c
index 2365dcd..2365dcd 100644
--- a/deps/rbtree/rbtree.cpp
+++ b/deps/rbtree/rbtree.c
diff --git a/deps/rbtree/rbtree.h b/deps/rbtree/rbtree.h
index 3f9b49a..521d652 100644
--- a/deps/rbtree/rbtree.h
+++ b/deps/rbtree/rbtree.h
@@ -22,6 +22,7 @@ extern "C"
{
#endif
+#include <stdbool.h>
#include <stdlib.h>
struct rb_node
diff --git a/deps/timeout/CMakeLists.txt b/deps/timeout/CMakeLists.txt
index c105544..af4acd2 100644
--- a/deps/timeout/CMakeLists.txt
+++ b/deps/timeout/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_library(timeout STATIC timeout.cpp timeout-bitops.cpp)
+add_library(timeout STATIC timeout.c timeout-bitops.c)
target_include_directories(timeout PUBLIC ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file
diff --git a/deps/timeout/timeout-bitops.cpp b/deps/timeout/timeout-bitops.c
index 6fb057f..6fb057f 100644
--- a/deps/timeout/timeout-bitops.cpp
+++ b/deps/timeout/timeout-bitops.c
diff --git a/deps/timeout/timeout.cpp b/deps/timeout/timeout.c
index a2d57b6..d1e76e4 100644
--- a/deps/timeout/timeout.cpp
+++ b/deps/timeout/timeout.c
@@ -136,7 +136,7 @@
#define WHEEL_MASK (WHEEL_LEN - 1)
#define TIMEOUT_MAX ((TIMEOUT_C(1) << (WHEEL_BIT * WHEEL_NUM)) - 1)
-#include "timeout-bitops.cpp"
+#include "timeout-bitops.c"
#if WHEEL_BIT == 6
#define ctz(n) ctz64(n)
diff --git a/deps/toml/CMakeLists.txt b/deps/toml/CMakeLists.txt
index 4c02fa1..0c77b1d 100644
--- a/deps/toml/CMakeLists.txt
+++ b/deps/toml/CMakeLists.txt
@@ -1,3 +1,3 @@
-add_library(toml toml.cpp)
+add_library(toml toml.c)
target_include_directories(toml PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(toml) \ No newline at end of file
diff --git a/deps/toml/toml.cpp b/deps/toml/toml.c
index b814a7c..b814a7c 100644
--- a/deps/toml/toml.cpp
+++ b/deps/toml/toml.c