On Tuesday, October 19, 2010 18:14:25 Tomek CEDRO wrote:
> On Tue, Oct 19, 2010 at 11:59 PM, Mike Frysinger wrote:
> >> I want to keep the cast because I am not familiar enough with the code
> >> to judge what happens if I omit the cast
> > 
> > the point is of type "void *".  C does not need an explicit cast to go
> > from "void *" to anything else.  C++ might barf on you without an
> > explicit cast, but this isnt C++.
> > 
> > if you were doing an offset, then the cast might be ncessary to get the
> > right type before doing the math.  but that isnt the case either.
> 
> Yes, data needs to be casted onto "void *".

the data itself is already "void *", so no cast is necessary if assigning it 
to any other pointer.

> Some time ago in one project I changed a bit the structure of a code I did
> not know well and it had bad consequences, so generally I try to use
> existing parse if possible with minor changes

this is why i like to avoid unnecessary casts.  invalid pointer conversions 
may be suppressed because people are too liberally sprinkling casts.

> I can see that changes are commited  as #1863 - thank you Mike :-)

so you'll submit an updated patch ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to