Re: Some comments about GVFS



On Fri, 2007-05-04 at 11:40 +0200, Alexander Larsson wrote:

> > 5) You seem to use void * in as the data pointers. All applications I
> > know use guchar * (some use gchar *) to handle data. From my stream
> > handling experience this is to encourage people to think about what
> > they pass to such a function. This seems to encourage calling
> > functions like this: write (mywidget, sizeof (MyWidget)) - with is a
> > bad idea for multiple reasons, including but not limited to struct
> > padding. MS formats seem to have done that a lot.
> 
> I'm not partial to any format here. Do people thing that using a char
> type rather than a void type is better? 

I tend to use uint8_t * because I rely on stdint.h: this makes it
totally unambiguous that you are dealing with bytes, IMHO. I like to
avoid char * whenever I can because I have gotten more than once into
portability problems due to the fact that the signedness of char is
different on different platforms. If I remember correctly one of the
embedded platforms I used to work on (ARM or MIPS, I cannot recall at
the moment) was unsigned char while x86 is usually signed char.

regards,
Mathieu
-- 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]