]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clean up for semicolons
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Aug 2023 12:41:18 +0000 (08:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Aug 2023 15:53:38 +0000 (11:53 -0400)
60 files changed:
src/bin/radlock.c
src/bin/radsnmp.c
src/lib/eap_aka_sim/state_machine.c
src/lib/io/atomic_queue.h
src/lib/io/time_tracking.h
src/lib/ldap/base.c
src/lib/ldap/connection.c
src/lib/redis/base.h
src/lib/redis/cluster.c
src/lib/server/cf_file.c
src/lib/server/cf_util.h
src/lib/server/log.c
src/lib/server/log.h
src/lib/server/process.h
src/lib/server/stats.c
src/lib/server/tmpl_dcursor_tests.c
src/lib/server/tmpl_eval.c
src/lib/server/trigger.c
src/lib/server/trunk.c
src/lib/tls/session.h
src/lib/unlang/compile.c
src/lib/unlang/interpret.c
src/lib/unlang/map.c
src/lib/unlang/parallel.c
src/lib/unlang/xlat.h
src/lib/unlang/xlat_expr.c
src/lib/util/atexit.h
src/lib/util/base16.c
src/lib/util/dbuff.c
src/lib/util/dbuff.h
src/lib/util/dcursor.h
src/lib/util/debug.c
src/lib/util/dict_unknown.c
src/lib/util/dlist.h
src/lib/util/edit.c
src/lib/util/heap.c
src/lib/util/isaac.c
src/lib/util/log.c
src/lib/util/lst.h
src/lib/util/minmax_heap.c
src/lib/util/pair.h
src/lib/util/rand.c
src/lib/util/sbuff.c
src/lib/util/sbuff.h
src/lib/util/sha1.c
src/lib/util/trie.c
src/lib/util/value.c
src/listen/ldap_sync/proto_ldap_sync_ldap.c
src/modules/rlm_cipher/rlm_cipher.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_redis_ippool/rlm_redis_ippool.c
src/modules/rlm_redis_ippool/rlm_redis_ippool_tool.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sql/drivers/rlm_sql_sqlite/rlm_sql_sqlite.c
src/protocols/dhcpv4/base.c
src/protocols/dhcpv6/decode.c
src/protocols/dns/decode.c
src/protocols/radius/radius.h
src/protocols/tacacs/tacacs.h

index b58eeb4e5f81703588c945235b72f3da0f316579..a34f01ab7d1045baa8c09d7e8d9fb2809ecd1e5b 100644 (file)
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
        if (argc == 0) {
                fr_perror("radlock - Need file to operate on");
                usage(64);
-       };
+       }
 
        if (argc == 1) {
                fr_perror("radlock - Need action, must be one of (lock|trylock|unlock|remove|info|perm)");
index fce5f121c0ebb76ad492eb45df3929579ceadd2f..13ad1b446942b1856d9109db806d14f79a18788f 100644 (file)
@@ -626,7 +626,7 @@ static int radsnmp_send_recv(radsnmp_conf_t *conf, int fd)
        fr_strerror_clear();
 
 #define NEXT_LINE(_line, _buffer) \
-{ \
+do { \
        size_t _len; \
        if (stop) return 0; \
        errno = 0;\
@@ -636,7 +636,8 @@ static int radsnmp_send_recv(radsnmp_conf_t *conf, int fd)
                if ((_len > 0) && (_line[_len - 1] == '\n')) _line[_len - 1] = '\0'; \
                DEBUG2("read: %s", _line); \
        } \
-}
+} while (0)
+
        /*
         *      Read commands from pass_persist
         */
index b3c99f98cdf0ecfe1f2489f83cfb967d9822ef43..a2a26d6ddc663cbe7a98ad3444d76548657d890c 100644 (file)
@@ -52,7 +52,7 @@ RCSID("$Id$")
                                                               module_ctx_t const *mctx, \
                                                               request_t *request)
 
-#define STATE_TRANSITION(_x) guard_ ## _x(p_result, mctx, request);
+#define STATE_TRANSITION(_x) guard_ ## _x(p_result, mctx, request)
 
 #define CALL_SECTION(_x)       unlang_module_yield_to_section(p_result, \
                                                               request, \
@@ -1298,7 +1298,7 @@ STATE(common_failure_notification)
        default:
        fail:
                RWDEBUG("Failure-Notification not ACKed correctly, sending EAP-Failure anyway");
-               return STATE_TRANSITION(eap_failure)
+               return STATE_TRANSITION(eap_failure);
        }
 }
 
index af34e36c60b8634f9529a26922b52fc9b4174295..fb096dd9a62ff019c2dd770f854ec76775c3c2da 100644 (file)
@@ -45,7 +45,7 @@ RCSIDH(atomic_queue_h, "$Id$")
 #define cas_decr(_store, _var)    atomic_compare_exchange_strong_explicit(&_store, &_var, _var - 1, memory_order_release, memory_order_relaxed)
 #define load(_var)           atomic_load_explicit(&_var, memory_order_relaxed)
 #define aquire(_var)         atomic_load_explicit(&_var, memory_order_acquire)
