removed extra semi-colon (#253)

* removed extra semi-colon

* added -Wpedantic flag for GCC

* added same warnings for clang

* simplified CMake command
This commit is contained in:
geoffviola 2016-11-28 15:11:22 -07:00 committed by William Woodall
parent aa2d0a3954
commit a987f8d015
27 changed files with 58 additions and 58 deletions

View file

@ -10,8 +10,8 @@ find_package(rmw_implementation REQUIRED)
find_package(rmw_implementation_cmake REQUIRED)
find_package(rosidl_generator_cpp REQUIRED)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-std=c++11 -Wall -Wextra -Wpedantic)
endif()
include_directories(include)

View file

@ -28,7 +28,7 @@ namespace executor
struct AnyExecutable
{
RCLCPP_SMART_PTR_DEFINITIONS(AnyExecutable);
RCLCPP_SMART_PTR_DEFINITIONS(AnyExecutable)
RCLCPP_PUBLIC
AnyExecutable();

View file

@ -49,7 +49,7 @@ class CallbackGroup
friend class rclcpp::node::Node;
public:
RCLCPP_SMART_PTR_DEFINITIONS(CallbackGroup);
RCLCPP_SMART_PTR_DEFINITIONS(CallbackGroup)
RCLCPP_PUBLIC
explicit CallbackGroup(CallbackGroupType group_type);
@ -79,7 +79,7 @@ public:
type() const;
private:
RCLCPP_DISABLE_COPY(CallbackGroup);
RCLCPP_DISABLE_COPY(CallbackGroup)
RCLCPP_PUBLIC
void

View file

@ -50,7 +50,7 @@ namespace client
class ClientBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(ClientBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(ClientBase)
RCLCPP_PUBLIC
ClientBase(
@ -88,7 +88,7 @@ public:
std::shared_ptr<rmw_request_id_t> request_header, std::shared_ptr<void> response) = 0;
protected:
RCLCPP_DISABLE_COPY(ClientBase);
RCLCPP_DISABLE_COPY(ClientBase)
RCLCPP_PUBLIC
bool
@ -124,7 +124,7 @@ public:
using CallbackType = std::function<void(SharedFuture)>;
using CallbackWithRequestType = std::function<void(SharedFutureWithRequest)>;
RCLCPP_SMART_PTR_DEFINITIONS(Client);
RCLCPP_SMART_PTR_DEFINITIONS(Client)
Client(
std::shared_ptr<rclcpp::node::Node> parent_node,
@ -250,7 +250,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(Client);
RCLCPP_DISABLE_COPY(Client)
std::map<int64_t, std::tuple<SharedPromise, CallbackType, SharedFuture>> pending_requests_;
std::mutex pending_requests_mutex_;

View file

@ -36,7 +36,7 @@ namespace context
class Context
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Context);
RCLCPP_SMART_PTR_DEFINITIONS(Context)
RCLCPP_PUBLIC
Context();
@ -68,7 +68,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(Context);
RCLCPP_DISABLE_COPY(Context)
std::unordered_map<std::type_index, std::shared_ptr<void>> sub_contexts_;
std::mutex mutex_;

View file

@ -28,7 +28,7 @@ namespace default_context
class DefaultContext : public rclcpp::context::Context
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(DefaultContext);
RCLCPP_SMART_PTR_DEFINITIONS(DefaultContext)
RCLCPP_PUBLIC
DefaultContext();

View file

@ -29,7 +29,7 @@ namespace event
class Event
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(Event);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(Event)
RCLCPP_PUBLIC
Event();
@ -47,7 +47,7 @@ public:
check_and_clear();
private:
RCLCPP_DISABLE_COPY(Event);
RCLCPP_DISABLE_COPY(Event)
std::atomic_bool state_;
};

View file

@ -88,7 +88,7 @@ static inline ExecutorArgs create_default_executor_arguments()
class Executor
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(Executor);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(Executor)
/// Default constructor.
// \param[in] ms The memory strategy to be used with this executor.
@ -316,7 +316,7 @@ protected:
memory_strategy::MemoryStrategy::SharedPtr memory_strategy_;
private:
RCLCPP_DISABLE_COPY(Executor);
RCLCPP_DISABLE_COPY(Executor)
std::vector<std::weak_ptr<rclcpp::node::Node>> weak_nodes_;
};

