[crossfire] Re: [Crossfire-cvs] CVS commit: crossfire

Andreas Kirschbaum kirschbaum at myrealbox.com
Mon Aug 15 17:31:05 CDT 2005


     crossfire-cvs-admin at lists.sourceforge.net
     
      wrote:
>
     
      Module Name:	crossfire
     
     >
     
      Committed By:	ryo_saeba
     
     >
     
      Date:		Fri Aug 12 13:47:00 UTC 2005
     
     [...]
>
     
      Index: crossfire/server/apply.c
     
     >
     
      diff -c crossfire/server/apply.c:1.132 crossfire/server/apply.c:1.133
     
     >
     
      *** crossfire/server/apply.c:1.132	Wed Aug 10 06:38:31 2005
     
     >
     
      --- crossfire/server/apply.c	Fri Aug 12 06:46:34 2005
     
     >
     
      ***************
     
     >
     
      *** 1015,1022 ****
     
     >
     
        		CFP.Value[6] = &m;
     
     >
     
        		CFP.Value[7] = &m;
     
     >
     
        		CFP.Value[8] = &l;
     
     >
     
      ! 		CFP.Value[9] = evt->hook;
     
     >
     
      ! 		CFP.Value[10]= evt->options;
     
     >
     
        		if (findPlugin(evt->plugin)>=0)
     
     >
     
        		{
     
     >
     
        			CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
     
     >
     
      --- 1015,1022 ----
     
     >
     
        		CFP.Value[6] = &m;
     
     >
     
        		CFP.Value[7] = &m;
     
     >
     
        		CFP.Value[8] = &l;
     
     >
     
      ! 		CFP.Value[9] = (void*)evt->hook;
     
     >
     
      ! 		CFP.Value[10]= (void*)evt->options;
     
     >
     
        		if (findPlugin(evt->plugin)>=0)
     
     >
     
        		{
     
     >
     
        			CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
     
     
This change (and similar ones following) do not look right to me and I think
they should be removed again: the destination type of CFP.Value[x] is "void *".
Since Ansi C does allow you to assign any pointer value to and from "void *"
this type cast is not necessary. OTOH such a cast potentially hides future bugs
because the compiler cannot anymore generate warnings for mismatched pointer
types.

    
    


More information about the crossfire mailing list