-#define store(_store, _var)  atomic_store_explicit(&_store, _var, memory_order_release);
+#define store(_store, _var)  atomic_store_explicit(&_store, _var, memory_order_release)
 
 #ifdef __cplusplus
 extern "C" {
index af9d55602eba7d25f8d8daa30e5e947b0b17a12d..c3dfc909a76f009e44f5332cbdc52a3103a12312 100644 (file)
@@ -89,7 +89,7 @@ do { \
        fr_assert(fr_time_lteq((_tt)->ended, (_now))); \
        fr_assert(fr_time_lteq((_tt)->last_yielded, (_now))); \
        fr_assert(fr_time_lteq((_tt)->last_resumed, (_now))); \
-} while(0);
+} while(0)
 
 /** Set the last time a tracked entity started in its list of parents
  *
@@ -287,8 +287,8 @@ static inline void fr_time_tracking_end(fr_time_delta_t *predicted,
  */
 static inline CC_HINT(nonnull) void fr_time_tracking_debug(fr_time_tracking_t *tt, FILE *fp)
 {
-#define DPRINT_TIME(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_unwrap(tt->_x));
-#define DPRINT(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_delta_unwrap(tt->_x));
+#define DPRINT_TIME(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_unwrap(tt->_x))
+#define DPRINT(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_delta_unwrap(tt->_x))
 
        DPRINT_TIME(started);
        DPRINT_TIME(ended);
index 43a244cc359ef6e4004535bf4a0787de14859074..3d7e45207530ee2d020ee2ef8b3d6a129225af58 100644 (file)
@@ -1059,13 +1059,13 @@ int fr_ldap_global_config(int debug_level, char const *tls_random_file)
        if (done_config) return 0;
 
 #define do_ldap_global_option(_option, _name, _value) \
-       if (ldap_set_option(NULL, _option, _value) != LDAP_OPT_SUCCESS) { \
+       if (ldap_set_option(NULL, _option, _value) != LDAP_OPT_SUCCESS) do { \
                int _ldap_errno; \
                ldap_get_option(NULL, LDAP_OPT_RESULT_CODE, &_ldap_errno); \
                ERROR("Failed setting global option %s: %s", _name, \
                         (_ldap_errno != LDAP_SUCCESS) ? ldap_err2string(_ldap_errno) : "Unknown error"); \
                return -1;\
-       }
+       } while (0)
 
 #define maybe_ldap_global_option(_option, _name, _value) \
        if (_value) do_ldap_global_option(_option, _name, _value)
index d74db6db7b9673473b37dac9f53f3995635b395d..fb48d46e0c35ca0517c9e2ea16dda9d619b9c1a2 100644 (file)
@@ -89,12 +89,12 @@ int fr_ldap_connection_configure(fr_ldap_connection_t *c, fr_ldap_config_t const
         *      Set a bunch of LDAP options, using common code.
         */
 #define do_ldap_option(_option, _name, _value) \
-       if (ldap_set_option(c->handle, _option, _value) != LDAP_OPT_SUCCESS) { \
+       if (ldap_set_option(c->handle, _option, _value) != LDAP_OPT_SUCCESS) do { \
                ldap_get_option(c->handle, LDAP_OPT_ERROR_NUMBER, &ldap_errno); \
                ERROR("Failed setting connection option %s: %s", _name, \
                      (ldap_errno != LDAP_SUCCESS) ? ldap_err2string(ldap_errno) : "Unknown error"); \
                goto error;\
-       }
+       } while (0)
 
 DIAG_OFF(unused-macros)
 #define maybe_ldap_option(_option, _name, _value) \
index 345c540f8b3411281f52352bdd17ba46c43abc53..77b70f5277a971ae8c40f8b3d3603771f5a3dbc3 100644 (file)
@@ -32,7 +32,9 @@ RCSIDH(redis_h, "$Id$")
 #include <freeradius-devel/server/map.h>
 #include <freeradius-devel/server/module.h>
 
+DIAG_OFF(extra-semi-stmt)
 #include <hiredis/hiredis.h>
+DIAG_ON(extra-semi-stmt)
 
 #ifdef __cplusplus
 extern "C" {
index bd031a443776511156ca2aeced8b39d693381ba0..af27c3ad4e40ab18637896855d907c6689cd39d6 100644 (file)
@@ -2086,7 +2086,7 @@ int fr_redis_cluster_pool_by_node_addr(fr_pool_t **pool, fr_redis_cluster_t *clu
                        pthread_mutex_unlock(&cluster->mutex);
 
                        hostname = inet_ntop(node_addr->inet.dst_ipaddr.af, &node_addr->inet.dst_ipaddr.addr, buffer, sizeof(buffer));
-                       fr_assert(hostname);    /* addr.ipaddr is probably corrupt */;
+                       fr_assert(hostname);    /* addr.ipaddr is probably corrupt */
                        fr_strerror_printf("No existing node found with address %s, port %i",
                                           hostname, node_addr->inet.dst_port);
                        return -1;
index 6be3f1f1156d9f37de6b4e08b6f43ad43d8144d9..07e282dedd51462512859ebac6f4d2f98fc2e9d4 100644 (file)
@@ -162,7 +162,7 @@ static inline CC_HINT(always_inline) int cf_tmpl_rules_verify(CONF_SECTION *cs,
        return 0;
 }
 
-#define RULES_VERIFY(_cs, _rules) if (cf_tmpl_rules_verify(_cs, _rules) < 0) return NULL;
+#define RULES_VERIFY(_cs, _rules) if (cf_tmpl_rules_verify(_cs, _rules) < 0) return NULL
 
 static ssize_t fr_skip_xlat(char const *start, char const *end);
 
@@ -2796,7 +2796,7 @@ do_frame:
                                    frame->filename);
                        goto pop_stack;
                }
-       };
+       }
 
        /*
         *      Read, checking for line continuations ('\\' at EOL)
index 12653689b8db1d8f439ff7dda16071607a11261e..0b3f2923367bd93a9a8306e533a659546877255c 100644 (file)
@@ -240,14 +240,14 @@ CONF_DATA const *_cf_data_add_static(CONF_ITEM *ci, void const *data, char const
  * @param[in] _type of data to remove.
  * @param[in] _name of data to remove.
  */
-#define                cf_data_remove(_cf, _type, _name) _cf_data_remove(CF_TO_ITEM(_cf), cf_data_find(_cf, _type, _name));
+#define                cf_data_remove(_cf, _type, _name) _cf_data_remove(CF_TO_ITEM(_cf), cf_data_find(_cf, _type, _name))
 
 /** Remove an item from a parent
  *
  * @param[in] _cf conf section or pair to remove data from.
  * @param[in] _cd conf data to remove.
  */
-#define                cf_data_remove_by_data(_cf, _cd) _cf_data_remove(CF_TO_ITEM(_cf), _cd);
+#define                cf_data_remove_by_data(_cf, _cd) _cf_data_remove(CF_TO_ITEM(_cf), _cd)
 void           *_cf_data_remove(CONF_ITEM *ci, CONF_DATA const *_cd);
 
 #define                cf_data_walk(_cf, _type, _cb, _ctx) _cf_data_walk(CF_TO_ITEM(_cf), #_type, _cb, _ctx)
index b17645b4ef67d9c441d7b96309d2e84ae6a621a2..5d17a46d003a39166ef9628f3993d95c18e4f27a 100644 (file)
@@ -530,7 +530,7 @@ print_fmt:
                break;
        default:
                break;
-       };
+       }
 
        log_always(log_dst, type, file, line,
                   "%s"                 /* prefix */
@@ -1036,7 +1036,7 @@ void log_request_fd_event(UNUSED fr_event_list_t *el, int fd, UNUSED int flags,
                 *      Clear out the existing data
                 */
                fr_sbuff_shift(&sbuff, fr_sbuff_used(&m_start));
-       };
+       }
 }
 
 /** Log a fatal error, then exit
index 71015233ecc69c51ac5e6aaa092178dcf0c8c8d6..7a645f60b145762fc197bdc4d562a0f298a29045 100644 (file)
@@ -685,9 +685,9 @@ do {\
  * @param[in] ...      Additional arguments to print.
  */
 #define _RHEXDUMP_INLINE(_lvl, _data, _len, _fmt, ...) \
