]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove #ifndef NDEBUG talloc_get_type_abort (where appropriate)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 17 Apr 2017 22:50:24 +0000 (18:50 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 17 Apr 2017 23:40:59 +0000 (19:40 -0400)
We use TALLOC_GET_TYPE_ABORT_NOOP now, which means in many cases we don’t need to explicitly ifdef out talloc_get_type_abort.

Where we have (void) talloc_get_type_abort() this should be ifdef’d out with #ifndef TALLOC_GET_TYPE_ABORT_NOOP so we don’t get self assignment errors from static analysis tools.

If anyone feels like writing a new talloc_get_type_abort_void() (or whatever macro, and replacing all the #ifndef TALLOC_GET_TYPE_ABORT_NOOP talloc_get_type_abort() lines, feel free.

18 files changed:
src/lib/io/channel.c
src/lib/io/control.c
src/lib/io/message.c
src/lib/io/queue.c
src/lib/io/receiver.c
src/lib/io/ring_buffer.c
src/lib/io/track.c
src/lib/io/worker.c
src/lib/util/dict.c
src/lib/util/event.c
src/lib/util/pair.c
src/lib/util/rbtree.c
src/main/request.c
src/main/state.c
src/main/unlang_interpret.c
src/modules/rlm_eap/eap.c
src/modules/rlm_redis_ippool/rlm_redis_ippool_tool.c
src/modules/rlm_rest/io.c

index fcbe90b1c9f2f37869908fc8cb73bbc1e8351308..235b3df7b2fffe6ffde6d1ba58dbe725d42eeac0 100644 (file)
@@ -682,8 +682,8 @@ fr_channel_event_t fr_channel_service_message(fr_time_t when, fr_channel_t **p_c
  */
 int fr_channel_service_kevent(fr_channel_t *ch, fr_control_t *c, struct kevent const *kev)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        if (fr_control_message_service_kevent(c, kev) == 0) {
@@ -726,8 +726,8 @@ int fr_channel_signal_worker_close(fr_channel_t *ch)
 {
        fr_channel_control_t cc;
 
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        ch->active = false;
@@ -750,8 +750,8 @@ int fr_channel_worker_ack_close(fr_channel_t *ch)
 {
        fr_channel_control_t cc;
 
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        ch->active = false;
@@ -770,8 +770,8 @@ int fr_channel_worker_ack_close(fr_channel_t *ch)
  */
 void fr_channel_worker_ctx_add(fr_channel_t *ch, void *ctx)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        ch->end[FROM_WORKER].ctx = ctx;
@@ -784,8 +784,8 @@ void fr_channel_worker_ctx_add(fr_channel_t *ch, void *ctx)
  */
 void *fr_channel_worker_ctx_get(fr_channel_t *ch)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        return ch->end[FROM_WORKER].ctx;
@@ -799,8 +799,8 @@ void *fr_channel_worker_ctx_get(fr_channel_t *ch)
  */
 void fr_channel_master_ctx_add(fr_channel_t *ch, void *ctx)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        ch->end[TO_WORKER].ctx = ctx;
@@ -813,8 +813,8 @@ void fr_channel_master_ctx_add(fr_channel_t *ch, void *ctx)
  */
 void *fr_channel_master_ctx_get(fr_channel_t *ch)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(ch, fr_channel_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(ch, fr_channel_t);
 #endif
 
        return ch->end[TO_WORKER].ctx;
index 1d3b34398cfcca5ef3672add277e8b4e1952706f..b10daa0a25f77cbc2217a93cf9011e3be7cf1b1d 100644 (file)
@@ -188,7 +188,7 @@ int fr_control_gc(UNUSED fr_control_t *c, fr_ring_buffer_t *rb)
  */
 void fr_control_free(fr_control_t *c)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(c, fr_control_t);
 #endif
 
@@ -257,7 +257,7 @@ int fr_control_message_push(fr_control_t *c, fr_ring_buffer_t *rb, uint32_t id,
 {
        fr_control_message_t *m;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(c, fr_control_t);
 #endif
 
@@ -305,7 +305,7 @@ int fr_control_message_send(fr_control_t *c, fr_ring_buffer_t *rb, uint32_t id,
        int rcode;
        struct kevent kev;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(c, fr_control_t);
 #endif
 
@@ -395,7 +395,7 @@ int fr_control_message_service_kevent(UNUSED fr_control_t *c, struct kevent cons
  */
 int fr_control_callback_add(fr_control_t *c, uint32_t id, void *ctx, fr_control_callback_t callback)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(c, fr_control_t);
 #endif
 
@@ -434,7 +434,7 @@ int fr_control_callback_add(fr_control_t *c, uint32_t id, void *ctx, fr_control_
  */
 int fr_control_callback_delete(fr_control_t *c, uint32_t id)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(c, fr_control_t);
 #endif
 
index c7ebbcc44732ed136e1a693c46a5859329fbafa0..7aadbcc06a31f1ee9fc85f5f6cc4951869b79462 100644 (file)
@@ -894,7 +894,7 @@ fr_message_t *fr_message_reserve(fr_message_set_t *ms, size_t reserve_size)
        bool cleaned_up;
        fr_message_t *m;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 #endif
 
@@ -948,7 +948,7 @@ fr_message_t *fr_message_alloc(fr_message_set_t *ms, fr_message_t *m, size_t act
 {
        uint8_t *p;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 
        /* m is NOT talloc'd */
@@ -1032,7 +1032,7 @@ fr_message_t *fr_message_alloc_reserve(fr_message_set_t *ms, fr_message_t *m, si
        uint8_t *p;
        fr_message_t *m2;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 
        /* m is NOT talloc'd */
@@ -1145,7 +1145,7 @@ fr_message_t *fr_message_alloc_aligned(fr_message_set_t *ms, fr_message_t *m, si
        size_t aligned_size;
 
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 
        /* m is NOT talloc'd */
@@ -1220,7 +1220,7 @@ int fr_message_set_messages_used(fr_message_set_t *ms)
 {
        int i, used;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 #endif
 
@@ -1249,7 +1249,7 @@ void fr_message_set_gc(fr_message_set_t *ms)
        int i;
        int num_cleaned;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 #endif
 
@@ -1278,7 +1278,7 @@ void fr_message_set_debug(fr_message_set_t *ms, FILE *fp)
 {
        int i;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ms, fr_message_set_t);
 #endif
 
index 556b26a38d3daf87169806eb7c4e8f39dc6f5a41..7efa71e51256d5691ee4ff96d77894ef796b75d8 100644 (file)
@@ -84,7 +84,7 @@ fr_queue_t *fr_queue_create(TALLOC_CTX *ctx, int size)
  */
 bool fr_queue_push(fr_queue_t *fq, void *data)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
@@ -108,7 +108,7 @@ bool fr_queue_push(fr_queue_t *fq, void *data)
  */
 bool fr_queue_pop(fr_queue_t *fq, void **p_data)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
@@ -130,7 +130,7 @@ bool fr_queue_pop(fr_queue_t *fq, void **p_data)
  */
 int fr_queue_size(fr_queue_t *fq)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
@@ -146,7 +146,7 @@ int fr_queue_size(fr_queue_t *fq)
  */
 int fr_queue_num_elements(fr_queue_t *fq)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
@@ -168,7 +168,7 @@ fr_queue_t *fr_queue_resize(fr_queue_t *fq, int size)
        fr_queue_t *nq;
        TALLOC_CTX *ctx;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
@@ -234,7 +234,7 @@ int fr_queue_localize_atomic(fr_queue_t *fq, fr_atomic_queue_t *aq)
        void *data;
        int i, room;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(fq, fr_queue_t);
 #endif
 
index cdf2399d99a9b7d04b675c7849a5daeaa58d0b4f..cdebf55dea8e8d5c84ad885326303a70e9d5912f 100644 (file)
@@ -171,11 +171,7 @@ static void fr_receiver_drain_input(fr_receiver_t *rc, fr_channel_t *ch, fr_chan
  */
 static int fr_receiver_idle(void *ctx, struct timeval *wake)
 {
-       fr_receiver_t *rc = ctx;
-
-#ifndef NDEBUG
-       talloc_get_type_abort(rc, fr_receiver_t);
-#endif
+       fr_receiver_t *rc = talloc_get_type_abort(ctx, fr_receiver_t);
 
        rad_cond_assert(rc->el != NULL); /* temporary until we actually use rc here */
 
@@ -257,7 +253,7 @@ static int fr_receiver_send_request(fr_receiver_t *rc, fr_channel_data_t *cd)
        fr_receiver_worker_t *worker;
        fr_channel_data_t *reply;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rc, fr_receiver_t);
 #endif
 
@@ -270,7 +266,9 @@ static int fr_receiver_send_request(fr_receiver_t *rc, fr_channel_data_t *cd)
                return 0;
        }
 
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(worker, fr_receiver_worker_t);
+#endif
 
        /*
         *      Send the message to the channel.  If we fail, recurse.
@@ -474,8 +472,9 @@ static void fr_receiver_worker_callback(void *ctx, void const *data, size_t data
        rad_assert(data_size == sizeof(worker));
 
        memcpy(&worker, data, data_size);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(worker, fr_worker_t);
-
+#endif
        w = talloc_zero(rc, fr_receiver_worker_t);
        if (!w) _exit(1);
 
@@ -498,13 +497,9 @@ static void fr_receiver_worker_callback(void *ctx, void const *data, size_t data
 static void fr_receiver_evfilt_user(UNUSED int kq, struct kevent const *kev, void *ctx)
 {
        fr_time_t now;
-       fr_receiver_t *rc = ctx;
+       fr_receiver_t *rc = talloc_get_type_abort(ctx, fr_receiver_t);
        uint8_t data[256];
 
-#ifndef NDEBUG
-       talloc_get_type_abort(rc, fr_receiver_t);
-#endif
-
        if (!fr_control_message_service_kevent(rc->control, kev)) {
                fr_log(rc->log, L_DBG, "kevent not for us: ignoring");
                return;
@@ -647,7 +642,7 @@ int fr_receiver_destroy(fr_receiver_t *rc)
        fr_receiver_worker_t *worker;
        fr_channel_data_t *cd;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rc, fr_receiver_t);
 #endif
 
@@ -770,8 +765,10 @@ int fr_receiver_socket_add(fr_receiver_t *rc, int fd, void *ctx, fr_transport_t
  */
 int fr_receiver_worker_add(fr_receiver_t *rc, fr_worker_t *worker)
 {
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rc, fr_receiver_t);
        (void) talloc_get_type_abort(worker, fr_worker_t);
+#endif
 
        return fr_control_message_send(rc->control, rc->rb, FR_CONTROL_ID_WORKER, &worker, sizeof(worker));
 }
index dd85b8c2aedf0ab8bd22f405f7cedc2362f48bc6..e62e20a85d18b4f3e0b182792f028b2d6b79d0b1 100644 (file)
@@ -97,7 +97,7 @@ fr_ring_buffer_t *fr_ring_buffer_create(TALLOC_CTX *ctx, size_t size)
  */
 uint8_t *fr_ring_buffer_reserve(fr_ring_buffer_t *rb, size_t size)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -178,7 +178,7 @@ uint8_t *fr_ring_buffer_alloc(fr_ring_buffer_t *rb, size_t size)
 {
        uint8_t *p;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -305,7 +305,7 @@ uint8_t *fr_ring_buffer_reserve_split(fr_ring_buffer_t *dst, size_t reserve_size
 {
        uint8_t *p;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(src, fr_ring_buffer_t);
        (void) talloc_get_type_abort(dst, fr_ring_buffer_t);
 #endif
@@ -365,7 +365,7 @@ int fr_ring_buffer_free(fr_ring_buffer_t *rb, size_t size_to_free)
 {
        size_t block_size;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -468,7 +468,7 @@ empty_buffer:
  */
 int fr_ring_buffer_close(fr_ring_buffer_t *rb)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -486,7 +486,7 @@ int fr_ring_buffer_close(fr_ring_buffer_t *rb)
  */
 size_t fr_ring_buffer_size(fr_ring_buffer_t *rb)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -504,7 +504,7 @@ size_t fr_ring_buffer_used(fr_ring_buffer_t *rb)
 {
        size_t size;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
@@ -531,7 +531,7 @@ size_t fr_ring_buffer_used(fr_ring_buffer_t *rb)
  */
 int fr_ring_buffer_start(fr_ring_buffer_t *rb, uint8_t **p_start, size_t *p_size)
 {
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(rb, fr_ring_buffer_t);
 #endif
 
index f25dbdfc969e172801856e0f8afd0f201836946e..630bbba8445db62fd63dd11c262375c71a541df3 100644 (file)
@@ -81,7 +81,7 @@ int fr_radius_tracking_entry_delete(fr_tracking_t *ft, uint8_t id)
 {
        fr_tracking_entry_t *entry;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ft, fr_tracking_t);
 #endif
 
@@ -119,7 +119,7 @@ fr_tracking_status_t fr_radius_tracking_entry_insert(fr_tracking_t *ft, uint8_t
 {
        fr_tracking_entry_t *entry;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ft, fr_tracking_t);
 #endif
 
@@ -175,7 +175,7 @@ int fr_radius_tracking_entry_reply(fr_tracking_t *ft, uint8_t id,
 {
        fr_tracking_entry_t *entry;
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(ft, fr_tracking_t);
 #endif
 
index 2192f921fc6390112c78bf69a4964ac60f45e33e..bac96a7817b5d51d662aad032b72166e854087fd 100644 (file)
@@ -298,7 +298,7 @@ static void fr_worker_evfilt_user(UNUSED int kq, struct kevent const *kev, void
        fr_worker_t *worker = ctx;
        char data[256];
 
-#ifndef NDEBUG
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        talloc_get_type_abort(worker, fr_worker_t);
 #endif
 
@@ -823,14 +823,11 @@ static int fr_worker_idle(void *ctx, struct timeval *wake)
 {
        bool sleeping;
        int i;
-       fr_worker_t *worker = ctx;
+       fr_worker_t *worker = talloc_get_type_abort(ctx, fr_worker_t);
 
-#ifndef NDEBUG
-       talloc_get_type_abort(worker, fr_worker_t);
        rad_assert(worker->runnable != NULL);
        rad_assert(worker->to_decode.heap != NULL);
        rad_assert(worker->localized.heap != NULL);
-#endif
 
        /*
         *      The application is polling the event loop, but has
@@ -1199,8 +1196,8 @@ fr_channel_t *fr_worker_channel_create(fr_worker_t const *worker, TALLOC_CTX *ct
 {
        fr_channel_t *ch;
 
-#ifndef NDEBUG
-       talloc_get_type_abort(worker, fr_worker_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(worker, fr_worker_t);
 #endif
 
        rad_assert(worker->control != NULL);
@@ -1231,8 +1228,8 @@ fr_channel_t *fr_worker_channel_create(fr_worker_t const *worker, TALLOC_CTX *ct
  */
 void fr_worker_name(fr_worker_t *worker, char const *name)
 {
-#ifndef NDEBUG
-       talloc_get_type_abort(worker, fr_worker_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+       (void) talloc_get_type_abort(worker, fr_worker_t);
 #endif
 
        worker->name = talloc_strdup(worker, name);
index 3938276c4b191b463c896b63330ee61dc34fba3e..98e6bf42f4297ebebc74e842661aa22efe9d5a96 100644 (file)
@@ -4297,7 +4297,9 @@ void fr_dict_verify(char const *file, int line, fr_dict_attr_t const *da)
                if (!fr_cond_assert(0)) fr_exit_now(1);
        }
 
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(da, fr_dict_attr_t);
+#endif
 
        if ((!da->flags.is_root) && (da->depth == 0)) {
                FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
@@ -4315,7 +4317,9 @@ void fr_dict_verify(char const *file, int line, fr_dict_attr_t const *da)
                if (!fr_cond_assert(0)) fr_exit_now(1);
        }
 
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        for (da_p = da; da_p; da_p = da_p->next) (void) talloc_get_type_abort(da_p, fr_dict_attr_t);
+#endif
 
        for (i = da->depth, da_p = da; (i >= 0) && da; i--, da_p = da_p->parent) {
                if (i != (int)da_p->depth) {
index 697036aec8d6af1c4c0c87cc4d8c6272058e1d8f..2056dadd0596436afd53dbe1e785035f5393979c 100644 (file)
@@ -424,16 +424,10 @@ int fr_event_timer_delete(fr_event_list_t *el, fr_event_timer_t **parent)
                return -1;
        }
 
-#ifndef NDEBUG
        /*
         *  Validate the event_t struct to detect memory issues early.
         */
        ev = talloc_get_type_abort(*parent, fr_event_timer_t);
-
-#else
-       ev = *parent;
-#endif
-
        if (ev->parent) {
                (void)fr_cond_assert(*(ev->parent) == ev);
                *ev->parent = NULL;
@@ -504,11 +498,7 @@ int fr_event_timer_insert(fr_event_list_t *el, fr_event_callback_t callback, voi
        if (*parent) {
                int ret;
 
-#ifndef NDEBUG
                ev = talloc_get_type_abort(*parent, fr_event_timer_t);
-#else
-               ev = *parent;
-#endif
 
                ret = fr_heap_extract(el->times, ev);
                if (!fr_cond_assert(ret == 1)) return -1;       /* events MUST be in the heap */
@@ -737,11 +727,7 @@ void fr_event_service(fr_event_list_t *el)
                        continue;
                }
 
-#ifndef NDEBUG
                ev = talloc_get_type_abort(el->events[i].udata, fr_event_fd_t);
-#else
-               ev = el->events[i].udata;
-#endif
 
                if (!fr_cond_assert(ev->is_registered)) continue;
 
index fddf1e1644ff1e2706cf874f2d4debe871a6a87d..01b051acb6ffd20607cc43e1a3aa2ed6b35fbd11 100644 (file)
@@ -2769,7 +2769,9 @@ inline void fr_pair_verify(char const *file, int line, VALUE_PAIR const *vp)
                if (!fr_cond_assert(0)) fr_exit_now(1);
        }
 
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(vp, VALUE_PAIR);
+#endif
 
        if (!vp->da) {
                FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: VALUE_PAIR da pointer was NULL", file, line);
@@ -2787,7 +2789,9 @@ inline void fr_pair_verify(char const *file, int line, VALUE_PAIR const *vp)
                if (!talloc_get_type(vp->vp_ptr, uint8_t)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: VALUE_PAIR \"%s\" data buffer type should be "
                                     "uint8_t but is %s\n", file, line, vp->da->name, talloc_get_name(vp->vp_ptr));
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
                        (void) talloc_get_type_abort(vp->vp_ptr, uint8_t);
+#endif
                }
 
                len = talloc_array_length(vp->vp_octets);
@@ -2816,7 +2820,9 @@ inline void fr_pair_verify(char const *file, int line, VALUE_PAIR const *vp)
                if (!talloc_get_type(vp->vp_ptr, char)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: VALUE_PAIR \"%s\" data buffer type should be "
                                     "char but is %s\n", file, line, vp->da->name, talloc_get_name(vp->vp_ptr));
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
                        (void) talloc_get_type_abort(vp->vp_ptr, char);
+#endif
                }
 
                len = (talloc_array_length(vp->vp_strvalue) - 1);
@@ -2847,9 +2853,12 @@ inline void fr_pair_verify(char const *file, int line, VALUE_PAIR const *vp)
                break;
        }
 
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        if (vp->da->flags.is_unknown) {
                (void) talloc_get_type_abort(vp->da, fr_dict_attr_t);
-       } else {
+       } else
+#endif
+       {
                fr_dict_attr_t const *da;
 
                /*
index e39e374246fa96c01cd827541ab465a8c5438aeb..83abb513aeecb42c463fd1ae8b9e6a062e5956c1 100644 (file)
@@ -65,7 +65,9 @@ struct rbtree_t {
  */
 static void free_walker(rbtree_t *tree, rbnode_t *x)
 {
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        (void) talloc_get_type_abort(x, rbnode_t);
+#endif
 
        if (x->left != NIL) free_walker(tree, x->left);
        if (x->right != NIL) free_walker(tree, x->right);
index c1964d01d0e7d5a1134ebca63f3562b103a48d6b..81a40a86b4b7ff38769fe906cf835ff89276a4c7 100644 (file)
@@ -315,7 +315,7 @@ int request_data_add(REQUEST *request, void const *unique_ptr, int unique_int, v
 
        this = next = NULL;
        for (last = &(request->data); *last != NULL; last = &((*last)->next)) {
-#ifdef WITH_VERIFY_PTR
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
                *last = talloc_get_type_abort(*last, request_data_t);
 #endif
                if (((*last)->unique_ptr == unique_ptr) && ((*last)->unique_int == unique_int)) {
@@ -397,7 +397,7 @@ void *request_data_get(REQUEST *request, void const *unique_ptr, int unique_int)
        if (!request) return NULL;
 
        for (last = &(request->data); *last != NULL; last = &((*last)->next)) {
-#ifdef WITH_VERIFY_PTR
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
                *last = talloc_get_type_abort(*last, request_data_t);
 #endif
                if (((*last)->unique_ptr == unique_ptr) && ((*last)->unique_int == unique_int)) {
@@ -437,7 +437,7 @@ int request_data_by_persistance(request_data_t **out, REQUEST *request, bool per
        next = &head;
 
        for (last = &(request->data); *last != NULL; last = &((*last)->next)) {
-#ifdef WITH_VERIFY_PTR
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
                *last = talloc_get_type_abort(*last, request_data_t);
 #endif
                if ((*last)->persist == persist) {
@@ -478,7 +478,7 @@ void request_data_restore(REQUEST *request, request_data_t *entry)
        for (last = &(request->data); *last != NULL; last = &((*last)->next)) if (!(*last)->next) break;
        *last = entry;
 
-#ifdef WITH_VERIFY_PTR
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        {
                request_data_t *this;
 
index 93fb118b25d6e4432cb463d903ec3b21d716acb0..77fdbd91bec2080de7c371b5ca15acac60d07216 100644 (file)
@@ -513,7 +513,7 @@ static fr_state_entry_t *state_entry_find(fr_state_tree_t *state, REQUEST *reque
 
        entry = rbtree_finddata(state->tree, &my_entry);
 
-#ifdef WITH_VERIFY_PTR
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
        if (entry) (void) talloc_get_type_abort(entry, fr_state_entry_t);
 #endif
 
index 584a210cd9169a02489c46cad1633ef8909a5915..06ef38b81b9907057edafb3d1865eeee254dc10c 100644 (file)
@@ -1315,11 +1315,7 @@ static int _unlang_event_free(unlang_event_t *ev)
  */
 static void unlang_event_timeout_handler(struct timeval *now, void *ctx)
 {
-#ifndef NDEBUG
        unlang_event_t *ev = talloc_get_type_abort(ctx, unlang_event_t);
-#else
-       unlang_event_t *ev = ctx;
-#endif
        void *mutable_ctx;
        void *mutable_inst;
 
@@ -1338,11 +1334,7 @@ static void unlang_event_timeout_handler(struct timeval *now, void *ctx)
  */
 static void unlang_event_fd_handler(UNUSED fr_event_list_t *el, int fd, void *ctx)
 {
-#ifndef NDEBUG
        unlang_event_t *ev = talloc_get_type_abort(ctx, unlang_event_t);
-#else
-       unlang_event_t *ev = ctx;
-#endif
        void *mutable_ctx;
        void *mutable_inst;
 
index 85f7b35308c85ccb4c03e31d8cde4e05a6a08e50..cdf96adf81fcef52fe3920ab73e85cc6c4ab9cc7 100644 (file)
@@ -85,16 +85,10 @@ rlm_rcode_t eap_compose(eap_session_t *eap_session)
        eap_packet_t *reply;
        int rcode;
 
-#ifndef NDEBUG
        eap_session = talloc_get_type_abort(eap_session, eap_session_t);
        request = talloc_get_type_abort(eap_session->request, REQUEST);
        eap_round = talloc_get_type_abort(eap_session->this_round, eap_round_t);
        reply = talloc_get_type_abort(eap_round->request, eap_packet_t);
-#else
-       request = eap_session->request;
-       eap_round = eap_session->this_round;
-       reply = eap_round->request;
-#endif
 
        /*
         *      The Id for the EAP packet to the NAS wasn't set.
@@ -855,8 +849,8 @@ eap_session_t *eap_session_continue(eap_packet_raw_t **eap_packet_p, rlm_eap_t c
                }
 
                RDEBUG4("Got eap_session_t %p from request data", eap_session);
-#ifdef WITH_VERIFY_PTR
-               eap_session = talloc_get_type_abort(eap_session, eap_session_t);
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+               (void) talloc_get_type_abort(eap_session, eap_session_t);
 #endif
                eap_session->rounds++;
                if (eap_session->rounds >= 50) {
index 981eb905f030bd875e841d3a16b1fbea4cab1750..b66c807ffd1568e9659baeca6e5040fa922040b0 100644 (file)
@@ -1691,9 +1691,7 @@ do { \
                        char    *range = NULL;
                        bool    is_active;
 
-#ifndef NDEBUG
                        leases[i] = talloc_get_type_abort(leases[i], ippool_tool_lease_t);
-#endif
 
                        gettimeofday(&now, NULL);
                        is_active = now.tv_sec <= leases[i]->next_event;
index da0695287bf9f784aa289dceab010e70e03ad7be..ec24827aaa93d036c58912791dcef030fda54582 100644 (file)
@@ -126,11 +126,7 @@ static void _rest_io_timer_expired(UNUSED struct timeval *now, void *ctx)
 {
        rlm_rest_thread_t *t;
 
-#ifndef NDEBUG
        t = talloc_get_type_abort(ctx, rlm_rest_thread_t);
-#else
-       t = ctx;
-#endif
 
        DEBUG4("libcurl timer expired");
 
@@ -147,11 +143,7 @@ static void _rest_io_service_errored(UNUSED fr_event_list_t *el, int fd, void *c
 {
        rlm_rest_thread_t *t;
 
-#ifndef NDEBUG
        t = talloc_get_type_abort(ctx, rlm_rest_thread_t);
-#else
-       t = ctx;
-#endif
 
        DEBUG4("libcurl fd %i errored", fd);
 
@@ -168,11 +160,7 @@ static void _rest_io_service_writable(UNUSED fr_event_list_t *el, int fd, void *
 {
        rlm_rest_thread_t *t;
 
-#ifndef NDEBUG
        t = talloc_get_type_abort(ctx, rlm_rest_thread_t);
-#else
-       t = ctx;
-#endif
 
        DEBUG4("libcurl fd %i now writable", fd);
 
@@ -189,11 +177,7 @@ static void _rest_io_service_readable(UNUSED fr_event_list_t *el, int fd, void *
 {
        rlm_rest_thread_t *t;
 
-#ifndef NDEBUG
        t = talloc_get_type_abort(ctx, rlm_rest_thread_t);
-#else
-       t = ctx;
-#endif
 
        DEBUG4("libcurl fd %i now readable", fd);