From ca0a69102038b7d78556b13c65a07e8f0e2331b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Fri, 29 Sep 2017 10:33:39 +0200 Subject: [PATCH] Inline the free function. --- include/neocomm.h | 6 +++++- src/channel.cpp | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/neocomm.h b/include/neocomm.h index f2f19fd..8de742e 100644 --- a/include/neocomm.h +++ b/include/neocomm.h @@ -26,8 +26,10 @@ #ifdef __cplusplus extern "C" { #include +#include #else #include +#include #endif /** @@ -138,7 +140,9 @@ struct message *NeoComm_get_next_message(const char *channel_name); * * @param msg The message to free from memory. */ -void NeoComm_free_message(struct message *msg); +static inline void NeoComm_free_message(struct message *msg) { + free(msg); +} /** * @brief Send a message to a channel. diff --git a/src/channel.cpp b/src/channel.cpp index 0f6ae75..df8a576 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -99,10 +99,6 @@ struct message *NeoComm_get_next_message(const char *channel_name) { return msg; } -void NeoComm_free_message(struct message *msg) { - free(msg); -} - time_t NeoComm_send_message(const char *channel_name, const char *message) { if(not node.isRunning()) {