Inline the free function.

This commit is contained in:
Nicolás Ortega Froysa 2017-09-29 10:33:39 +02:00
parent 0278d786a9
commit ca0a691020
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF
2 changed files with 5 additions and 5 deletions

View File

@ -26,8 +26,10 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#include <ctime> #include <ctime>
#include <cstdlib>
#else #else
#include <time.h> #include <time.h>
#include <stdlib.h>
#endif #endif
/** /**
@ -138,7 +140,9 @@ struct message *NeoComm_get_next_message(const char *channel_name);
* *
* @param msg The message to free from memory. * @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. * @brief Send a message to a channel.

View File

@ -99,10 +99,6 @@ struct message *NeoComm_get_next_message(const char *channel_name) {
return msg; return msg;
} }
void NeoComm_free_message(struct message *msg) {
free(msg);
}
time_t NeoComm_send_message(const char *channel_name, const char *message) { time_t NeoComm_send_message(const char *channel_name, const char *message) {
if(not node.isRunning()) if(not node.isRunning())
{ {