From: Arran Cudbard-Bell Date: Sat, 19 Sep 2015 11:39:05 +0000 (+0100) Subject: Fix minor issues identified by clang-700.0.72 X-Git-Tag: release_3_0_10~60 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=dec007dc02c57edb2e4d45dbf5f1eade63468ccf Fix minor issues identified by clang-700.0.72 --- diff --git a/src/main/evaluate.c b/src/main/evaluate.c index c64eebd..bd49e8b 100644 --- a/src/main/evaluate.c +++ b/src/main/evaluate.c @@ -771,8 +771,6 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from, bool d REQUEST *fixup = NULL; TALLOC_CTX *ctx; - if (!request) return; - /* * Set up arrays for editing, to remove some of the * O(N^2) dependencies. This also makes it easier to diff --git a/src/main/log.c b/src/main/log.c index cb2f88c..3ead46e 100644 --- a/src/main/log.c +++ b/src/main/log.c @@ -601,7 +601,7 @@ inline bool radlog_debug_enabled(log_type_t type, log_lvl_t lvl, REQUEST *reques * then don't log the message. */ if ((type & L_DBG) && - ((request && request->log.func && (lvl <= request->log.lvl)) || + ((request->log.func && (lvl <= request->log.lvl)) || ((rad_debug_lvl != 0) && (lvl <= rad_debug_lvl)))) { return true; } diff --git a/src/main/map.c b/src/main/map.c index 88d89c1..bbe3a63 100644 --- a/src/main/map.c +++ b/src/main/map.c @@ -340,8 +340,6 @@ int map_afrom_cs(vp_map_t **out, CONF_SECTION *cs, *out = NULL; tail = out; - if (!cs) return 0; - /* * The first map has cs as the parent. * The rest have the previous map as the parent. diff --git a/src/main/radattr.c b/src/main/radattr.c index 2a6c59b..3badef9 100644 --- a/src/main/radattr.c +++ b/src/main/radattr.c @@ -695,7 +695,12 @@ static void process_file(const char *root_dir, char const *filename) attr = data; vp = head; while (vp) { - len = rad_vp2attr(&my_packet, &my_original, my_secret, (VALUE_PAIR const **)(void **)&vp, + VALUE_PAIR **pvp = &vp; + VALUE_PAIR const **qvp; + + memcpy(&qvp, &pvp, sizeof(pvp)); + + len = rad_vp2attr(&my_packet, &my_original, my_secret, qvp, attr, data + sizeof(data) - attr); if (len < 0) { fprintf(stderr, "Failed encoding %s: %s\n", diff --git a/src/main/tmpl.c b/src/main/tmpl.c index 7106f00..ae89b33 100644 --- a/src/main/tmpl.c +++ b/src/main/tmpl.c @@ -2197,7 +2197,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt) } if (vpt->tmpl_da->flags.is_unknown) { - if (vpt->tmpl_da != (DICT_ATTR *)&vpt->data.attribute.unknown.da) { + if (vpt->tmpl_da != (DICT_ATTR const *)&vpt->data.attribute.unknown.da) { FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_ATTR " "da is marked as unknown, but does not point to the template's " "unknown da buffer", file, line); diff --git a/src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c b/src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c index d1813ab..6220bbd 100644 --- a/src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c +++ b/src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c @@ -281,7 +281,7 @@ static int mod_process(void *arg, eap_handler_t *handler) BIGNUM *x = NULL, *y = NULL; char *p; - if (!handler || ((eap_ds = handler->eap_ds) == NULL) || !inst) return 0; + if (((eap_ds = handler->eap_ds) == NULL) || !inst) return 0; session = (pwd_session_t *)handler->opaque; request = handler->request; diff --git a/src/modules/rlm_mschap/opendir.c b/src/modules/rlm_mschap/opendir.c index fa8c816..1b37811 100644 --- a/src/modules/rlm_mschap/opendir.c +++ b/src/modules/rlm_mschap/opendir.c @@ -52,7 +52,7 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out tDataBuffer *tDataBuff = NULL; tDirNodeReference nodeRef = 0; long status = eDSNoErr; - char *what = NULL; + char const *what = NULL; char *status_name = NULL; tContextData context = 0; uint32_t nodeCount = 0; @@ -63,9 +63,9 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out tDataList *pRecType = NULL; tDataList *pAttrType = NULL; uint32_t recCount = 0; - tRecordEntry *pRecEntry = NULL; + tRecordEntry *pRecEntry = NULL; tAttributeListRef attrListRef = 0; - char *pUserLocation = NULL; + char *pUserLocation = NULL; tAttributeValueListRef valueRef = 0; tDataList *pUserNode = NULL; rlm_rcode_t result = RLM_MODULE_FAIL;