From d1a493f5697e5cd29394bbad6d0183fb530a9d29 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 27 Aug 2017 13:32:53 +0100 Subject: ICO content handler: Convert to using content_broadcast_errorcode(). --- content/handlers/image/ico.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'content/handlers/image') diff --git a/content/handlers/image/ico.c b/content/handlers/image/ico.c index 180b20d7e..d1865a3b4 100644 --- a/content/handlers/image/ico.c +++ b/content/handlers/image/ico.c @@ -66,7 +66,6 @@ static void *nsico_bitmap_create(int width, int height, unsigned int bmp_state) static nserror nsico_create_ico_data(nsico_content *c) { - union content_msg_data msg_data; bmp_bitmap_callback_vt bmp_bitmap_callbacks = { .bitmap_create = nsico_bitmap_create, .bitmap_destroy = guit->bitmap->destroy, @@ -76,8 +75,7 @@ static nserror nsico_create_ico_data(nsico_content *c) c->ico = calloc(sizeof(ico_collection), 1); if (c->ico == NULL) { - msg_data.error = messages_get("NoMemory"); - content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data); + content_broadcast_errorcode(&c->base, NSERROR_NOMEM); return NSERROR_NOMEM; } ico_collection_create(c->ico, &bmp_bitmap_callbacks); @@ -122,7 +120,6 @@ static bool nsico_convert(struct content *c) nsico_content *ico = (nsico_content *) c; struct bmp_image *bmp; bmp_result res; - union content_msg_data msg_data; const char *data; unsigned long size; char *title; @@ -137,13 +134,11 @@ static bool nsico_convert(struct content *c) case BMP_OK: break; case BMP_INSUFFICIENT_MEMORY: - msg_data.error = messages_get("NoMemory"); - content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); + content_broadcast_errorcode(c, NSERROR_NOMEM); return false; case BMP_INSUFFICIENT_DATA: case BMP_DATA_ERROR: - msg_data.error = messages_get("BadICO"); - content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); + content_broadcast_errorcode(c, NSERROR_ICO_ERROR); return false; } -- cgit v1.2.3