[Geany-Devel] Geany using standard types

Matthew Brush mbrush at xxxxx
Sun Aug 18 08:32:07 UTC 2013


On 13-08-18 12:21 AM, Matthew Brush wrote:
> 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.
> - 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).
>
> 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.
>
> 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.
>
> 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.
>

Just to add some relevant links:

http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03474.html
http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03397.html
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
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

Cheers,
Matthew Brush


More information about the Devel mailing list