View file

@ -34,7 +34,7 @@ namespace multi_threaded_executor
class MultiThreadedExecutor : public executor::Executor
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(MultiThreadedExecutor);
RCLCPP_SMART_PTR_DEFINITIONS(MultiThreadedExecutor)
RCLCPP_PUBLIC
MultiThreadedExecutor(
@ -57,7 +57,7 @@ protected:
run(size_t this_thread_number);
private:
RCLCPP_DISABLE_COPY(MultiThreadedExecutor);
RCLCPP_DISABLE_COPY(MultiThreadedExecutor)
std::mutex wait_mutex_;
size_t number_of_threads_;

View file

@ -42,7 +42,7 @@ namespace single_threaded_executor
class SingleThreadedExecutor : public executor::Executor
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(SingleThreadedExecutor);
RCLCPP_SMART_PTR_DEFINITIONS(SingleThreadedExecutor)
/// Default constructor. See the default constructor for Executor.
RCLCPP_PUBLIC
@ -61,7 +61,7 @@ public:
spin();
private:
RCLCPP_DISABLE_COPY(SingleThreadedExecutor);
RCLCPP_DISABLE_COPY(SingleThreadedExecutor)
};
} // namespace single_threaded_executor

View file

@ -152,7 +152,7 @@ protected:
run_loop();
private:
RCLCPP_DISABLE_COPY(GraphListener);
RCLCPP_DISABLE_COPY(GraphListener)
std::thread listener_thread_;
bool is_started_;

View file

