From 80632a6ab2f53b27a10756d776042c41c93a2137 Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Thu, 21 Apr 2011 11:52:16 +0200 Subject: [PATCH] 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. --- libchimara/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.30.2