Re: [Geany-Devel] Geany using standard types

2013-08-19 Thread Matthew Brush

On 13-08-19 10:33 AM, Dimitar Zhekov wrote:

On Sun, 18 Aug 2013 03:56:01 -0700
Matthew Brush mbr...@codebrainz.ca wrote:


My concern here with stdint.h was that if CHAR_BIT  8 then C99 forbids
an implementation from defining int8_t and if int8_t isn't defined then
uint8_t can't be defined.  And if this is true [citation needed], and
you couldn't rely on (u)int8_t, then might as well just stick to
portable GLib typedefs.


In POSIX and Windows, CHAR_BIT is always 8, and we don't really support
anything else.

CHAR_BIT may be  8 if the system can not address 8-bit values, but in
that case, no 8-bit integer type will exist, and GLib will be unable to
define a gint8 either. Which is not a problem, since GLib (as of 2.37)
supports only G_OS_BEOS, G_OS_UNIX and G_OS_WIN32...



Thanks for the info, good to know!

I'm still +1 for using the standard types over the weird G* types, but 
I'll stop annoying everyone about it if others like them (for reasons I 
didn't understand). Maybe I'll ask again about it maybe once we're ready 
to switch to C11 in a decade or so :)


Cheers,
Matthew Brush

___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] Geany using standard types

2013-08-18 Thread Lex Trotman
On 18 August 2013 19:32, Matthew Brush mbr...@codebrainz.ca wrote:

 Hi,

 It was pointed out to me on IRC that I went into too much details/patches
 and muddied the original question, so I propose it again more simply:

 Do you agree it would be better for Geany to use standard C types as
 opposed to GLib types which are typedef'd to the exact same thing? (ex.
 gint-int, glong-long, gchar-char etc.)


Personally I can't find any great positives or negatives, but then I've
trained my eyes to read gint as int, others may find standard code more
attractive (or vice versa).

What I would be worried about is changing the existing code to use the
standard types.  Matthew has kindly illustrated the size of such a change,
and while I'm sure 99.99% of the changes are fine, I would worry about the
few places it might not be semantically equivalent, no matter how good the
regexes that made the change are.  The size of the change means we are
never going to manually inspect it, and the places it will go wrong are not
obvious, so we can't easily point to examples.

So whilst I wouldn't advocate changing the existing code (at least en bloc)
I don't see any reason for disallowing standard types in new code and
changes to existing code as it is touched.

Cheers
Lex



 Sorry for any noise,
 Matthew Brush


___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel