More compiler warning fixes.

pull/2144/head
Roger Light 5 years ago
parent 2de8c15bc9
commit a5d9986cbd

@ -27,6 +27,10 @@ Contributors:
# include <sys/time.h> # include <sys/time.h>
#endif #endif
#ifndef __GNUC__
#define __attribute__(attrib)
#endif
/* pub_client.c modes */ /* pub_client.c modes */
#define MSGMODE_NONE 0 #define MSGMODE_NONE 0
#define MSGMODE_CMD 1 #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); 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 #endif

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

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

@ -131,7 +131,7 @@ static int dynsec_control_callback(int event, void *event_data, void *userdata)
return MOSQ_ERR_SUCCESS; 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; cJSON *j_actions, *j_action, *j_acltype, *j_allow;
bool 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; cJSON *tree, *jtmp, *j_data, *j_acls, *j_acl;
const char *admin_clientid, *admin_username; const char *admin_clientid, *admin_username;

@ -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); HASH_DELETE(hh, *base_rolelist, rolelist);
mosquitto_free(rolelist->rolename); 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; struct dynsec__rolelist *found_rolelist;

@ -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; cJSON *j_acl, *j_type, *jtmp;
struct dynsec__acl *acl; struct dynsec__acl *acl;

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

Loading…
Cancel
Save