[Geany-Devel] Geany using standard types

Colomban Wendling lists.ban at xxxxx
Sun Aug 18 11:24:04 UTC 2013


Short version:  No.  Just no.

Le 18/08/2013 09:21, Matthew Brush a écrit :
> Hi,
> 
> I just want to throw this out there since I already made it:
> 
> http://pastebin.geany.org/7YHWE/
> 
> It's the diff of a branch which replaces every single redundant G* type
> with its standard C counterpart. I have a branch with commits for each
> type, starting from the only one that changed (WRT to recent C99
> discussions), but I just pasted here a combination patch of removing all
> redundantly-named, non-standard C types.
> 
> Of note is:
> - I left gboolean where it would break a function signature with respect
> to GCC warnings.
> - I left all guchar, gushort, guint, gulong, etc types, because, lets be
> honest, it's just nicer to type.

Nice, we have "int" and "guint"?  Come on.

> - gpointer (and gconstpointer) was special because it masked the pointer
> * behind its typedef and so broke lines with multiple gpointer
> declarations on the same line (easily fixable since there's no such
> thing as void type in C).
> - I think patch includes changes to stdint types (ex. gint16, guint32)
> but I think we shouldn't change these as GLib assures them and the C99
> standard does not in theory (and is not many in use).

int and gint32?  Come one.

> I don't mean to apply this patch directly, just to spur discussion about
> whether Geany should be using standard C types or pointlessly typedeff'd
> G* types where there is an existing and cross-platform standard type.

No.

> The one big point I can see against is; "We already do like that", so
> there's no point in repeating it, it's totally valid and avoids
> (potentially, although I'm pretty sure not) breaking in obscure ways
> some mysterious code, but since I made the patch anyways, I'd thought
> I'd post it for comments. If you see some fundamental issue, of course
> feel free to point out.

Fundamental issues:  uselessness, ugly mix between int, guint, unsigned
int, guint32, bool, int, gboolean, etc.

> http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03474.html

Angry guy is angry.

> http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03397.html

…this is a reason NOT TO start using C99's bool and have mixed stuff we
have no idea about.

> http://webcache.googleusercontent.com/search?q=cache:OszwDROZX4oJ:https://lists.launchpad.net/unity-dev/msg00231.html+gboolean+vs+bool&cd=4&hl=en&ct=clnk&gl=ca
> http://wiki.inkscape.org/wiki/index.php/Booleans

Read this, don't put trash in your variables and don't compare ==TRUE or
==FALSE, it's ugly anyway.

> http://webcache.googleusercontent.com/search?q=cache:l64BmXlu-doJ:permalink.gmane.org/gmane.comp.gnome.svn/584036+use+standard+types+glibtypes&cd=8&hl=en&ct=clnk&gl=ca

And they use a NEW type, CoglBool?  Come on.



Regards,
Colomban

> I mostly want to solicit feedback on this topic in general rather than
> bikeshed my patch specifically as pasted.
> 
> P.S. I'll not proceed further on this without more input from Geany
> developers and community.
> 
> Cheers,
> Matthew Brush


More information about the Devel mailing list