From 0e0c6eb1ee81a9e4508fbaddcb05f7e545f1b040 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 16 Apr 2009 17:13:37 +0000 Subject: Fix debug build. Is this worth the effort, I wonder? svn path=/trunk/netsurf/; revision=7106 --- debug/debug_bitmap.c | 33 ++++++++++++++++++++++++--------- debug/netsurfd.c | 9 ++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/debug/debug_bitmap.c b/debug/debug_bitmap.c index 767798302..aaf0e671c 100644 --- a/debug/debug_bitmap.c +++ b/debug/debug_bitmap.c @@ -31,7 +31,7 @@ struct bitmap { int width; - char pixels[1]; + unsigned char pixels[1]; }; @@ -44,7 +44,7 @@ struct bitmap { * \return an opaque struct bitmap, or NULL on memory exhaustion */ -struct bitmap *bitmap_create(int width, int height, unsigned int state) +void *bitmap_create(int width, int height, unsigned int state) { struct bitmap *bitmap; bitmap = calloc(sizeof *bitmap + width * height * 4, 1); @@ -64,8 +64,9 @@ struct bitmap *bitmap_create(int width, int height, unsigned int state) * of rows. The width of a row in bytes is given by bitmap_get_rowstride(). */ -char *bitmap_get_buffer(struct bitmap *bitmap) +unsigned char *bitmap_get_buffer(void *vbitmap) { + struct bitmap *bitmap = vbitmap; assert(bitmap); return bitmap->pixels; } @@ -78,12 +79,18 @@ char *bitmap_get_buffer(struct bitmap *bitmap) * \return width of a pixel row in the bitmap */ -size_t bitmap_get_rowstride(struct bitmap *bitmap) +size_t bitmap_get_rowstride(void *vbitmap) { + struct bitmap *bitmap = vbitmap; assert(bitmap); return bitmap->width * 4; } +size_t bitmap_get_bpp(void *bitmap) +{ + /* Bytes, not bits (ugh!) */ + return 4; +} /** * Free a bitmap. @@ -91,8 +98,9 @@ size_t bitmap_get_rowstride(struct bitmap *bitmap) * \param bitmap a bitmap, as returned by bitmap_create() */ -void bitmap_destroy(struct bitmap *bitmap) +void bitmap_destroy(void *vbitmap) { + struct bitmap *bitmap = vbitmap; assert(bitmap); free(bitmap); } @@ -106,7 +114,7 @@ void bitmap_destroy(struct bitmap *bitmap) * \return true on success, false on error and error reported */ -bool bitmap_save(struct bitmap *bitmap, const char *path, unsigned flags) +bool bitmap_save(void *bitmap, const char *path, unsigned flags) { return true; } @@ -117,7 +125,8 @@ bool bitmap_save(struct bitmap *bitmap, const char *path, unsigned flags) * * \param bitmap a bitmap, as returned by bitmap_create() */ -void bitmap_modified(struct bitmap *bitmap) { +void bitmap_modified(void *bitmap) +{ } @@ -129,6 +138,12 @@ void bitmap_modified(struct bitmap *bitmap) { * \param suspend the function to be called upon suspension * \param resume the function to be called when resuming */ -void bitmap_set_suspendable(struct bitmap *bitmap, void *private_word, - void (*invalidate)(struct bitmap *bitmap, void *private_word)) { +void bitmap_set_suspendable(void *bitmap, void *private_word, + void (*invalidate)(void *bitmap, void *private_word)) +{ } + +bool bitmap_get_opaque(void *bitmap) { return false; } +bool bitmap_test_opaque(void *bitmap) { return false; } +void bitmap_set_opaque(void *bitmap, bool opaque) {} + diff --git a/debug/netsurfd.c b/debug/netsurfd.c index 29db10d4f..406cd9e22 100644 --- a/debug/netsurfd.c +++ b/debug/netsurfd.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "utils/config.h" #include "content/fetch.h" #include "content/content.h" @@ -182,12 +183,6 @@ void plugin_close(struct content *c) {} bool plugin_handleable(const char *mime_type) {return false;} #endif -#ifndef riscos -bool bitmap_get_opaque(struct bitmap *bitmap) { return false; } -bool bitmap_test_opaque(struct bitmap *bitmap) { return false; } -void bitmap_set_opaque(struct bitmap *bitmap, bool opaque) {} -#endif - void tree_initialise_redraw(struct tree *tree) {} void tree_redraw_area(struct tree *tree, int x, int y, int width, int height) {} void tree_draw_line(int x, int y, int width, int height) {} @@ -202,7 +197,7 @@ void tree_set_node_sprite_folder(struct node *node) {} #ifndef riscos void schedule(int t, void (*callback)(void *p), void *p) {} void schedule_remove(void (*callback)(void *p), void *p) {} -bool schedule_run(void) {} +bool schedule_run(void) { return false; } #endif bool selection_highlighted(struct selection *s, unsigned start, unsigned end, -- cgit v1.2.3