More compiler warning fixes.

This commit is contained in:
Roger Light 2021-03-21 22:50:48 +00:00
parent 2de8c15bc9
commit a5d9986cbd
7 changed files with 14 additions and 8 deletions

View File

@ -27,6 +27,10 @@ Contributors:
# include <sys/time.h>
#endif
#ifndef __GNUC__
#define __attribute__(attrib)
#endif
/* pub_client.c modes */
#define MSGMODE_NONE 0
#define MSGMODE_CMD 1
@ -136,6 +140,5 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg);
int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx);
void err_printf(const struct mosq_config *cfg, const char *fmt, ...);
void err_printf(const struct mosq_config *cfg, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
#endif

View File

@ -3,7 +3,7 @@ include ../../config.mk
.PHONY : all binary check clean reallyclean test install uninstall
PLUGIN_NAME=mosquitto_dynamic_security
LOCAL_CPPFLAGS=-I../../src/
LOCAL_CPPFLAGS=-I../../src/ -DWITH_CJSON
OBJS= \
acl.o \

View File

@ -23,6 +23,7 @@ Contributors:
#include <stdlib.h>
#include <stdio.h>
#include "json_help.h"
#include "mosquitto.h"

View File

@ -131,7 +131,7 @@ static int dynsec_control_callback(int event, void *event_data, void *userdata)
return MOSQ_ERR_SUCCESS;
}
int dynsec__process_set_default_acl_access(cJSON *j_responses, struct mosquitto *context, cJSON *command, char *correlation_data)
static int dynsec__process_set_default_acl_access(cJSON *j_responses, struct mosquitto *context, cJSON *command, char *correlation_data)
{
cJSON *j_actions, *j_action, *j_acltype, *j_allow;
bool allow;
@ -174,7 +174,7 @@ int dynsec__process_set_default_acl_access(cJSON *j_responses, struct mosquitto
}
int dynsec__process_get_default_acl_access(cJSON *j_responses, struct mosquitto *context, cJSON *command, char *correlation_data)
static int dynsec__process_get_default_acl_access(cJSON *j_responses, struct mosquitto *context, cJSON *command, char *correlation_data)
{
cJSON *tree, *jtmp, *j_data, *j_acls, *j_acl;
const char *admin_clientid, *admin_username;

View File

@ -51,7 +51,7 @@ static int rolelist_cmp(void *a, void *b)
}
void dynsec_rolelist__free_item(struct dynsec__rolelist **base_rolelist, struct dynsec__rolelist *rolelist)
static void dynsec_rolelist__free_item(struct dynsec__rolelist **base_rolelist, struct dynsec__rolelist *rolelist)
{
HASH_DELETE(hh, *base_rolelist, rolelist);
mosquitto_free(rolelist->rolename);
@ -67,7 +67,7 @@ void dynsec_rolelist__cleanup(struct dynsec__rolelist **base_rolelist)
}
}
int dynsec_rolelist__remove_role(struct dynsec__rolelist **base_rolelist, const struct dynsec__role *role)
static int dynsec_rolelist__remove_role(struct dynsec__rolelist **base_rolelist, const struct dynsec__role *role)
{
struct dynsec__rolelist *found_rolelist;

View File

@ -209,7 +209,7 @@ static int insert_acl_cmp(struct dynsec__acl *a, struct dynsec__acl *b)
}
int dynsec_roles__acl_load(cJSON *j_acls, const char *key, struct dynsec__acl **acllist)
static int dynsec_roles__acl_load(cJSON *j_acls, const char *key, struct dynsec__acl **acllist)
{
cJSON *j_acl, *j_type, *jtmp;
struct dynsec__acl *acl;

View File

@ -21,6 +21,8 @@ Contributors:
#include <stdlib.h>
#include <string.h>
#include "dynamic_security.h"
static char *strtok_hier(char *str, char **saveptr)
{
char *c;