-       if (log_rdebug_enabled(_lvl, request)) { \
+       if (log_rdebug_enabled(_lvl, request)) do { \
                log_request(L_DBG, _lvl, request, __FILE__, __LINE__, _fmt " 0x%pH", ## __VA_ARGS__, fr_box_octets(_data, _len)); \
-       }
+       } while (0)
 
 #define RHEXDUMP_INLINE1(_data, _len, _fmt, ...) _RHEXDUMP_INLINE(L_DBG_LVL_1, _data, _len, _fmt, ## __VA_ARGS__)
 #define RHEXDUMP_INLINE2(_data, _len, _fmt, ...) _RHEXDUMP_INLINE(L_DBG_LVL_2, _data, _len, _fmt, ## __VA_ARGS__)
index b4b81604f615e58238156edb6b693c4d99a4a05f..09b71e1ed55f83cff352a2317833d5f3fe220c92 100644 (file)
@@ -132,7 +132,7 @@ do { \
 
 /** Call a named recv function directly
  */
-#define CALL_RECV(_x) recv_ ## _x(p_result, mctx, request);
+#define CALL_RECV(_x) recv_ ## _x(p_result, mctx, request)
 
 /** Call a named send function directly
  */
index 684c66819870d9e74133084d1015e24d7adbcbbe..82c71e75b6322481954196ad80d02b6159bce15e 100644 (file)
@@ -65,10 +65,10 @@ void request_stats_final(request_t *request)
                return;
 
 #undef INC_AUTH
-#define INC_AUTH(_x) radius_auth_stats._x++;request->client->auth._x++;
+#define INC_AUTH(_x) do { radius_auth_stats._x++;request->client->auth._x++; } while (0)
 
 #undef INC_ACCT
-#define INC_ACCT(_x) radius_acct_stats._x++;request->client->acct._x++
+#define INC_ACCT(_x) do { radius_acct_stats._x++;request->client->acct._x++; } while (0)
 
        /*
         *      Update the statistics.
index b6b97fa00998f781cb78f8cc63cce98b89d99217..bf1db42c91dfa69be9b2e352acde9671c45f114f 100644 (file)
@@ -75,7 +75,7 @@ static request_t *request_fake_alloc(void)
        fr_pair_t       *mid_vp ## _x; \
        fr_pair_t       *leaf_int32_vp ## _x
 
-#define pair_populate(_x) \
+#define pair_populate(_x) do { \
        pair_append_request(&int32_vp ## _x, fr_dict_attr_test_int32); \
        pair_append_request(&string_vp ## _x, fr_dict_attr_test_string); \
        pair_append_request(&group_vp ## _x, fr_dict_attr_test_group); \
@@ -83,14 +83,16 @@ static request_t *request_fake_alloc(void)
        pair_append_request(&top_vp ## _x, fr_dict_attr_test_nested_top_tlv); \
        fr_pair_append_by_da(top_vp ## _x, &mid_vp ## _x, &top_vp ## _x->children, fr_dict_attr_test_nested_child_tlv); \
        fr_pair_append_by_da(mid_vp ## _x, &leaf_string_vp ## _x, &mid_vp ## _x->children, fr_dict_attr_test_nested_leaf_string); \
-       fr_pair_append_by_da(mid_vp ## _x, &leaf_int32_vp ## _x, &mid_vp ## _x->children, fr_dict_attr_test_nested_leaf_int32);
+       fr_pair_append_by_da(mid_vp ## _x, &leaf_int32_vp ## _x, &mid_vp ## _x->children, fr_dict_attr_test_nested_leaf_int32); \
+     } while (0)
 
-#define pair_populate_thin(_x) \
+#define pair_populate_thin(_x) do { \
        pair_append_request(&int32_vp ## _x, fr_dict_attr_test_int32); \
        pair_append_request(&group_vp ## _x, fr_dict_attr_test_group); \
        pair_append_request(&top_vp ## _x, fr_dict_attr_test_nested_top_tlv); \
        fr_pair_append_by_da(top_vp ## _x, &mid_vp ## _x, &top_vp ## _x->children, fr_dict_attr_test_nested_child_tlv); \
-       fr_pair_append_by_da(mid_vp ## _x, &leaf_int32_vp ## _x, &mid_vp ## _x->children, fr_dict_attr_test_nested_leaf_int32);
+       fr_pair_append_by_da(mid_vp ## _x, &leaf_int32_vp ## _x, &mid_vp ## _x->children, fr_dict_attr_test_nested_leaf_int32); \
+      } while (0)
 
 /*
  *     Top level attribute names in the test dictionary all have -0 on the end
@@ -122,7 +124,7 @@ typedef struct {
  */
 #define common_vars \
        tmpl_dcursor_vars_t vars; \
-       request_t *request = request_fake_alloc();
+       request_t *request = request_fake_alloc()
 
 /** Initialise a tmpl using the _attr_str string, and return the first pair
  *
@@ -151,7 +153,7 @@ int _tmpl_setup_and_cursor_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *vars, r
 }
 
 #define tmpl_setup_and_cursor_init(_vp_out, _ref) \
-       if (_tmpl_setup_and_cursor_init(_vp_out, &vars, request, _ref)) return;
+       if (_tmpl_setup_and_cursor_init(_vp_out, &vars, request, _ref)) return
 
 /** Initialise a tmpl using the _attr_str string, and return the first pair
  *
@@ -180,7 +182,7 @@ int _tmpl_setup_and_cursor_build_init(fr_pair_t **vp_out, tmpl_dcursor_vars_t *v
 }
 
 #define tmpl_setup_and_cursor_build_init(_vp_out, _ref) \
-       if (_tmpl_setup_and_cursor_build_init(_vp_out, &vars, request, _ref)) return;
+       if (_tmpl_setup_and_cursor_build_init(_vp_out, &vars, request, _ref)) return
 
 /*
  *     How every test ends
index af469c5f0fb968ba73b39429cd39c8f3f7aec33c..59e0c4c794dd867118e17218934e7d63239d89fa 100644 (file)
@@ -1229,7 +1229,7 @@ done:
        if (tmpl_eval_cast_in_place(&list, vpt) < 0) {
                fr_value_box_list_talloc_free(&list);
                return -1;
-       };
+       }
 
        fr_value_box_list_move(out, &list);
        return 0;
@@ -1449,7 +1449,7 @@ done:
        if (tmpl_eval_cast_in_place(&list, vpt) < 0) {
                fr_value_box_list_talloc_free(&list);
                return -1;
-       };
+       }
 
        fr_value_box_list_move(out, &list);
        return 0;
index 4419627c8e7b3c5f5c6001b5f7c05f98daf7e7da..229ff8ea8806dd5baed46149c1405f9c9332021c 100644 (file)
@@ -406,7 +406,7 @@ int trigger_exec(unlang_interpret_t *intp,
                args_error:
                        talloc_free(request);
                        return -1;
-               };
+               }
 
                if (request_data_add(request, &trigger_exec_main, REQUEST_INDEX_TRIGGER_ARGS, local_args,
                                      false, false, false) < 0) goto args_error;
index 76cf5fc4f1e0e683486af36e18cd108695910657..49a71e748b8e00eb36cf8479a503a2b41cdf2028 100644 (file)
@@ -729,12 +729,12 @@ do { \
 /** Remove the current request from the sent list
  *
  */
-#define REQUEST_EXTRACT_SENT(_treq) fr_dlist_remove(&tconn->sent, treq);
+#define REQUEST_EXTRACT_SENT(_treq) fr_dlist_remove(&tconn->sent, treq)
 
 /** Remove the current request from the cancel list
  *
  */
-#define REQUEST_EXTRACT_CANCEL(_treq) fr_dlist_remove(&tconn->cancel, treq);
+#define REQUEST_EXTRACT_CANCEL(_treq) fr_dlist_remove(&tconn->cancel, treq)
 
 /** Remove the current request from the cancel_partial slot
  *
@@ -748,7 +748,7 @@ do { \
 /** Remove the current request from the cancel sent list
  *
  */
-#define REQUEST_EXTRACT_CANCEL_SENT(_treq) fr_dlist_remove(&tconn->cancel_sent, treq);
+#define REQUEST_EXTRACT_CANCEL_SENT(_treq) fr_dlist_remove(&tconn->cancel_sent, treq)
 
 /** Reorder the connections in the active heap
  *
@@ -870,7 +870,7 @@ do { \
               fr_table_str_by_value(fr_trunk_states, _new, "<INVALID>")); \
        CALL_WATCHERS(trunk, _new); \
        trunk->pub.state = _new; \
-} while (0);
+} while (0)
 
 static void trunk_request_enter_backlog(fr_trunk_request_t *treq, bool new);
 static void trunk_request_enter_pending(fr_trunk_request_t *treq, fr_trunk_connection_t *tconn, bool new);
@@ -1666,13 +1666,13 @@ static uint64_t trunk_connection_requests_dequeue(fr_dlist_head_t *out, fr_trunk
 
 #define OVER_MAX_CHECK if (++count > max) return (count - 1)
 
-#define DEQUEUE_ALL(_src_list, _state) \
+#define DEQUEUE_ALL(_src_list, _state) do { \
        while ((treq = fr_dlist_head(_src_list))) { \
                OVER_MAX_CHECK; \
                fr_assert(treq->pub.state == (_state)); \
                trunk_request_enter_unassigned(treq); \
                fr_dlist_insert_tail(out, treq); \
-       }
+       } } while (0)
 
        /*
         *      Don't need to do anything with
@@ -4365,7 +4365,7 @@ do { \
                        count += fr_trunk_request_count_by_connection(tconn, req_state); \
                } \
        } \
-} while (0);
+} while (0)
 
        if (conn_state & FR_TRUNK_CONN_ACTIVE) {
                for (tconn = fr_minmax_heap_iter_init(trunk->active, &iter);
@@ -4565,7 +4565,7 @@ do { \
                        fr_connection_signal_reconnect(((fr_trunk_connection_t *)fr_dlist_tail(&trunk->_list))->pub.conn, reason); \
                } \
        } \
-} while (0);
+} while (0)
 
        /*
         *      Connections in the 'connecting' state
@@ -4926,7 +4926,7 @@ do { \
                            "CONSISTENCY_CHECK_FAILED %s[%i}: trunk request-trunk mismatch", file, line); \
        fr_fatal_assert_msg(_state == _treq->pub.state, \
                            "CONSISTENCY_CHECK_FAILED %s[%i}: trunk request-state mismatch", file, line); \
-} while (0);
+} while (0)
 
 #define TREQ_DLIST_VERIFY(_dlist, _state) \
 do { \
@@ -4935,7 +4935,7 @@ do { \
                fr_trunk_request_verify(file, line, treq); \
                TCONN_TREQ_CHECKS(treq, _state); \
        } \
-} while (0);
+} while (0)
 
 #define TREQ_HEAP_VERIFY(_heap, _state) \
 do { \
@@ -4947,7 +4947,7 @@ do { \
                fr_trunk_request_verify(file, line, treq); \
                TCONN_TREQ_CHECKS(treq, _state); \
        } \
-} while (0);
+} while (0)
 
 #define TREQ_OPTION_VERIFY(_option, _state) \
 do { \
@@ -4955,7 +4955,7 @@ do { \
                fr_trunk_request_verify(file, line, tconn->_option); \
                TCONN_TREQ_CHECKS(tconn->_option, _state); \
        } \
-} while (0);
+} while (0)
 
        /* verify associated requests */
        TREQ_HEAP_VERIFY(pending, FR_TRUNK_REQUEST_STATE_PENDING);
@@ -5036,7 +5036,7 @@ do { \
                        return true; \
                } \
        } \
-} while (0);
+} while (0)
 
 #define TREQ_HEAP_SEARCH(_heap) \
 do { \
@@ -5053,7 +5053,7 @@ do { \
                        return true; \
                } \
        } \
