Skip to content

Commit

Permalink
More compiler warning fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Mar 21, 2021
1 parent 2de8c15 commit a5d9986
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions client/client_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
# include <sys/time.h>
#endif

#ifndef __GNUC__
#define __attribute__(attrib)
#endif

/* pub_client.c modes */
#define MSGMODE_NONE 0
#define MSGMODE_CMD 1
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion plugins/dynamic-security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions plugins/dynamic-security/json_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#include <stdlib.h>
#include <stdio.h>

#include "json_help.h"
#include "mosquitto.h"


Expand Down
4 changes: 2 additions & 2 deletions plugins/dynamic-security/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions plugins/dynamic-security/rolelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion plugins/dynamic-security/roles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions plugins/dynamic-security/sub_matches_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#include <stdlib.h>
#include <string.h>

#include "dynamic_security.h"

static char *strtok_hier(char *str, char **saveptr)
{
char *c;
Expand Down

0 comments on commit a5d9986

Please sign in to comment.