summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-04-16 17:13:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-04-16 17:13:37 +0000
commit0e0c6eb1ee81a9e4508fbaddcb05f7e545f1b040 (patch)
treed082eca75d0e41527a52954f927eacee62d28fef
parent53bbe5fb9e914f4e457516b2d36ffa724c0133e7 (diff)
downloadnetsurf-0e0c6eb1ee81a9e4508fbaddcb05f7e545f1b040.tar.gz
netsurf-0e0c6eb1ee81a9e4508fbaddcb05f7e545f1b040.tar.bz2
Fix debug build. Is this worth the effort, I wonder?
svn path=/trunk/netsurf/; revision=7106
-rw-r--r--debug/debug_bitmap.c33
-rw-r--r--debug/netsurfd.c9
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 <stdbool.h>
#include <string.h>
#include <time.h>
+#include <unistd.h>
#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,