GNOME Bugzilla – Bug 657045
G_IO_FLAG_IS_WRITEABLE is misspelled
Last modified: 2013-03-19 09:46:31 UTC
Created attachment 194336 [details] [review] Patch to fix misspelling, compatibly. G_IO_FLAG_IS_WRITEABLE is misspelled.
Review of attachment 194336 [details] [review]: I'm not so sure about changing this, now: it's been ten years. ::: glib/giochannel.h @@ +99,3 @@ G_IO_FLAG_NONBLOCK = 1 << 1, G_IO_FLAG_IS_READABLE = 1 << 2, /* Read only flag */ + G_IO_FLAG_IS_WRITEABLE = 1 << 3, /* Read only flag, misspelled */ I wonder if we could get away with just changing the name of the flag and then adding: #define G_IO_FLAG_IS_WRITEABLE (G_IO_FLAG_IS_WRITABLE) outside the enumeration. this would allow deprecation of the old name at a later date. ::: glib/giowin32.c @@ +199,3 @@ if (flags & G_IO_FLAG_IS_READABLE) g_print ("%sREADABLE", bar), bar = "|"; + if (flags & G_IO_FLAG_IS_WRITEBLE) typo alert.
Created attachment 194762 [details] [review] replacement patch Updated as requested. I have no opinion whether it's worth it to actually fix the spelling.
Review of attachment 194762 [details] [review]: Sure, why not.
This breaks the gir file, not sure if anything uses GIOFlags via introspection, but it's worth considering in the future.
Johan: would it be better in the future if the deprecated item is added as an enum value in the following way? enum { x_readable, x_writable, #ifndef DISABLE_DEPRECATED x_writeable = x_writable, #endif x_other_thing };
Yes, can we just change that to be an extra enum value, please? Otherwise, we have to manually hack this back into language bindings (which don't expect the extra #define) just to avoid breaking API.
This was fixed to be a normal enum value: https://git.gnome.org/browse/glib/commit/glib/giochannel.h?id=7788bb3a915cc0818186bb2c04a51e195579d13e Thanks.