From: P. F. Chimento Date: Thu, 21 Apr 2011 09:52:16 +0000 (+0200) Subject: Don't fail on unrecognized split method X-Git-Tag: v0.9~93 X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=80632a6ab2f53b27a10756d776042c41c93a2137 Don't fail on unrecognized split method If glk_window_open() gets unrecognized bits in the method argument, it should give a warning instead of failing to create the window. --- diff --git a/libchimara/window.c b/libchimara/window.c index 41bd9f0..b4d8897 100644 --- a/libchimara/window.c +++ b/libchimara/window.c @@ -458,8 +458,9 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, glui32 rock) { VALID_WINDOW_OR_NULL(split, return NULL); - g_return_val_if_fail(method == (method & (winmethod_DirMask | winmethod_DivisionMask)), NULL); - g_return_val_if_fail(!(((method & winmethod_DivisionMask) == winmethod_Proportional) && size > 100), NULL); + g_return_val_if_fail(!(((method & winmethod_DivisionMask) == winmethod_Proportional) && size > 100), NULL); + if(method != (method & (winmethod_DirMask | winmethod_DivisionMask | winmethod_BorderMask))) + WARNING("Unrecognized bits in method constant"); ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);