From 067544120f950039557a04f1ba06ec6870bd1088 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 9 Jun 2017 09:18:17 +0200 Subject: [PATCH] Make function declaration match function prototype. - Extra NULL check. --- include/helper.h | 4 ++-- include/widgets/widget.h | 4 ++-- source/widgets/widget.c | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/helper.h b/include/helper.h index 55cf855f..ad7359fb 100644 --- a/include/helper.h +++ b/include/helper.h @@ -225,13 +225,13 @@ char * rofi_force_utf8 ( const gchar *data, ssize_t length ); char * rofi_latin_to_utf8_strdup ( const char *input, gssize length ); /** - * @param input the string to escape + * @param text the string to escape * * Escape XML markup from the string. @param input is freed. * * @return the escaped string */ -gchar *rofi_escape_markup ( gchar *input ); +gchar *rofi_escape_markup ( gchar *text ); /** * @param pattern The user input to match against. diff --git a/include/widgets/widget.h b/include/widgets/widget.h index 322ef64d..9807aada 100644 --- a/include/widgets/widget.h +++ b/include/widgets/widget.h @@ -272,11 +272,11 @@ WidgetTriggerActionResult widget_trigger_action ( widget *wid, guint action, gin /** * @param wid The widget handle * @param cb The widget trigger action callback - * @param udata the user data to pass to callback + * @param cb_data the user data to pass to callback * * Override the widget trigger action handler on widget. */ -void widget_set_trigger_action_handler ( widget *wid, widget_trigger_action_cb cb, void *udata ); +void widget_set_trigger_action_handler ( widget *wid, widget_trigger_action_cb cb, void *cb_data ); /** * @param wid The widget handle diff --git a/source/widgets/widget.c b/source/widgets/widget.c index 9e1016b2..8c99894c 100644 --- a/source/widgets/widget.c +++ b/source/widgets/widget.c @@ -551,14 +551,20 @@ int widget_padding_get_padding_width ( const widget *wid ) int widget_get_desired_height ( widget *wid ) { - if ( wid && wid->get_desired_height ) { + if ( wid == NULL ) { + return 0; + } + if ( wid->get_desired_height ) { return wid->get_desired_height ( wid ); } return wid->h; } int widget_get_desired_width ( widget *wid ) { - if ( wid && wid->get_desired_width ) { + if ( wid == NULL ) { + return 0; + } + if ( wid->get_desired_width ) { return wid->get_desired_width ( wid ); } return wid->w;