From b20c1fe5affdda9c910006a2fd482035b93b76e9 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 15 Jun 2007 18:24:01 +0000 Subject: [PATCH] Do not access a void* (mi_entry_limbo) as if it were a struct monitor_info_t* --- servers/slapd/back-monitor/back-monitor.h | 4 +++- servers/slapd/back-monitor/init.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index cfb5b80d58..6e1ad91793 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -74,6 +74,8 @@ typedef struct monitor_entry_t { struct monitor_callback_t *mp_cb; /* callback sequence */ } monitor_entry_t; +struct entry_limbo_t; /* in init.c */ + typedef struct monitor_info_t { /* @@ -135,7 +137,7 @@ typedef struct monitor_info_t { AttributeDescription *mi_ad_readOnly; AttributeDescription *mi_ad_restrictedOperation; - void *mi_entry_limbo; + struct entry_limbo_t *mi_entry_limbo; } monitor_info_t; /* diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 00edb2f561..f45ee21bcb 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -357,7 +357,7 @@ monitor_back_register_database_limbo( el.el_be = be; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) /* go to last */; @@ -529,7 +529,7 @@ done:; el.el_mss = mss; el.el_flags = flags; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) /* go to last */; @@ -743,7 +743,7 @@ done:; el.el_mss = mss; el.el_flags = flags; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) /* go to last */; @@ -1076,7 +1076,7 @@ done:; el.el_a = attrs_dup( a ); el.el_cb = cb; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) /* go to last */; @@ -1189,7 +1189,7 @@ monitor_back_unregister_entry( } else { entry_limbo_t **elpp; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) { @@ -1320,7 +1320,7 @@ monitor_back_unregister_entry_parent( } else { entry_limbo_t **elpp; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) { @@ -1501,7 +1501,7 @@ monitor_back_unregister_entry_attrs( } else { entry_limbo_t **elpp; - for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo; + for ( elpp = &mi->mi_entry_limbo; *elpp; elpp = &(*elpp)->el_next ) { @@ -2321,7 +2321,7 @@ monitor_back_db_open( monitor_subsys_opened = 1; if ( mi->mi_entry_limbo ) { - entry_limbo_t *el = (entry_limbo_t *)mi->mi_entry_limbo; + entry_limbo_t *el = mi->mi_entry_limbo; for ( ; el; ) { entry_limbo_t *tmp; -- 2.39.5