-} while (0);
+} while (0)
 
 #define TREQ_OPTION_SEARCH(_option) \
 do { \
@@ -5067,7 +5067,7 @@ do { \
                        return true; \
                } \
        } \
-} while (0);
+} while (0)
 
        /* search associated requests */
        TREQ_HEAP_SEARCH(pending);
index 2de4c0f4b5f32096ca0a4fbb03594984145fd414..2e029945d861b2aca91885bfd6dc626517236d3f 100644 (file)
@@ -244,7 +244,7 @@ static inline CC_HINT(nonnull) void _fr_tls_session_request_unbind(char const *f
  *
  * @param[in] ssl      session containing the request pointer.
  */
-#define fr_tls_session_request_unbind(_ssl) _fr_tls_session_request_unbind(__FILE__, __LINE__, _ssl);
+#define fr_tls_session_request_unbind(_ssl) _fr_tls_session_request_unbind(__FILE__, __LINE__, _ssl)
 
 /** Add extra pairs to the temporary subrequests
  *
index e9a0d242d615ce446117e5ebc244d9282180b8a1..e5881879fc2a7b90ca1cbb4f649d2b134ea9d1fd 100644 (file)
@@ -228,7 +228,7 @@ static inline CC_HINT(always_inline) int unlang_rules_verify(tmpl_rules_t const
 #if 0
 #define ATTR_RULES_VERIFY(_rules) if (unlang_attr_rules_verify(_rules) < 0) return NULL;
 #endif
-#define RULES_VERIFY(_rules) if (unlang_rules_verify(_rules) < 0) return NULL;
+#define RULES_VERIFY(_rules) do { if (unlang_rules_verify(_rules) < 0) return NULL; } while (0)
 
 static bool pass2_fixup_tmpl(TALLOC_CTX *ctx, tmpl_t **vpt_p, CONF_ITEM const *ci, fr_dict_t const *dict)
 {
@@ -521,7 +521,7 @@ static bool pass2_fixup_cond_map(fr_cond_t *c, CONF_ITEM *ci, fr_dict_t const *d
         */
        if (tmpl_cast_set(map->rhs, tmpl_attr_tail_da(map->lhs)->type) < 0) {
                cf_log_perr(map->ci, "Failed setting rhs type");
-       };
+       }
 
        if (map->op != T_OP_CMP_EQ) {
                cf_log_err(map->ci, "Must use '==' for comparisons with virtual attribute %s", map->lhs->name);
@@ -4747,7 +4747,7 @@ static unlang_t *compile_module(unlang_t *parent, unlang_compile_t *unlang_ctx,
                fr_assert_msg(method_env->inst_size, "Method environment for module %s, method %s %s declared, "
                              "but no inst_size set",
                              inst->module->name, unlang_ctx->section_name1, unlang_ctx->section_name2);
-       };
+       }
 
        /*
         *      If a module reference is a section, then the section
index 18a9cb574643555f268c58e4e2ffab2d298ca9fe..b89c8fc6ce8233dfc49d9b73006a8a6e37664bc6 100644 (file)
@@ -107,7 +107,7 @@ static char *stack_unwind_flag_dump(uint8_t unwind)
        size_t len;
 
 #define UNWIND_FLAG_DUMP(attrib) \
-       if (unwind & attrib) strcat(buf, #attrib" ");
+       if (unwind & attrib) strcat(buf, #attrib" ")
 
        snprintf(buf, sizeof(buf), "unwind=0x%x (", unwind);
 
@@ -1460,7 +1460,7 @@ static xlat_action_t unlang_interpret_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                        error:
                                talloc_free(vb);
                                return XLAT_ACTION_FAIL;
-                       };
+                       }
                        goto finish;
                }
 
index 1ee7dc49d9450d656dd92feb1f0902418a4a5522..7bbdfd0fc0fd1b9a603ad7d8ec20c713c63866be 100644 (file)
@@ -239,7 +239,7 @@ static unlang_action_t list_mod_create(rlm_rcode_t *p_result, request_t *request
 
                        break;
                }
-       };
+       }
 
        return list_mod_apply(p_result, request);
 }
index f7c0077947978ac6cdcb6c9539991dbeb4b91468..db419c166c597fcbe94de8b3300e3f9eae3b8399 100644 (file)
@@ -469,7 +469,7 @@ static unlang_action_t unlang_parallel(rlm_rcode_t *p_result, request_t *request
        if (!state) {
                *p_result = RLM_MODULE_FAIL;
                return UNLANG_ACTION_CALCULATE_RESULT;
-       };
+       }
 
        (void) talloc_set_type(state, unlang_parallel_state_t);
        state->result = RLM_MODULE_FAIL;
index 3d41debe192f3985a44b741919ce66bad6834587..785f77fb6f29cfcf696b1c39b4166ba8dbe24f01 100644 (file)
@@ -286,14 +286,14 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
        do { \
                *(_a) = fr_value_box_list_head(_list); \
                XLAT_ARGS_NEXT(_list, _a, _b); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_3(_list, _a, _b, _c) \
        do { \
                *(_a) = fr_value_box_list_head(_list); \
                XLAT_ARGS_NEXT(_list, _a, _b); \
                XLAT_ARGS_NEXT(_list, _b, _c); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_4(_list, _a, _b, _c, _d) \
        do { \
@@ -301,7 +301,7 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
                XLAT_ARGS_NEXT(_list, _a, _b); \
                XLAT_ARGS_NEXT(_list, _b, _c); \
                XLAT_ARGS_NEXT(_list, _c, _d); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_5(_list, _a, _b, _c, _d, _e) \
        do { \
@@ -310,7 +310,7 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
                XLAT_ARGS_NEXT(_list, _b, _c); \
                XLAT_ARGS_NEXT(_list, _c, _d); \
                XLAT_ARGS_NEXT(_list, _d, _e); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_6(_list, _a, _b, _c, _d, _e, _f) \
        do { \
@@ -320,7 +320,7 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
                XLAT_ARGS_NEXT(_list, _c, _d); \
                XLAT_ARGS_NEXT(_list, _d, _e); \
                XLAT_ARGS_NEXT(_list, _e, _f); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_7(_list, _a, _b, _c, _d, _e, _f, _g) \
        do { \
@@ -331,7 +331,7 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
                XLAT_ARGS_NEXT(_list, _d, _e); \
                XLAT_ARGS_NEXT(_list, _e, _f); \
                XLAT_ARGS_NEXT(_list, _f, _g); \
-       } while (0);
+       } while (0)
 
 #define XLAT_ARGS_8(_list, _a, _b, _c, _d, _e, _f, _g, _h) \
        do { \
@@ -343,7 +343,7 @@ typedef int (*xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx);
                XLAT_ARGS_NEXT(_list, _e, _f); \
                XLAT_ARGS_NEXT(_list, _f, _g); \
                XLAT_ARGS_NEXT(_list, _g, _h); \
-       } while (0);
+       } while (0)
 
 /** Trampoline macro for selecting which ``XLAT_ARGS_<num>`` macro to expand
  *
index 5d63d3dbb1cfbae985ad9b890d60b30b9a2deea0..ae7f2594370f87b5b829960b0d8765fb0b702e00 100644 (file)
@@ -2056,12 +2056,12 @@ static fr_slen_t expr_cast_from_substr(fr_type_t *cast, fr_sbuff_t *in)
 
        if (!fr_type_is_leaf(*cast)) {
                fr_strerror_printf("Invalid data type '%s' in cast", fr_type_to_str(*cast));
-               FR_SBUFF_ERROR_RETURN(&our_in)
+               FR_SBUFF_ERROR_RETURN(&our_in);
        }
 
        if (!fr_sbuff_next_if_char(&our_in, close)) {
                fr_strerror_const("Unterminated cast");
-               FR_SBUFF_ERROR_RETURN(&our_in)
+               FR_SBUFF_ERROR_RETURN(&our_in);
        }
        fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL);
 
index 77f49d010794bf6dfa4a9ebb113e2caf3dba6511..0b1721146657499c29e423cbfcebad73f41bdec4 100644 (file)
@@ -125,7 +125,7 @@ static inline int fr_atexit_talloc_free(void *to_free)
  * @param[in] _uctx            data to be passed to free function.
  */
 #define fr_atexit_global_once_ret(_ret, _init, _free, _uctx) \