@ -120,10 +120,10 @@ namespace intra_process_manager
class IntraProcessManager
{
private:
RCLCPP_DISABLE_COPY(IntraProcessManager);
RCLCPP_DISABLE_COPY(IntraProcessManager)
public:
RCLCPP_SMART_PTR_DEFINITIONS(IntraProcessManager);
RCLCPP_SMART_PTR_DEFINITIONS(IntraProcessManager)
RCLCPP_PUBLIC
explicit IntraProcessManager(

View file

@ -41,7 +41,7 @@ namespace intra_process_manager
class IntraProcessManagerImplBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(IntraProcessManagerImplBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(IntraProcessManagerImplBase)
IntraProcessManagerImplBase() = default;
~IntraProcessManagerImplBase() = default;
@ -78,7 +78,7 @@ public:
matches_any_publishers(const rmw_gid_t * id) const = 0;
private:
RCLCPP_DISABLE_COPY(IntraProcessManagerImplBase);
RCLCPP_DISABLE_COPY(IntraProcessManagerImplBase)
};
template<typename Allocator = std::allocator<void>>
@ -242,7 +242,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(IntraProcessManagerImpl);
RCLCPP_DISABLE_COPY(IntraProcessManagerImpl)
template<typename T>
using RebindAlloc = typename std::allocator_traits<Allocator>::template rebind_alloc<T>;
@ -262,7 +262,7 @@ private:
struct PublisherInfo
{
RCLCPP_DISABLE_COPY(PublisherInfo);
RCLCPP_DISABLE_COPY(PublisherInfo)
PublisherInfo() = default;

View file

@ -35,7 +35,7 @@ namespace mapped_ring_buffer
class RCLCPP_PUBLIC MappedRingBufferBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(MappedRingBufferBase);
RCLCPP_SMART_PTR_DEFINITIONS(MappedRingBufferBase)
};
/// Ring buffer container of unique_ptr's of T, which can be accessed by a key.
@ -58,7 +58,7 @@ template<typename T, typename Alloc = std::allocator<void>>
class MappedRingBuffer : public MappedRingBufferBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(MappedRingBuffer<T, Alloc>);
RCLCPP_SMART_PTR_DEFINITIONS(MappedRingBuffer<T, Alloc>)
using ElemAllocTraits = allocator::AllocRebind<T, Alloc>;
using ElemAlloc = typename ElemAllocTraits::allocator_type;
using ElemDeleter = allocator::Deleter<ElemAlloc, T>;
@ -207,7 +207,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(MappedRingBuffer<T, Alloc>);
RCLCPP_DISABLE_COPY(MappedRingBuffer<T, Alloc>)
struct element
{

View file

@ -40,7 +40,7 @@ namespace memory_strategy
class RCLCPP_PUBLIC MemoryStrategy
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(MemoryStrategy);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(MemoryStrategy)
using WeakNodeVector = std::vector<std::weak_ptr<rclcpp::node::Node>>;
virtual bool collect_entities(const WeakNodeVector & weak_nodes) = 0;

View file

@ -33,7 +33,7 @@ template<typename MessageT, typename Alloc = std::allocator<void>>
class MessageMemoryStrategy
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(MessageMemoryStrategy);
RCLCPP_SMART_PTR_DEFINITIONS(MessageMemoryStrategy)
using MessageAllocTraits = allocator::AllocRebind<MessageT, Alloc>;
using MessageAlloc = typename MessageAllocTraits::allocator_type;

View file

@ -80,7 +80,7 @@ public:
class Node : public std::enable_shared_from_this<Node>
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(Node);
RCLCPP_SMART_PTR_DEFINITIONS(Node)
/// Create a new node with the specified name.
/**
@ -380,7 +380,7 @@ public:
std::atomic_bool has_executor;
private:
RCLCPP_DISABLE_COPY(Node);
RCLCPP_DISABLE_COPY(Node)
RCLCPP_PUBLIC
bool

View file

@ -44,7 +44,7 @@ namespace parameter_client
class AsyncParametersClient
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(AsyncParametersClient);
RCLCPP_SMART_PTR_DEFINITIONS(AsyncParametersClient)
RCLCPP_PUBLIC
AsyncParametersClient(
@ -118,7 +118,7 @@ private:
class SyncParametersClient
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(SyncParametersClient);
RCLCPP_SMART_PTR_DEFINITIONS(SyncParametersClient)
RCLCPP_PUBLIC
explicit SyncParametersClient(

View file

@ -38,7 +38,7 @@ namespace parameter_service
class ParameterService
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(ParameterService);
RCLCPP_SMART_PTR_DEFINITIONS(ParameterService)
RCLCPP_PUBLIC
explicit ParameterService(

View file

@ -51,7 +51,7 @@ namespace publisher
class PublisherBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(PublisherBase);
RCLCPP_SMART_PTR_DEFINITIONS(PublisherBase)
/// Default constructor.
/**
* Typically, a publisher is not created through this method, but instead is created through a
@ -151,7 +151,7 @@ public:
using MessageDeleter = allocator::Deleter<MessageAlloc, MessageT>;
using MessageUniquePtr = std::unique_ptr<MessageT, MessageDeleter>;
RCLCPP_SMART_PTR_DEFINITIONS(Publisher<MessageT, Alloc>);
RCLCPP_SMART_PTR_DEFINITIONS(Publisher<MessageT, Alloc>)
Publisher(
std::shared_ptr<rcl_node_t> node_handle,

View file

@ -31,7 +31,7 @@ namespace rate
class RateBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(RateBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(RateBase)
virtual bool sleep() = 0;
virtual bool is_steady() const = 0;
@ -46,7 +46,7 @@ template<class Clock = std::chrono::high_resolution_clock>
class GenericRate : public RateBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(GenericRate);
RCLCPP_SMART_PTR_DEFINITIONS(GenericRate)
explicit GenericRate(double rate)
: GenericRate<Clock>(
@ -106,7 +106,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(GenericRate);
RCLCPP_DISABLE_COPY(GenericRate)
std::chrono::nanoseconds period_;
using ClockDurationNano = std::chrono::duration<typename Clock::rep, std::nano>;

View file

@ -39,7 +39,7 @@ namespace service
class ServiceBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(ServiceBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(ServiceBase)
RCLCPP_PUBLIC
ServiceBase(
@ -64,7 +64,7 @@ public:
std::shared_ptr<void> request) = 0;
protected:
RCLCPP_DISABLE_COPY(ServiceBase);
RCLCPP_DISABLE_COPY(ServiceBase)
std::shared_ptr<rcl_node_t> node_handle_;
@ -88,7 +88,7 @@ public:
const std::shared_ptr<rmw_request_id_t>,
const std::shared_ptr<typename ServiceT::Request>,
std::shared_ptr<typename ServiceT::Response>)>;
RCLCPP_SMART_PTR_DEFINITIONS(Service);
RCLCPP_SMART_PTR_DEFINITIONS(Service)
Service(
std::shared_ptr<rcl_node_t> node_handle,
@ -158,7 +158,7 @@ public:
}
private:
RCLCPP_DISABLE_COPY(Service);
RCLCPP_DISABLE_COPY(Service)
AnyServiceCallback<ServiceT> any_callback_;
};

View file

@ -44,7 +44,7 @@ template<typename Alloc = std::allocator<void>>
class AllocatorMemoryStrategy : public memory_strategy::MemoryStrategy
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(AllocatorMemoryStrategy<Alloc>);
RCLCPP_SMART_PTR_DEFINITIONS(AllocatorMemoryStrategy<Alloc>)
using ExecAllocTraits = allocator::AllocRebind<executor::AnyExecutable, Alloc>;
using ExecAlloc = typename ExecAllocTraits::allocator_type;

View file

@ -46,7 +46,7 @@ class MessagePoolMemoryStrategy
: public message_memory_strategy::MessageMemoryStrategy<MessageT>
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(MessagePoolMemoryStrategy);
RCLCPP_SMART_PTR_DEFINITIONS(MessagePoolMemoryStrategy)
/// Default constructor
MessagePoolMemoryStrategy()

View file

@ -51,7 +51,7 @@ namespace subscription
class SubscriptionBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(SubscriptionBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(SubscriptionBase)
/// Default constructor.
/**
@ -109,7 +109,7 @@ protected:
std::shared_ptr<rcl_node_t> node_handle_;
private:
RCLCPP_DISABLE_COPY(SubscriptionBase);
RCLCPP_DISABLE_COPY(SubscriptionBase)
std::string topic_name_;
bool ignore_local_publications_;
};
@ -128,7 +128,7 @@ public:
using MessageDeleter = allocator::Deleter<MessageAlloc, MessageT>;
using MessageUniquePtr = std::unique_ptr<MessageT, MessageDeleter>;
RCLCPP_SMART_PTR_DEFINITIONS(Subscription);
RCLCPP_SMART_PTR_DEFINITIONS(Subscription)
/// Default constructor.
/**
@ -271,7 +271,7 @@ private:
return &intra_process_subscription_handle_;
}
RCLCPP_DISABLE_COPY(Subscription);
RCLCPP_DISABLE_COPY(Subscription)
AnySubscriptionCallback<MessageT, Alloc> any_callback_;
typename message_memory_strategy::MessageMemoryStrategy<MessageT, Alloc>::SharedPtr

View file

@ -43,7 +43,7 @@ namespace timer
class TimerBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(TimerBase);
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(TimerBase)
RCLCPP_PUBLIC
explicit TimerBase(std::chrono::nanoseconds period);
@ -103,7 +103,7 @@ template<
class GenericTimer : public TimerBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(GenericTimer);
RCLCPP_SMART_PTR_DEFINITIONS(GenericTimer)
/// Default constructor.
/**
@ -170,7 +170,7 @@ public:
}
protected:
RCLCPP_DISABLE_COPY(GenericTimer);
RCLCPP_DISABLE_COPY(GenericTimer)
FunctorT callback_;
};

View file

@ -31,7 +31,7 @@ namespace mock
class PublisherBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(PublisherBase);
RCLCPP_SMART_PTR_DEFINITIONS(PublisherBase)
PublisherBase()
: mock_topic_name(""), mock_queue_size(0) {}
@ -66,7 +66,7 @@ public:
using MessageUniquePtr = std::unique_ptr<T, MessageDeleter>;
std::shared_ptr<MessageAlloc> allocator_;
RCLCPP_SMART_PTR_DEFINITIONS(Publisher<T, Alloc>);
RCLCPP_SMART_PTR_DEFINITIONS(Publisher<T, Alloc>)
Publisher()
{
@ -93,7 +93,7 @@ namespace mock
class SubscriptionBase
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(SubscriptionBase);
RCLCPP_SMART_PTR_DEFINITIONS(SubscriptionBase)
SubscriptionBase()
: mock_topic_name(""), mock_queue_size(0) {}