<div dir="ltr"><br>On AIX the xlc compiler warns about incompatible pointer types<br>in base/events.c, base/nebmods.c and xdata/xpddefault.c.<br>The message is typically as this:<br>"nebmods.c", line 538.48: 1506-068 (W) Operation between types "void*" and "int(*)(int,void*)" is not allowed.<br clear="all">

This patch adds the necessary typecasts '(void*)' to eliminate the warning.<br><br>The patch applies against 3.0.3 and the CVS tarball. I've tested<br>it on AIX 5.3 with xlc (the IBM compiler) and gcc and also on<br>
Linux (Ubuntu hardy, gcc 4.1.2).<br><br>Markus<br><br><br>diff --git a/base/events.c b/base/events.c<br>index 794b207..95094fa 100644<br>--- a/base/events.c<br>+++ b/base/events.c<br>@@ -575,7 +575,7 @@ void init_timing_loop(void){<br>
<br>        /* add a log rotation event if necessary */<br>        if(log_rotation_method!=LOG_ROTATION_NONE)<br>-               schedule_new_event(EVENT_LOG_ROTATION,TRUE,get_next_log_rotation_time(),TRUE,0,get_next_log_rotation_time,TRUE,NULL,NULL,0);<br>
+               schedule_new_event(EVENT_LOG_ROTATION,TRUE,get_next_log_rotation_time(),TRUE,0,(void *)get_next_log_rotation_time,TRUE,NULL,NULL,0);<br><br>        /* add a retention data save event if needed */<br>        if(retain_state_information==TRUE && retention_update_interval>0)<br>
@@ -792,7 +792,7 @@ void reschedule_event(timed_event *event, timed_event **event_list, timed_event<br><br>                /* use custom timing function */<br>                if(event->timing_func!=NULL){<br>-                       timingfunc=event->timing_func;<br>
+                       (void *)timingfunc=event->timing_func;<br>                        event->run_time=(*timingfunc)();<br>                        }<br><br>@@ -1379,7 +1379,7 @@ int handle_timed_event(timed_event *event){<br>
<br>                /* run a user-defined function */<br>                if(event->event_data!=NULL){<br>-                       userfunc=event->event_data;<br>+                       (void *)userfunc=event->event_data;<br>
                        (*userfunc)(event->event_args);<br>                        }<br>                break;<br>@@ -1639,7 +1639,7 @@ void compensate_for_system_time_change(unsigned long last_time, unsigned long cu<br>
<br>                /* use custom timing function */<br>                if(temp_event->timing_func!=NULL){<br>-                       timingfunc=temp_event->timing_func;<br>+                       (void *)timingfunc=temp_event->timing_func;<br>
                        temp_event->run_time=(*timingfunc)();<br>                        }<br><br>@@ -1660,7 +1660,7 @@ void compensate_for_system_time_change(unsigned long last_time, unsigned long cu<br><br>                /* use custom timing function */<br>
                if(temp_event->timing_func!=NULL){<br>-                       timingfunc=temp_event->timing_func;<br>+                       (void *)timingfunc=temp_event->timing_func;<br>                        temp_event->run_time=(*timingfunc)();<br>
                        }<br><br>diff --git a/base/nebmods.c b/base/nebmods.c<br>index 8485706..6e3d14d 100644<br>--- a/base/nebmods.c<br>+++ b/base/nebmods.c<br>@@ -282,7 +282,7 @@ int neb_load_module(nebmodule *mod){<br>
                }<br><br>        /* run the module's init function */<br>-       initfunc=mod->init_func;<br>+       (void *)initfunc=mod->init_func;<br>        result=(*initfunc)(NEBMODULE_NORMAL_LOAD,mod->args,mod->module_handle);<br>
<br>        /* if the init function returned an error, unload the module */<br>@@ -348,7 +348,7 @@ int neb_unload_module(nebmodule *mod, int flags, int reason){<br>        /* call the de-initialization function if available (and the module was initialized) */<br>
        if(mod->deinit_func && reason!=NEBMODULE_ERROR_BAD_INIT){<br><br>-               deinitfunc=mod->deinit_func;<br>+               (void *)deinitfunc=mod->deinit_func;<br><br>                /* module can opt to not be unloaded */<br>
                result=(*deinitfunc)(flags,reason);<br>@@ -505,7 +505,7 @@ int neb_deregister_module_callbacks(nebmodule *mod){<br>                for(temp_callback=neb_callback_list[callback_type];temp_callback!=NULL;temp_callback=next_callback){<br>
                        next_callback=temp_callback->next;<br>                        if((void *)temp_callback->module_handle==(void *)mod->module_handle)<br>-                               neb_deregister_callback(callback_type,temp_callback->callback_func);<br>
+                               neb_deregister_callback(callback_type,(int(*)(int,void*))temp_callback->callback_func);<br>                        }<br><br>                }<br>@@ -535,7 +535,7 @@ int neb_deregister_callback(int callback_type, int (*callback_func)(int,void *))<br>
                next_callback=temp_callback->next;<br><br>                /* we found it */<br>-               if(temp_callback->callback_func==callback_func)<br>+               if(temp_callback->callback_func==(void *)callback_func)<br>
                        break;<br><br>                last_callback=temp_callback;<br>@@ -578,7 +578,7 @@ int neb_make_callbacks(int callback_type, void *data){<br><br>        /* make the callbacks... */<br>        for(temp_callback=neb_callback_list[callback_type];temp_callback!=NULL;temp_callback=temp_callback->next){<br>
-               callbackfunc=temp_callback->callback_func;<br>+               (void *)callbackfunc=temp_callback->callback_func;<br>                cbresult=callbackfunc(callback_type,data);<br><br>                total_callbacks++;<br>
diff --git a/xdata/xpddefault.c b/xdata/xpddefault.c<br>index 77446ef..f30c2a8 100644<br>--- a/xdata/xpddefault.c<br>+++ b/xdata/xpddefault.c<br>@@ -316,11 +316,11 @@ int xpddefault_initialize_performance_data(char *config_file){<br>
<br>        /* periodically process the host perfdata file */<br>        if(xpddefault_host_perfdata_file_processing_interval>0 && xpddefault_host_perfdata_file_processing_command!=NULL)<br>-               schedule_new_event(EVENT_USER_FUNCTION,TRUE,current_time+xpddefault_host_perfdata_file_processing_interval,TRUE,xpddefault_host_perfdata_file_processing_interval,NULL,TRUE,xpddefault_process_host_perfdata_file,NULL,0);<br>
+               schedule_new_event(EVENT_USER_FUNCTION,TRUE,current_time+xpddefault_host_perfdata_file_processing_interval,TRUE,xpddefault_host_perfdata_file_processing_interval,NULL,TRUE,(void *)xpddefault_process_host_perfdata_file,NULL,0);<br>
<br>        /* periodically process the service perfdata file */<br>        if(xpddefault_service_perfdata_file_processing_interval>0 && xpddefault_service_perfdata_file_processing_command!=NULL)<br>-               schedule_new_event(EVENT_USER_FUNCTION,TRUE,current_time+xpddefault_service_perfdata_file_processing_interval,TRUE,xpddefault_service_perfdata_file_processing_interval,NULL,TRUE,xpddefault_process_service_perfdata_file,NULL,0);<br>
+               schedule_new_event(EVENT_USER_FUNCTION,TRUE,current_time+xpddefault_service_perfdata_file_processing_interval,TRUE,xpddefault_service_perfdata_file_processing_interval,NULL,TRUE,(void *)xpddefault_process_service_perfdata_file,NULL,0);<br>
<br>        /* save the host perf data file macro */<br>        my_free(macro_x[MACRO_HOSTPERFDATAFILE]);<br><br><br>-- <br>  Markus Baertschi             Phone: ++41 (21) 807 1677<br>  Bas du Rossé 16             Fax  : ++41 (21) 807 1678<br>

  CH-1163, Etoy                Email: <a href="mailto:markus@markus.org" target="_blank">markus@markus.org</a><br><span>  Switzerland                  Homepage: <a href="http://www.markus.org" target="_blank">www.markus.org</a></span><br>

</div>