[Tarantool-patches] [PATCH 13/17] recovery: cxx to c transition

Cyrill Gorcunov gorcunov at gmail.com
Tue Apr 28 19:11:33 MSK 2020


We're ready now to compile the recovery
code in plain C mode.

Part of #3794

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/CMakeLists.txt              |  2 +-
 src/box/{recovery.cc => recovery.c} | 15 +++++++++------
 src/box/recovery.h                  |  8 ++++----
 3 files changed, 14 insertions(+), 11 deletions(-)
 rename src/box/{recovery.cc => recovery.c} (98%)

diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt
index c931ecdfe..34febf026 100644
--- a/src/box/CMakeLists.txt
+++ b/src/box/CMakeLists.txt
@@ -131,7 +131,7 @@ add_library(box STATIC
     user.cc
     authentication.cc
     replication.cc
-    recovery.cc
+    recovery.c
     xstream.cc
     applier.cc
     relay.cc
diff --git a/src/box/recovery.cc b/src/box/recovery.c
similarity index 98%
rename from src/box/recovery.cc
rename to src/box/recovery.c
index 1b5b51b7f..510235ac1 100644
--- a/src/box/recovery.cc
+++ b/src/box/recovery.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2016, Tarantool AUTHORS, please see AUTHORS file.
+ * Copyright 2010-2020, Tarantool AUTHORS, please see AUTHORS file.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
@@ -30,11 +30,8 @@
  */
 #include "recovery.h"
 
-#include "small/rlist.h"
-#include "scoped_guard.h"
 #include "trigger.h"
 #include "fiber.h"
-#include "xlog.h"
 #include "xrow.h"
 #include "xstream.h"
 #include "wal.h" /* wal_watcher */
@@ -424,15 +421,21 @@ wal_subscr_wakeup(struct wal_subscr *ws, unsigned int events)
 }
 
 static void
-wal_subscr_dir_stat_cb(struct ev_loop *, struct ev_stat *stat, int)
+wal_subscr_dir_stat_cb(struct ev_loop *loop, struct ev_stat *stat, int revents)
 {
+	(void)revents;
+	(void)loop;
+
 	struct wal_subscr *ws = (struct wal_subscr *)stat->data;
 	wal_subscr_wakeup(ws, WAL_EVENT_ROTATE);
 }
 
 static void
-wal_subscr_file_stat_cb(struct ev_loop *, struct ev_stat *stat, int)
+wal_subscr_file_stat_cb(struct ev_loop *loop, struct ev_stat *stat, int revents)
 {
+	(void)revents;
+	(void)loop;
+
 	struct wal_subscr *ws = (struct wal_subscr *)stat->data;
 	wal_subscr_wakeup(ws, WAL_EVENT_WRITE);
 }
diff --git a/src/box/recovery.h b/src/box/recovery.h
index 5e2826fee..20fd9998b 100644
--- a/src/box/recovery.h
+++ b/src/box/recovery.h
@@ -88,10 +88,6 @@ recovery_stop_local(struct recovery *r);
 int
 recovery_finalize(struct recovery *r);
 
-#if defined(__cplusplus)
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
 /**
  * Find out if there are new .xlog files since the current
  * vclock, and read them all up.
@@ -106,4 +102,8 @@ int
 recover_remaining_wals(struct recovery *r, struct xstream *stream,
 		       const struct vclock *stop_vclock, bool scan_dir);
 
+#if defined(__cplusplus)
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
 #endif /* TARANTOOL_RECOVERY_H_INCLUDED */
-- 
2.20.1



More information about the Tarantool-patches mailing list