-{ \
+do { \
        static atomic_bool      _init_done = false; \
        static pthread_mutex_t  _init_mutex = PTHREAD_MUTEX_INITIALIZER; \
        void *_our_uctx = _uctx; /* stop _uctx being evaluated multiple times, it may be a call to malloc() */ \
@@ -140,7 +140,7 @@ static inline int fr_atexit_talloc_free(void *to_free)
                } \
                pthread_mutex_unlock(&_init_mutex); \
        } \
-}
+} while (0)
 
 /** Setup pair of global init/free functions
  *
@@ -184,7 +184,7 @@ do { \
        void *_our_uctx = _uctx; /* stop _uctx being evaluated multiple times, it may be a call to malloc() */ \
        _fr_atexit_thread_local(__FILE__, __LINE__, _free, _our_uctx); \
        _name = _our_uctx; \
-} while (0);
+} while (0)
 
 int            _fr_atexit_thread_local(char const *file, int line,
                                        fr_atexit_t func, void const *uctx);
index 19d8060cc00f43114e8401ed12398bc7f8856c62..691c9659b38d8cfd2ebcdb7356625cd751f620a4 100644 (file)
@@ -164,7 +164,7 @@ fr_slen_t fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr
                FR_DBUFF_IN_BYTES_RETURN(&our_out, (alphabet[us(p[0])] << 4) | alphabet[us(p[1])]);
 
                fr_sbuff_advance(&our_in, 2);
-       };
+       }
 
        if (err) *err = FR_SBUFF_PARSE_OK;
 
index 3a91583c5b35a512df70a5cbfa1808bf45083a37..de5ce998e69f5ff8628c640cd21f668e7fc0fd1a 100644 (file)
@@ -29,7 +29,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/syserror.h>
 
 #if defined(STATIC_ANALYZER) || !defined(NDEBUG)
-#  define CHECK_DBUFF_INIT(_sbuff)     if (!(_sbuff)->extend && (unlikely(!(_sbuff)->buff) || unlikely(!(_sbuff)->start) || unlikely(!(_sbuff)->end) || unlikely(!(_sbuff)->p))) return 0;
+#  define CHECK_DBUFF_INIT(_sbuff)     do { if (!(_sbuff)->extend && (unlikely(!(_sbuff)->buff) || unlikely(!(_sbuff)->start) || unlikely(!(_sbuff)->end) || unlikely(!(_sbuff)->p))) return 0; } while (0)
 #else
 #  define CHECK_DBUFF_INIT(_sbuff)
 #endif
index b5c1770094abc385fbd20c90b45cd4e5a35aeb8b..2f9e02d673e5bfb71e69e70c7db912747ad10556 100644 (file)
@@ -549,7 +549,7 @@ static inline int _dbuff_thread_local_free(void *dbtl)
  * @param[in] _max             Maximum size of the dbuff buffer.
  */
 #define FR_DBUFF_TALLOC_THREAD_LOCAL(_out, _init, _max) \
-{ \
+do { \
        static _Thread_local fr_dbuff_thread_local_t *_dbuff_t_local; \
        if (!_dbuff_t_local) { \
                fr_dbuff_thread_local_t *dbtl = talloc_zero(NULL, fr_dbuff_thread_local_t); \
@@ -560,7 +560,7 @@ static inline int _dbuff_thread_local_free(void *dbtl)
                fr_dbuff_reset_talloc(&_dbuff_t_local->dbuff); \
                *(_out) = &_dbuff_t_local->dbuff; \
        } \
-}
+} while (0)
 /** @} */
 
 /** @name Extension requests
index 67d8612e3f493be4c56eab2401c7d86b5db7bc19..acfc4e2562f6b026b022843c4dd21e5a66349bfb 100644 (file)
@@ -115,7 +115,7 @@ typedef struct {
 } fr_dcursor_stack_t;
 
 #ifndef TALLOC_GET_TYPE_ABORT_NOOP
-#define VALIDATE(_item) if (cursor->dlist->type && (_item)) _talloc_get_type_abort(_item, cursor->dlist->type, __location__);
+#define VALIDATE(_item) do { if (cursor->dlist->type && (_item)) _talloc_get_type_abort(_item, cursor->dlist->type, __location__); } while (0)
 #else
 #define VALIDATE(_item)
 #endif
index 6c9536e439ed84ed2d3780541da8220bd94c0df9..e93bfabe1f239786f7d25fb86ef36f432e21cd04 100644 (file)
@@ -577,7 +577,7 @@ void backtrace_print(fr_fring_t *fring, void *obj)
                        fprintf(stderr, "Stacktrace for: %p\n", p->obj);
                        backtrace_symbols_fd(p->frames, p->count, STDERR_FILENO);
                }
-       };
+       }
 
        if (!found) {
                fprintf(stderr, "No backtrace available for %p", obj);
index c86ac2f1a6505c3b6ca9c23da3be14dcc0e343af..73f3735742f3f2dad65f480d5d6dc02c20b17a73 100644 (file)
@@ -579,7 +579,7 @@ fr_slen_t fr_dict_unknown_afrom_oid_substr(TALLOC_CTX *ctx,
                }
                }
                break;
-       };
+       }
 
        DA_VERIFY(n);
 
index a0413a6e75ae2cbd65bc0fe4fe0d87965a4ee01c..160024f207598056a70f6ef72dbbf9f087e37c77 100644 (file)
@@ -282,10 +282,10 @@ static inline void fr_dlist_clear(fr_dlist_head_t *list_head)
  *
  */
 #define CHECK_ELEMENT_COUNT(_head, _add) \
-       if (unlikely((_head)->num_elements > (UINT_MAX - (_add)))) { \
+       if (unlikely((_head)->num_elements > (UINT_MAX - (_add)))) do { \
                fr_strerror_const("Maximum elements in list"); \
                return -1; \
-       }
+       } while (0)
 
 /** Check if a list entry is part of a list
  *
index ea1f8a6a318d4ed40c940c03b24e67f614879fd1..527b0ac8c7c5af6dd650951483b0019fb57e1064 100644 (file)
@@ -208,7 +208,7 @@ void fr_edit_list_abort(fr_edit_list_t *el)
                 *      talloc_free(el).  That should be somewhat
                 *      faster than doing it incrementally.
                 */
-       };
+       }
 
        talloc_free(el);
 }
index 5762a0b75f903c3778538bacede256c316fe3cf6..2e4c500dc484a79b6673fbd84284744521ecd5e3 100644 (file)
@@ -38,7 +38,7 @@ RCSID("$Id$")
 #define HEAP_PARENT(_x)        ((_x) >> 1)
 #define HEAP_LEFT(_x)  (2 * (_x))
 #define HEAP_RIGHT(_x) (2 * (_x) + 1 )
-#define        HEAP_SWAP(_a, _b) { void *_tmp = _a; _a = _b; _b = _tmp; }
+#define        HEAP_SWAP(_a, _b) do { void *_tmp = _a; _a = _b; _b = _tmp; } while (0)
 
 static void fr_heap_bubble(fr_heap_t *h, fr_heap_index_t child);
 
