Fix more minor compiler warnings.

This commit is contained in:
Roger A. Light
2021-01-21 13:33:54 +00:00
parent cda84950bb
commit 706a1f3f29
26 changed files with 250 additions and 22 deletions
@@ -28,7 +28,7 @@ Contributors:
*
* Note that this only works on Mosquitto 2.0 or later.
*/
#include "config.h"
#include <stdio.h>
#include <time.h>
@@ -47,6 +47,9 @@ static int callback_message(int event, void *event_data, void *userdata)
struct tm *ti;
char time_buf[25];
UNUSED(event);
UNUSED(userdata);
clock_gettime(CLOCK_REALTIME, &ts);
ti = gmtime(&ts.tv_sec);
strftime(time_buf, sizeof(time_buf), "%Y-%m-%dT%H:%M:%SZ", ti);
@@ -68,11 +71,19 @@ int mosquitto_plugin_version(int supported_version_count, const int *supported_v
int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier, void **user_data, struct mosquitto_opt *opts, int opt_count)
{
UNUSED(user_data);
UNUSED(opts);
UNUSED(opt_count);
mosq_pid = identifier;
return mosquitto_callback_register(mosq_pid, MOSQ_EVT_MESSAGE, callback_message, NULL, NULL);
}
int mosquitto_plugin_cleanup(void *user_data, struct mosquitto_opt *opts, int opt_count)
{
UNUSED(user_data);
UNUSED(opts);
UNUSED(opt_count);
return mosquitto_callback_unregister(mosq_pid, MOSQ_EVT_MESSAGE, callback_message, NULL);
}