diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2017-08-27 13:23:23 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2017-08-27 13:28:21 +0100 |
commit | 337bd98f6c6b8ec900afaae613337fdbc5ba778a (patch) | |
tree | 0e7f0af485a0fac44081aafee5c8c516049e7aa0 /content/handlers/image | |
parent | d4cdcf30675a642764b5dc32e313aa92e4849496 (diff) | |
download | netsurf-337bd98f6c6b8ec900afaae613337fdbc5ba778a.tar.gz netsurf-337bd98f6c6b8ec900afaae613337fdbc5ba778a.tar.bz2 |
BMP content handler: Convert to using content_broadcast_errorcode().
Diffstat (limited to 'content/handlers/image')
-rw-r--r-- | content/handlers/image/bmp.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/content/handlers/image/bmp.c b/content/handlers/image/bmp.c index 47c1d0845..48a37fb24 100644 --- a/content/handlers/image/bmp.c +++ b/content/handlers/image/bmp.c @@ -68,8 +68,7 @@ static void *nsbmp_bitmap_create(int width, int height, unsigned int bmp_state) } static nserror nsbmp_create_bmp_data(nsbmp_content *bmp) -{ - union content_msg_data msg_data; +{ bmp_bitmap_callback_vt bmp_bitmap_callbacks = { .bitmap_create = nsbmp_bitmap_create, .bitmap_destroy = guit->bitmap->destroy, @@ -79,8 +78,7 @@ static nserror nsbmp_create_bmp_data(nsbmp_content *bmp) bmp->bmp = calloc(sizeof(struct bmp_image), 1); if (bmp->bmp == NULL) { - msg_data.error = messages_get("NoMemory"); - content_broadcast(&bmp->base, CONTENT_MSG_ERROR, &msg_data); + content_broadcast_errorcode(&bmp->base, NSERROR_NOMEM); return NSERROR_NOMEM; } @@ -123,7 +121,6 @@ static bool nsbmp_convert(struct content *c) { nsbmp_content *bmp = (nsbmp_content *) c; bmp_result res; - union content_msg_data msg_data; uint32_t swidth; const char *data; unsigned long size; @@ -138,13 +135,11 @@ static bool nsbmp_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("BadBMP"); - content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); + content_broadcast_errorcode(c, NSERROR_BMP_ERROR); return false; } |