@@ -99,8 +99,8 @@ static inline CC_HINT(always_inline, nonnull) void index_set(fr_heap_t *h, void
        *((fr_heap_index_t *)(((uint8_t *)data) + h->offset)) = idx;
 }
 
-#define OFFSET_SET(_heap, _idx) index_set(_heap, _heap->p[_idx], _idx);
-#define OFFSET_RESET(_heap, _idx) index_set(_heap, _heap->p[_idx], 0);
+#define OFFSET_SET(_heap, _idx) index_set(_heap, _heap->p[_idx], _idx)
+#define OFFSET_RESET(_heap, _idx) index_set(_heap, _heap->p[_idx], 0)
 
 static inline CC_HINT(always_inline)
 int realloc_heap(fr_heap_t **hp, unsigned int n_size)
index 37c5e29a2250db23068e429eec5ed29a7c7060b7..34a829076fb450282b995ff0c58c4eaf88f8334f 100644 (file)
@@ -17,12 +17,12 @@ RCSID("$Id$")
 
 #define ind(mm,x)  ((mm)[(x >> 2) &(RANDSIZ-1)])
 #define rngstep(mix, a, b, mm, m, m2, r, x) \
-{ \
+do { \
        x = *m;  \
        a = ((a^(mix)) + *(m2++)) & 0xffffffff; \
        *(m++) = y = (ind(mm, x) + a + b) & 0xffffffff; \
        *(r++) = b = (ind(mm, y >> RANDSIZL) + x) & 0xffffffff; \
-}
+} while (0)
 
 void fr_isaac(fr_randctx *ctx)
 {
@@ -51,7 +51,7 @@ void fr_isaac(fr_randctx *ctx)
 
 
 #define mix(a,b,c,d,e,f,g,h) \
-{ \
+do { \
        a ^= b << 11; d += a; b += c; \
        b ^= c >> 2;  e += b; c += d; \
        c ^= d << 8;  f += c; d += e; \
@@ -60,7 +60,7 @@ void fr_isaac(fr_randctx *ctx)
        f ^= g >> 4;  a += f; g += h; \
        g ^= h << 8;  b += g; h += a; \
        h ^= a >> 9;  c += h; a += b; \
-}
+} while (0)
 
 /* if (flag==1), then use the contents of randrsl[] to initialize mm[]. */
 void fr_rand_init(fr_randctx *ctx, int flag)
index 9be259f1de09a388963612524e21f31be0b2664d..a7b4ef16f0830a360ebe5cdb05c6e3cf04441f79 100644 (file)
@@ -236,7 +236,7 @@ void fr_log_fd_event(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, void
                 *      Clear out the existing data
                 */
                fr_sbuff_shift(&sbuff, fr_sbuff_used(&m_start));
-       };
+       }
 }
 
 /** Maps log categories to message prefixes
index 69c0ac19d2a189717496d930c986a853d29643ff..069488816e3639852340bbd2e6c42b96d2887227 100644 (file)
@@ -116,7 +116,7 @@ void                *fr_lst_iter_next(fr_lst_t *lst, fr_lst_iter_t *iter) CC_HINT(nonnull);
 
 #ifndef TALLOC_GET_TYPE_ABORT_NOOP
 void fr_lst_verify(char const *file, int line, fr_lst_t const *lst);
-#define FR_LST_VERIFY(_lst) fr_lst_verify(__FILE__, __LINE__, _lst);
+#define FR_LST_VERIFY(_lst) fr_lst_verify(__FILE__, __LINE__, _lst)
 #elif !defined(NDEBUG)
 #define FR_LST_VERIFY(_lst) fr_assert(_lst)
 #else
index 3509ca05b93bef0ba4f0cb9ca3dadc949239aec9..3ffddc515693dac2a7dd3a88c92de80c16f247cc 100644 (file)
@@ -75,7 +75,7 @@ typedef struct fr_minmax_heap_s minmax_heap_t;
 #define HEAP_GRANDPARENT(_x)   HEAP_PARENT(HEAP_PARENT(_x))
 #define HEAP_LEFT(_x)  (2 * (_x))
 #define HEAP_RIGHT(_x) (2 * (_x) + 1 )
-#define        HEAP_SWAP(_a, _b) { void *_tmp = _a; _a = _b; _b = _tmp; }
+#define        HEAP_SWAP(_a, _b) do { void *_tmp = _a; _a = _b; _b = _tmp; } while (0)
 
 /**
  * @hidecallergraph
@@ -205,8 +205,8 @@ static inline bool has_grandchildren(minmax_heap_t *h, fr_minmax_heap_index_t i)
        return HEAP_LEFT(HEAP_LEFT(i)) <= h->num_elements;
 }
 
-#define OFFSET_SET(_heap, _idx) index_set(_heap, _heap->p[_idx], _idx);
-#define OFFSET_RESET(_heap, _idx) index_set(_heap, _heap->p[_idx], 0);
+#define OFFSET_SET(_heap, _idx) index_set(_heap, _heap->p[_idx], _idx)
+#define OFFSET_RESET(_heap, _idx) index_set(_heap, _heap->p[_idx], 0)
 
 /*
  *     The minmax heap has the same basic idea as binary heaps:
index d2ed0e6888287b84b8b57c19ad68fdfef768b280..22ceec8014a64e8884089013ac33a68c15869e94 100644 (file)
@@ -787,7 +787,7 @@ static inline fr_slen_t CC_HINT(nonnull(2,4))
 
 void           fr_pair_fprint(FILE *, fr_pair_t const *vp) CC_HINT(nonnull);
 
-#define                fr_pair_list_log(_log, _lvl, _list) _fr_pair_list_log(_log, _lvl, NULL, _list, __FILE__, __LINE__);
+#define                fr_pair_list_log(_log, _lvl, _list) _fr_pair_list_log(_log, _lvl, NULL, _list, __FILE__, __LINE__)
 void           _fr_pair_list_log(fr_log_t const *log, int lvl, fr_pair_t *parent,
                                  fr_pair_list_t const *list, char const *file, int line) CC_HINT(nonnull(1,4));
 
index bb3da950afd1012d6bccc01338c9c4eb5eb63309..2fbcc9759dd435eb518a763afb1570e5f2174f64 100644 (file)
@@ -177,26 +177,26 @@ void fr_rand_str(uint8_t *out, size_t len, char class)
  *     yeah yeah not perfect distribution
  *     but close enough.
  */
-#define fill(_expr) \
+#define fill(_expr) do { \
 while (p < end) { \
        if ((mod = ((p - out) & (sizeof(word) - 1))) == 0) word = fr_rand(); \
        byte = ((uint8_t *)&word)[mod]; \
        *p++ = (_expr); \
-}
+} } while (0)
 
        switch (class) {
        /*
         *  Lowercase letters
         */
        case 'c':
-               fill('a' + (byte % 26))
+               fill('a' + (byte % 26));
                return;
 
        /*
         *  Uppercase letters
         */
        case 'C':
-               fill('A' + (byte % 26))
+               fill('A' + (byte % 26));
                return;
 
        /*
@@ -247,7 +247,7 @@ while (p < end) { \
         */
        case 'b':
        default:
-               fill(byte)
+               fill(byte);
                return;
        }
 }
index 2770b3525f3145d00d5cf83bc8993f64d7359225..133b56a4d104965f3ab84859f6e0c477732752be 100644 (file)
@@ -44,7 +44,7 @@ fr_table_num_ordered_t const sbuff_parse_error_table[] = {
 size_t sbuff_parse_error_table_len = NUM_ELEMENTS(sbuff_parse_error_table);
 
 #if defined(STATIC_ANALYZER) || !defined(NDEBUG)
-#  define CHECK_SBUFF_INIT(_sbuff)     if (!(_sbuff)->extend && (unlikely(!(_sbuff)->buff) || unlikely(!(_sbuff)->start) || unlikely(!(_sbuff)->end) || unlikely(!(_sbuff)->p))) return 0;
+#  define CHECK_SBUFF_INIT(_sbuff)     do { if (!(_sbuff)->extend && (unlikely(!(_sbuff)->buff) || unlikely(!(_sbuff)->start) || unlikely(!(_sbuff)->end) || unlikely(!(_sbuff)->p))) return 0; } while (0)
 #else
 #  define CHECK_SBUFF_INIT(_sbuff)
 #endif
@@ -798,7 +798,7 @@ size_t fr_sbuff_out_bstrncpy_allowed(fr_sbuff_t *out, fr_sbuff_t *in, size_t len
                FILL_OR_GOTO_DONE(out, &our_in, p - our_in.p);
 
                if (p != end) break;            /* stopped early, break */
-       };
+       }
 
 done:
        *out->p = '\0';
