Re: GDataInputStream API return types



hi;

On 28 November 2012 13:29, Henrique Camargo
<henrique henriquecamargo com> wrote:
> I was wondering why the GDataInputStream API returns "char *" instead
> of "gchar *".

gchar is a typedef to char  - it's perfectly equivalent to use either.

> Also, looking at the source code, the returning pointer for functions
> like "g_data_input_stream_read_line ()" should be g_free 'd. This is
> not clear from the documentation [1].

in general, if any function returns a char*, it's implied that you
need to free it; if you were not meant to do that, the function would
have returned a const char*. having said that...

> Maybe it can be improved to
> explicitly remind the user that the pointer should be g_free 'd.

... care to file a bug and prepare a documentation patch? those
usually get reviewed and applied really quickly.

ciao,
 Emmanuele.

--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/


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