diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-01-08 09:16:59 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-01-08 09:16:59 +0100 |
commit | dc8fb4f20256bbfb50b683f56886bc31b5a5187f (patch) | |
tree | 2b1d5fd9e4124874c923c9e2847dc8fdac74c785 /source/mode.c | |
parent | 20b2d658a06f158c526f85f621e460fb2570a49b (diff) |
Start making SardemFF happy. Use g_return_if_fail
Diffstat (limited to 'source/mode.c')
-rw-r--r-- | source/mode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/mode.c b/source/mode.c index e369b64f..63032f2b 100644 --- a/source/mode.c +++ b/source/mode.c @@ -10,11 +10,12 @@ * @{ */ -void mode_init ( Mode *mode ) +int mode_init ( Mode *mode ) { - g_assert ( mode != NULL ); - g_assert ( mode->_init != NULL ); + g_return_val_if_fail ( mode != NULL, FALSE ); + g_return_val_if_fail ( mode->_init != NULL, FALSE ); mode->_init ( mode ); + return TRUE; } void mode_destroy ( Mode *mode ) @@ -63,7 +64,7 @@ ModeMode mode_result ( Mode *mode, int menu_retv, char **input, unsigned int sel { g_assert ( mode != NULL ); g_assert ( mode->_result != NULL ); - g_assert ( (*input) != NULL ); + g_assert ( ( *input ) != NULL ); return mode->_result ( mode, menu_retv, input, selected_line ); } @@ -101,7 +102,7 @@ int mode_check_keybinding ( const Mode *mode, KeySym key, unsigned int modstate void mode_free ( Mode **mode ) { g_assert ( mode != NULL ); - g_assert ( (*mode) != NULL ); + g_assert ( ( *mode ) != NULL ); if ( ( *mode )->keycfg != NULL ) { g_free ( ( *mode )->keycfg ); ( *mode )->keycfg = NULL; |