From 69cea38f41b411ca9e55db365cf94339f4be891c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 26 Apr 2016 12:14:56 +0100 Subject: update scrollbar_create error handling to return nserror --- desktop/scrollbar.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'desktop/scrollbar.c') diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index caed13fbc..82fcac1c9 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -70,9 +70,9 @@ struct scrollbar { /* - * Exported function. Documented in scrollbar.h + * Exported function. Documented in desktop/scrollbar.h */ -bool scrollbar_create(bool horizontal, int length, int full_size, +nserror scrollbar_create(bool horizontal, int length, int full_size, int visible_size, void *client_data, scrollbar_client_callback client_callback, struct scrollbar **s) @@ -82,10 +82,8 @@ bool scrollbar_create(bool horizontal, int length, int full_size, scrollbar = malloc(sizeof(struct scrollbar)); if (scrollbar == NULL) { - LOG("malloc failed"); - warn_user("NoMemory", 0); *s = NULL; - return false; + return NSERROR_NOMEM; } scrollbar->horizontal = horizontal; @@ -109,7 +107,7 @@ bool scrollbar_create(bool horizontal, int length, int full_size, *s = scrollbar; - return true; + return NSERROR_OK; } -- cgit v1.2.3