Module: check_mk
Branch: master
Commit: 7a59718589d6cc67fc29a91d732bcefdac3d5b21
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7a59718589d6cc…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Aug 8 16:38:16 2016 +0200
Various C => C++ tweaks.
---
Makefile | 8 ++++----
livestatus/src/TableStateHistory.cc | 2 +-
livestatus/src/auth.h | 2 --
livestatus/src/store_c.h | 10 +---------
livestatus/src/strutil.h | 11 -----------
livestatus/src/waittriggers.h | 29 +++++++++--------------------
6 files changed, 15 insertions(+), 47 deletions(-)
diff --git a/Makefile b/Makefile
index a511880..fa6b683 100644
--- a/Makefile
+++ b/Makefile
@@ -47,12 +47,12 @@ BEAR := bear
LIVESTATUS_SOURCES := configure aclocal.m4 config.guess config.h.in config.sub \
configure.ac ltmain.sh Makefile.{in,am} missing ar-lib \
nagios/README nagios/*.h nagios4/README m4/* nagios4/*.h \
- src/*.{h,c,cc} src/Makefile.{in,am} \
+ src/*.{h,cc} src/Makefile.{in,am} \
depcomp install-sh api/python/{*.py,README} api/perl/*
# Files that are checked for trailing spaces
HEAL_SPACES_IN := checkman/* modules/* checks/* notifications/* inventory/* \
- $$(find -name Makefile) livestatus/src/*.{cc,c,h} \
+ $$(find -name Makefile) livestatus/src/*.{cc,h} \
agents/windows/*.cc \
web/htdocs/*.{py,css} web/htdocs/js/*.js web/plugins/*/*.py \
doc/helpers/* scripts/setup.sh scripts/autodetect.py \
@@ -66,8 +66,8 @@ HEAL_SPACES_IN := checkman/* modules/* checks/* notifications/*
inventory/*
FILES_TO_FORMAT := $(wildcard $(addprefix agents/,*.cc *.c *.h)) \
$(wildcard $(addprefix agents/windows/,*.cc *.c *.h)) \
- $(wildcard $(addprefix livestatus/api/c++/,*.cc *.c *.h)) \
- $(wildcard $(addprefix livestatus/src/,*.cc *.c *.h)) \
+ $(wildcard $(addprefix livestatus/api/c++/,*.cc *.h)) \
+ $(wildcard $(addprefix livestatus/src/,*.cc *.h)) \
$(wildcard $(addprefix bin/,*.cc *.c *.h))
.PHONY: all analyze check check-binaries check-permissions check-spaces \
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index 03ed5f8..3b30245 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -88,7 +88,7 @@ TableStateHistory::TableStateHistory(LogCache *log_cache,
#ifdef CMC
const Notes &downtimes_holder,
const Notes &comments_holder,
- recursive_mutex &holder_lock, Core *core
+ std::recursive_mutex &holder_lock, Core *core
#else
const DowntimesOrComments
&downtimes_holder,
diff --git a/livestatus/src/auth.h b/livestatus/src/auth.h
index 4070d94..5481086 100644
--- a/livestatus/src/auth.h
+++ b/livestatus/src/auth.h
@@ -37,8 +37,6 @@
extern int g_service_authorization;
extern int g_group_authorization;
-#ifdef __cplusplus
bool is_authorized_for(contact *ctc, host *hst, service *svc);
-#endif
#endif // auth_h
diff --git a/livestatus/src/store_c.h b/livestatus/src/store_c.h
index ed2e24e..14709fe 100644
--- a/livestatus/src/store_c.h
+++ b/livestatus/src/store_c.h
@@ -29,10 +29,6 @@
#include <time.h>
#include "nagios.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
void store_init();
void store_deinit();
void store_register_comment(nebstruct_comment_data *);
@@ -50,8 +46,4 @@ void update_timeperiods_cache(time_t);
void log_timeperiods_cache();
host *getHostByDesignation(const char *designation);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* store_c_h */
+#endif // store_c_h
diff --git a/livestatus/src/strutil.h b/livestatus/src/strutil.h
index 2a0b70f..a65ea7d 100644
--- a/livestatus/src/strutil.h
+++ b/livestatus/src/strutil.h
@@ -26,13 +26,6 @@
#define strutil_h
#include "config.h" // IWYU pragma: keep
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
char *rstrip(char *);
char *lstrip(char *);
@@ -41,8 +34,4 @@ char *next_token(char **c, char delim);
const char *safe_next_token(char **c, char delim);
char *next_field(char **c);
-#ifdef __cplusplus
-}
-#endif
-
#endif // strutil_h
diff --git a/livestatus/src/waittriggers.h b/livestatus/src/waittriggers.h
index f6f0adb..83f2171 100644
--- a/livestatus/src/waittriggers.h
+++ b/livestatus/src/waittriggers.h
@@ -27,27 +27,20 @@
#include "config.h" // IWYU pragma: keep
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct timespec;
-
// This is basically a C++ class for triggers done the "C way" via an opaque
// struct, explicit passing of 'this' and using a prefix for names.
-
struct trigger;
-struct trigger *trigger_all();
-struct trigger *trigger_check();
-struct trigger *trigger_state();
-struct trigger *trigger_log();
-struct trigger *trigger_downtime();
-struct trigger *trigger_comment();
-struct trigger *trigger_command();
-struct trigger *trigger_program();
+trigger *trigger_all();
+trigger *trigger_check();
+trigger *trigger_state();
+trigger *trigger_log();
+trigger *trigger_downtime();
+trigger *trigger_comment();
+trigger *trigger_command();
+trigger *trigger_program();
-struct trigger *trigger_find(const char *name);
+trigger *trigger_find(const char *name);
const char *trigger_all_names();
void trigger_notify_all(struct trigger *which);
@@ -55,8 +48,4 @@ void trigger_notify_all(struct trigger *which);
void trigger_wait(struct trigger *which);
int trigger_wait_for(struct trigger *which, unsigned ms);
-#ifdef __cplusplus
-}
-#endif
-
#endif // waittriggers_h