@@ -871,7 +871,7 @@ size_t fr_sbuff_out_bstrncpy_until(fr_sbuff_t *out, fr_sbuff_t *in, size_t len,
                FILL_OR_GOTO_DONE(out, &our_in, p - our_in.p);
 
                if (p != end) break;            /* stopped early, break */
-       };
+       }
 
 done:
        *out->p = '\0';
@@ -1049,7 +1049,7 @@ size_t fr_sbuff_out_unescape_until(fr_sbuff_t *out, fr_sbuff_t *in, size_t len,
        next:
                if (tt && fr_sbuff_terminal_search(in, fr_sbuff_current(&our_in), idx, tt, needle_len)) break;
                fr_sbuff_advance(&our_in, 1);
-       };
+       }
 
        /*
         *      Copy any remaining data over
@@ -1850,7 +1850,7 @@ size_t fr_sbuff_adv_until(fr_sbuff_t *sbuff, size_t len, fr_sbuff_term_t const *
 
                total += fr_sbuff_set(sbuff, p);
                if (p != end) break;    /* stopped early, break */
-       };
+       }
 
        return total;
 }
index ef318675a95fcfd843116d0bd31762688f99ee55..4829898f8511e886122b962110531f78c7fa86b1 100644 (file)
@@ -559,7 +559,7 @@ static inline int _sbuff_thread_local_free(void *sbtl)
  * @param[in] _max             Maximum size of the sbuff buffer.
  */
 #define FR_SBUFF_TALLOC_THREAD_LOCAL(_out, _init, _max) \
-{ \
+do { \
        static _Thread_local fr_sbuff_thread_local_t *_sbuff_t_local; \
        if (!_sbuff_t_local) { \
                fr_sbuff_thread_local_t *sbtl = talloc_zero(NULL, fr_sbuff_thread_local_t); \
@@ -570,7 +570,7 @@ static inline int _sbuff_thread_local_free(void *sbtl)
                fr_sbuff_reset_talloc(&_sbuff_t_local->sbuff); \
                *(_out) = &_sbuff_t_local->sbuff; \
        } \
-}
+} while (0)
 
 void   fr_sbuff_update(fr_sbuff_t *sbuff, char *new_buff, size_t new_len);
 
@@ -936,7 +936,7 @@ static inline fr_slen_t _fr_sbuff_error(fr_sbuff_t *sbuff, char const *err)
  * An error at offset 0 will be returned as -1.
  */
 #define fr_sbuff_error(_sbuff_or_marker) \
-       _fr_sbuff_error(fr_sbuff_ptr(_sbuff_or_marker), fr_sbuff_current(_sbuff_or_marker));
+       _fr_sbuff_error(fr_sbuff_ptr(_sbuff_or_marker), fr_sbuff_current(_sbuff_or_marker))
 
 /** Like fr_sbuff_used, but adjusts for the value returned for the amount shifted
  *
index 8bcaa6847d8b585f7fb04a2dea920079950857f8..0bcccca9037e19df3bb39d453cc44e9107c626dd 100644 (file)
@@ -23,11 +23,11 @@ RCSID("$Id$")
     ^block->l[(i+2)&15]^block->l[i&15],1))
 
 /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
-#  define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
-#  define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
-#  define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
-#  define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
-#  define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
+#  define R0(v,w,x,y,z,i) do { z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); } while (0)
+#  define R1(v,w,x,y,z,i) do { z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); } while (0)
+#  define R2(v,w,x,y,z,i) do { z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); } while (0)
+#  define R3(v,w,x,y,z,i) do { z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); } while (0)
+#  define R4(v,w,x,y,z,i) do { z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); } while (0)
 
 
 /* Hash a single 512-bit block. This is the core of the algorithm. */
index 7323f30ab7ac59121aac167a2555fdf2b6e18faa..34c20ce1b4a26135e8fd9505d2dc913668982ced 100644 (file)
@@ -125,7 +125,7 @@ static void trie_sprint(fr_trie_t *trie, uint8_t const *key, int start_bit, int
 #ifdef WITH_TRIE_VERIFY
 static int trie_verify(fr_trie_t *trie);
 //#define VERIFY(_x) fr_cond_assert(trie_verify((fr_trie_t *) _x) == 0)
-#define VERIFY(_x) do { if (trie_verify((fr_trie_t *) _x) < 0) { fprintf(stderr, "FAIL VERIFY at %d - %s\n", __LINE__, fr_strerror()); fr_cond_assert(0);} } while (0)
+#define VERIFY(_x) if (trie_verify((fr_trie_t *) _x) < 0) do { fprintf(stderr, "FAIL VERIFY at %d - %s\n", __LINE__, fr_strerror()); fr_cond_assert(0); } while (0)
 #else
 #define VERIFY(_x)
 #endif
index 6069b3e5ae44e5fede1ec5810ff371dd6dc8b3c1..2f76d829f6353a7cc87787b14ba57753478c4fd3 100644 (file)
@@ -675,7 +675,7 @@ int8_t fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b)
         *      Short-hand for simplicity.
         */
 #define RETURN(_type) return CMP(a->datum._type, b->datum._type)
-#define COMPARE(_type) return CMP(memcmp(&a->datum._type, &b->datum._type, sizeof(a->datum._type)), 0);
+#define COMPARE(_type) return CMP(memcmp(&a->datum._type, &b->datum._type, sizeof(a->datum._type)), 0)
 
        case FR_TYPE_BOOL:
                RETURN(boolean);
index b37de369850755e88caf3851e29d57e9a48f7cb7..70acf6ad483c3f86c82dafc01167db3916eb83cc 100644 (file)
@@ -294,7 +294,7 @@ int ldap_sync_cookie_send(sync_packet_ctx_t *sync_packet_ctx)
        error:
                talloc_free(local);
                return -1;
-       };
+       }
 
        fr_pair_list_append_by_da(local, vp, &pairs, attr_packet_type, (uint32_t)FR_LDAP_SYNC_CODE_COOKIE_STORE, true);
        if (!vp) goto error;
@@ -425,7 +425,7 @@ int ldap_sync_entry_send(sync_state_t *sync, uint8_t const uuid[SYNC_UUID_LENGTH
                if (msg) ldap_msgfree(msg);
                talloc_free(sync_packet_ctx);
                return -1;
-       };
+       }
 
        pcode = sync_packet_code_table[op];
 
@@ -485,7 +485,7 @@ int ldap_sync_entry_send(sync_state_t *sync, uint8_t const uuid[SYNC_UUID_LENGTH
                                                          values[i]->bv_len, NULL, true) < 0) {
                                        fr_pair_remove(pairs, vp);
                                        talloc_free(vp);
-                               };
+                               }
 
                                /*  Only += operator adds multiple values */
                                if (map->op != T_OP_ADD_EQ) break;
index 1c455e037742992c1268acbf4aa1db5e399ee3b6..f003bd241fa28ceece0a6be418fdc5c136db636c 100644 (file)
@@ -1357,7 +1357,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        default:
                fr_assert(0);
                return -1;
-       };
+       }
 
        return 0;
 }
index 2e269848a022501faee54fe61c77ed08b872f6a3..46f6768041f69443934f9a5d8dbd2694b54729d0 100644 (file)
@@ -366,7 +366,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
        }
 
 #undef READFILE
-#define READFILE(_x, _y, _d) do { if (getusersfile(inst, inst->_x, &inst->_y, &inst->_d, inst->key_data_type) != 0) { ERROR("Failed reading %s", inst->_x); return -1;} } while (0)
+#define READFILE(_x, _y, _d) if (getusersfile(inst, inst->_x, &inst->_y, &inst->_d, inst->key_data_type) != 0) do { ERROR("Failed reading %s", inst->_x); return -1;} while (0)
 
        READFILE(filename, common, common_def);
        READFILE(usersfile, users, users_def);
