mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Enable -Wsuggest-override if supported by the compiler.
This commit is contained in:
@ -27,6 +27,7 @@ endif()
|
|||||||
|
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
|
|
||||||
@ -72,6 +73,10 @@ endif()
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion")
|
||||||
# CXX flags
|
# CXX flags
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Woverloaded-virtual -Wconversion -g")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Woverloaded-virtual -Wconversion -g")
|
||||||
|
check_cxx_compiler_flag("-Wsuggest-override" HAVE_SUGGEST_OVERRIDE)
|
||||||
|
if (HAVE_SUGGEST_OVERRIDE)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WSREP_LIB_STRICT_BUILD_FLAGS)
|
if (WSREP_LIB_STRICT_BUILD_FLAGS)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#ifndef WSREP_CONDITION_VARIABLE_HPP
|
#ifndef WSREP_CONDITION_VARIABLE_HPP
|
||||||
#define WSREP_CONDITION_VARIABLE_HPP
|
#define WSREP_CONDITION_VARIABLE_HPP
|
||||||
|
|
||||||
|
#include "compiler.hpp"
|
||||||
#include "lock.hpp"
|
#include "lock.hpp"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -59,17 +60,17 @@ namespace wsrep
|
|||||||
::abort();
|
::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void notify_one()
|
void notify_one() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
(void)pthread_cond_signal(&cond_);
|
(void)pthread_cond_signal(&cond_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_all()
|
void notify_all() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
(void)pthread_cond_broadcast(&cond_);
|
(void)pthread_cond_broadcast(&cond_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait(wsrep::unique_lock<wsrep::mutex>& lock)
|
void wait(wsrep::unique_lock<wsrep::mutex>& lock) WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
if (pthread_cond_wait(
|
if (pthread_cond_wait(
|
||||||
&cond_,
|
&cond_,
|
||||||
|
@ -20,15 +20,17 @@
|
|||||||
#ifndef WSREP_MUTEX_HPP
|
#ifndef WSREP_MUTEX_HPP
|
||||||
#define WSREP_MUTEX_HPP
|
#define WSREP_MUTEX_HPP
|
||||||
|
|
||||||
|
#include "compiler.hpp"
|
||||||
#include "exception.hpp"
|
#include "exception.hpp"
|
||||||
|
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
namespace wsrep
|
namespace wsrep
|
||||||
{
|
{
|
||||||
//!
|
/**
|
||||||
//!
|
* Mutex interface.
|
||||||
//!
|
*/
|
||||||
class mutex
|
class mutex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -61,7 +63,7 @@ namespace wsrep
|
|||||||
if (pthread_mutex_destroy(&mutex_)) ::abort();
|
if (pthread_mutex_destroy(&mutex_)) ::abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lock()
|
void lock() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
if (pthread_mutex_lock(&mutex_))
|
if (pthread_mutex_lock(&mutex_))
|
||||||
{
|
{
|
||||||
@ -69,7 +71,7 @@ namespace wsrep
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void unlock()
|
void unlock() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
if (pthread_mutex_unlock(&mutex_))
|
if (pthread_mutex_unlock(&mutex_))
|
||||||
{
|
{
|
||||||
@ -77,7 +79,7 @@ namespace wsrep
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* native()
|
void* native() WSREP_OVERRIDE
|
||||||
{
|
{
|
||||||
return &mutex_;
|
return &mutex_;
|
||||||
}
|
}
|
||||||
|
@ -37,62 +37,72 @@ namespace wsrep
|
|||||||
~wsrep_provider_v26();
|
~wsrep_provider_v26();
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
connect(const std::string&, const std::string&, const std::string&,
|
connect(const std::string&, const std::string&, const std::string&,
|
||||||
bool);
|
bool) WSREP_OVERRIDE;
|
||||||
int disconnect();
|
int disconnect() WSREP_OVERRIDE;
|
||||||
int capabilities() const;
|
int capabilities() const WSREP_OVERRIDE;
|
||||||
|
|
||||||
int desync();
|
int desync() WSREP_OVERRIDE;
|
||||||
int resync();
|
int resync() WSREP_OVERRIDE;
|
||||||
wsrep::seqno pause();
|
wsrep::seqno pause() WSREP_OVERRIDE;
|
||||||
int resume();
|
int resume() WSREP_OVERRIDE;
|
||||||
|
|
||||||
enum wsrep::provider::status run_applier(wsrep::high_priority_service*);
|
|
||||||
int start_transaction(wsrep::ws_handle&) { return 0; }
|
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
assign_read_view(wsrep::ws_handle&, const wsrep::gtid*);
|
run_applier(wsrep::high_priority_service*) WSREP_OVERRIDE;
|
||||||
int append_key(wsrep::ws_handle&, const wsrep::key&);
|
int start_transaction(wsrep::ws_handle&) WSREP_OVERRIDE { return 0; }
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
append_data(wsrep::ws_handle&, const wsrep::const_buffer&);
|
assign_read_view(wsrep::ws_handle&, const wsrep::gtid*) WSREP_OVERRIDE;
|
||||||
|
int append_key(wsrep::ws_handle&, const wsrep::key&) WSREP_OVERRIDE;
|
||||||
|
enum wsrep::provider::status
|
||||||
|
append_data(wsrep::ws_handle&, const wsrep::const_buffer&)
|
||||||
|
WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
certify(wsrep::client_id, wsrep::ws_handle&,
|
certify(wsrep::client_id, wsrep::ws_handle&,
|
||||||
int,
|
int,
|
||||||
wsrep::ws_meta&);
|
wsrep::ws_meta&) WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
bf_abort(wsrep::seqno,
|
bf_abort(wsrep::seqno,
|
||||||
wsrep::transaction_id,
|
wsrep::transaction_id,
|
||||||
wsrep::seqno&);
|
wsrep::seqno&) WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status rollback(const wsrep::transaction_id);
|
enum wsrep::provider::status
|
||||||
|
rollback(const wsrep::transaction_id) WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status
|
enum wsrep::provider::status
|
||||||
commit_order_enter(const wsrep::ws_handle&,
|
commit_order_enter(const wsrep::ws_handle&,
|
||||||
const wsrep::ws_meta&);
|
const wsrep::ws_meta&) WSREP_OVERRIDE;
|
||||||
int commit_order_leave(const wsrep::ws_handle&,
|
int commit_order_leave(const wsrep::ws_handle&,
|
||||||
const wsrep::ws_meta&,
|
const wsrep::ws_meta&,
|
||||||
const wsrep::mutable_buffer&);
|
const wsrep::mutable_buffer&) WSREP_OVERRIDE;
|
||||||
int release(wsrep::ws_handle&);
|
int release(wsrep::ws_handle&) WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status replay(const wsrep::ws_handle&,
|
enum wsrep::provider::status replay(const wsrep::ws_handle&,
|
||||||
wsrep::high_priority_service*);
|
wsrep::high_priority_service*)
|
||||||
|
WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status enter_toi(wsrep::client_id,
|
enum wsrep::provider::status enter_toi(wsrep::client_id,
|
||||||
const wsrep::key_array&,
|
const wsrep::key_array&,
|
||||||
const wsrep::const_buffer&,
|
const wsrep::const_buffer&,
|
||||||
wsrep::ws_meta&,
|
wsrep::ws_meta&,
|
||||||
int);
|
int)
|
||||||
|
WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status leave_toi(wsrep::client_id,
|
enum wsrep::provider::status leave_toi(wsrep::client_id,
|
||||||
const wsrep::mutable_buffer&);
|
const wsrep::mutable_buffer&)
|
||||||
|
WSREP_OVERRIDE;
|
||||||
std::pair<wsrep::gtid, enum wsrep::provider::status>
|
std::pair<wsrep::gtid, enum wsrep::provider::status>
|
||||||
causal_read(int) const;
|
causal_read(int) const WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status wait_for_gtid(const wsrep::gtid&, int) const;
|
enum wsrep::provider::status wait_for_gtid(const wsrep::gtid&, int)
|
||||||
wsrep::gtid last_committed_gtid() const;
|
const WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status sst_sent(const wsrep::gtid&, int);
|
wsrep::gtid last_committed_gtid() const WSREP_OVERRIDE;
|
||||||
enum wsrep::provider::status sst_received(const wsrep::gtid& gtid, int);
|
enum wsrep::provider::status sst_sent(const wsrep::gtid&, int)
|
||||||
enum wsrep::provider::status enc_set_key(const wsrep::const_buffer& key);
|
WSREP_OVERRIDE;
|
||||||
std::vector<status_variable> status() const;
|
enum wsrep::provider::status sst_received(const wsrep::gtid& gtid, int)
|
||||||
void reset_status();
|
WSREP_OVERRIDE;
|
||||||
std::string options() const;
|
enum wsrep::provider::status enc_set_key(const wsrep::const_buffer& key)
|
||||||
enum wsrep::provider::status options(const std::string&);
|
WSREP_OVERRIDE;
|
||||||
std::string name() const;
|
std::vector<status_variable> status() const WSREP_OVERRIDE;
|
||||||
std::string version() const;
|
void reset_status() WSREP_OVERRIDE;
|
||||||
std::string vendor() const;
|
std::string options() const WSREP_OVERRIDE;
|
||||||
void* native() const;
|
enum wsrep::provider::status options(const std::string&) WSREP_OVERRIDE;
|
||||||
|
std::string name() const WSREP_OVERRIDE;
|
||||||
|
std::string version() const WSREP_OVERRIDE;
|
||||||
|
std::string vendor() const WSREP_OVERRIDE;
|
||||||
|
void* native() const WSREP_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
wsrep_provider_v26(const wsrep_provider_v26&);
|
wsrep_provider_v26(const wsrep_provider_v26&);
|
||||||
wsrep_provider_v26& operator=(const wsrep_provider_v26);
|
wsrep_provider_v26& operator=(const wsrep_provider_v26);
|
||||||
|
Reference in New Issue
Block a user