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

Nicolas Weeger nicolas.weeger at laposte.net
Tue Aug 16 02:57:57 CDT 2005


>
     
      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

Actually, there is a warning (under MS Visual Studio) since
event and options, const pointers, are treated like pointers.
I don't see either how the compiler could warn of mismatched
pointer if one is void* based on what you said :)

It is also a mistake for me to send as void* (as opposed to
const void*), since it's then easy to change the string in the
plugin which would lead to data corruption.

Note also that I added the specific conversion because
(hopefully) soon plugin system will be redone and those
parameter passing calls will be totally changed.

Ryo

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




    
    


More information about the crossfire mailing list