index 0c182f9519d56be9b303a86192df476c4f74421f..d8b98b80f166ae88e10d5a32a20202414faeaaf7 100644 (file)
@@ -696,10 +696,10 @@ static void ldap_memberof_xlat_cancel(UNUSED request_t *request, UNUSED fr_signa
 }
 
 #define REPEAT_LDAP_MEMBEROF_XLAT_RESULTS \
-       if (unlang_function_repeat_set(request, ldap_memberof_xlat_results) < 0) { \
+       if (unlang_function_repeat_set(request, ldap_memberof_xlat_results) < 0) do { \
                rcode = RLM_MODULE_FAIL; \
                goto finish; \
-       }
+       } while (0)
 
 /** Run the state machine for the LDAP membership xlat
  *
@@ -1327,10 +1327,10 @@ static unlang_action_t mod_authorize_start(UNUSED rlm_rcode_t *p_result, UNUSED
 }
 
 #define REPEAT_MOD_AUTHORIZE_RESUME \
-       if (unlang_function_repeat_set(request, mod_authorize_resume) < 0) { \
+       if (unlang_function_repeat_set(request, mod_authorize_resume) < 0) do { \
                rcode = RLM_MODULE_FAIL; \
                goto finish; \
-       }
+       } while (0)
 
 /** Resume function called after each potential yield in LDAP authorization
  *
@@ -1415,7 +1415,7 @@ static unlang_action_t mod_authorize_resume(rlm_rcode_t *p_result, UNUSED int *p
                 *      Retrieve Universal Password if we use eDirectory
                 */
                if (inst->edir) {
-                       autz_ctx->dn = rlm_find_user_dn_cached(request);;
+                       autz_ctx->dn = rlm_find_user_dn_cached(request);
 
                        /*
                         *      Retrive universal password
index 583a6b14720a366cc72c1e88274a7072f2e4bbda..69772a37df8e52387519c86e38143da700a281d6 100644 (file)
@@ -1136,7 +1136,7 @@ static unlang_action_t CC_HINT(nonnull) mod_alloc(rlm_rcode_t *p_result, module_
         *      Fall back to lease_time otherwise.
         */
        lease_time = (env->offer_time.type == FR_TYPE_UINT32) ?
-                       env->offer_time.vb_uint32 : env->lease_time.vb_uint32;;
+                       env->offer_time.vb_uint32 : env->lease_time.vb_uint32;
        ippool_action_print(request, POOL_ACTION_ALLOCATE, L_DBG_LVL_2, &env->pool_name, NULL,
                            &env->owner, &env->gateway_id, lease_time);
        switch (redis_ippool_allocate(inst, request, env, lease_time)) {
index b66273395e6d0f06cd95020e4fe9562eaf4ff108..ee3b2e2050b80938adcb09b2c96771679860b66c 100644 (file)
@@ -1482,7 +1482,7 @@ do { \
        p->name = optarg; \
        p++; \
        need_pool = true; \
-} while (0);
+} while (0)
 
        while ((c = getopt(argc, argv, "a:d:r:s:Sm:A:U:O:p:ilLhxo:f:")) != -1) switch (c) {
                case 'a':
index c878d09e904439ef2b99b32cd20d731e752e2f80..13d290b4f5c9b3eae980850193bc54cffe97671a 100644 (file)
@@ -614,7 +614,7 @@ static ssize_t rest_request_encode_wrapper(char **out, UNUSED rlm_rest_t const *
                if (alloc > limit) break;
 
                MEM(buff = talloc_realloc(NULL, buff, char, alloc));
-       };
+       }
 
        talloc_free(buff);
 
@@ -1908,7 +1908,7 @@ int rest_request_config(module_ctx_t const *mctx, rlm_rest_section_t const *sect
        default:
                fr_assert(0);
                break;
-       };
+       }
 
        /*
         *      Set user based authentication parameters
@@ -2008,7 +2008,7 @@ do {\
 
        default:
                fr_assert(0);
-       };
+       }
 
        /*
         *  Setup encoder specific options
index ed0d2daff72d33c8dd1b5c27dcc595c788940e5c..b1de15bf6336728ea3a8d83d4b29c071722088e1 100644 (file)
@@ -737,7 +737,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
                        PERROR("Failed creating directory for SQLite database");
 
                        return -1;
-               };
+               }
 
                status = sqlite3_open_v2(inst->filename, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
                if (!db) {
index 2b5fb75fe130e2861c5b7ee50927276d4b6281ff..62b292324da54f51b0a8e76b0c424a4a5665fa7f 100644 (file)
@@ -523,7 +523,7 @@ ssize_t fr_dhcpv4_encode_dbuff(fr_dbuff_t *dbuff, dhcp_packet_t *original, int c
                len = fr_dhcpv4_encode_option(&work_dbuff,
                                              &cursor, &(fr_dhcpv4_ctx_t){ .root = fr_dict_root(dict_dhcpv4) });
                if (len <= 0) break;
-       };
+       }
 
        FR_DBUFF_IN_BYTES_RETURN(&work_dbuff, FR_END_OF_OPTIONS, 0x00);
 
index 0a5452738c68b5574673e98e1652a139b7a6b356..3dec19940a87628d66ff144e05de7326965758a2 100644 (file)
@@ -86,7 +86,7 @@ static ssize_t decode_value(TALLOC_CTX *ctx, fr_pair_list_t *out,
                raw:
                        return fr_pair_raw_from_network(ctx, out, parent, data, data_len);
 
-               };
+               }
 
                /*
                 *      Structs used fixed length IPv6 addressews.
index 636d4556945d9e36df619999ef90a90d6140089d..04f5947b92cc522762be64e41bcedcdf21a23e1b 100644 (file)
@@ -82,7 +82,7 @@ static ssize_t decode_value(TALLOC_CTX *ctx, fr_pair_list_t *out,
                raw:
                        return fr_pair_raw_from_network(ctx, out, parent, data, data_len);
 
-               };
+               }
 
                /*
                 *      Structs used fixed length fields
index 6701d8650d57b308fa1a71e6017adbc6726cad39..e92cb7216b69ed1e89facc012e1ac5ce350e8d6e 100644 (file)
@@ -155,7 +155,7 @@ fr_radius_packet_t  *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, ui
 int            fr_radius_packet_send(fr_radius_packet_t *packet, fr_pair_list_t *list,
                                      fr_radius_packet_t const *original, char const *secret) CC_HINT(nonnull (1,2,4));
 
-#define fr_radius_packet_log_hex(_log, _packet) _fr_radius_packet_log_hex(_log, _packet, __FILE__, __LINE__);
+#define fr_radius_packet_log_hex(_log, _packet) _fr_radius_packet_log_hex(_log, _packet, __FILE__, __LINE__)
 void           _fr_radius_packet_log_hex(fr_log_t const *log, fr_radius_packet_t const *packet, char const *file, int line) CC_HINT(nonnull);
 
 typedef struct {
index b15b8492bf96ddcabac03baf68feab601fc20e75..6b64507b06e520bb4377a38ca960b2d359e7b1ac 100644 (file)
@@ -351,5 +351,5 @@ void                fr_tacacs_free(void);
 
 int            fr_tacacs_body_xor(fr_tacacs_packet_t const *pkt, uint8_t *body, size_t body_len, char const *secret, size_t secret_len) CC_HINT(nonnull(1,2,4));
 
-#define fr_tacacs_packet_log_hex(_log, _packet, _size) _fr_tacacs_packet_log_hex(_log, _packet, _size, __FILE__, __LINE__);
+#define fr_tacacs_packet_log_hex(_log, _packet, _size) _fr_tacacs_packet_log_hex(_log, _packet, _size, __FILE__, __LINE__)
 void           _fr_tacacs_packet_log_hex(fr_log_t const *log, fr_tacacs_packet_t const *packet, size_t packet_len, char const *file, int line) CC_HINT(nonnull);