summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-02-25 17:58:00 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-02-25 17:58:00 +0000
commit1cf46a6792a9e243edb857e131e44338bcbbd341 (patch)
tree9d145155307f4bc19746e486c7cd49ef897a49a1 /image
parent674591f63df9c9b1e8e02aef4992a24b39cda0fc (diff)
downloadnetsurf-1cf46a6792a9e243edb857e131e44338bcbbd341.tar.gz
netsurf-1cf46a6792a9e243edb857e131e44338bcbbd341.tar.bz2
SignednessWarnings.squash()
Aside from a number of instances of const being cast away (mostly relating to the urldb, which is correct to only export const data) this now builds warning-free with GCC 4 on x86, which is nice. svn path=/trunk/netsurf/; revision=3868
Diffstat (limited to 'image')
-rw-r--r--image/bmp.c2
-rw-r--r--image/bmpread.c9
-rw-r--r--image/gif.c2
-rw-r--r--image/gifread.c5
-rw-r--r--image/ico.c2
-rw-r--r--image/jpeg.c4
6 files changed, 13 insertions, 11 deletions
diff --git a/image/bmp.c b/image/bmp.c
index 4e1c5f762..ed1ea6c02 100644
--- a/image/bmp.c
+++ b/image/bmp.c
@@ -52,7 +52,7 @@ bool nsbmp_convert(struct content *c, int iwidth, int iheight) {
/* set our source data */
bmp = c->data.bmp.bmp;
- bmp->bmp_data = c->source_data;
+ bmp->bmp_data = (unsigned char *) c->source_data;
bmp->buffer_size = c->source_size;
/* analyse the BMP */
diff --git a/image/bmpread.c b/image/bmpread.c
index c89db98b7..f8ae53cc0 100644
--- a/image/bmpread.c
+++ b/image/bmpread.c
@@ -50,7 +50,7 @@ void bmp_invalidate(struct bitmap *bitmap, void *private_word);
* \return BMP_OK on success
*/
bmp_result bmp_analyse(struct bmp_image *bmp) {
- char *data = bmp->bmp_data;
+ char *data = (char *) bmp->bmp_data;
/* ensure we aren't already initialised */
if (bmp->bitmap)
@@ -87,7 +87,7 @@ bmp_result bmp_analyse(struct bmp_image *bmp) {
* \return BMP_OK on success
*/
bmp_result ico_analyse(struct ico_collection *ico) {
- char *data = ico->ico_data;
+ char *data = (char *) ico->ico_data;
unsigned int count, i;
bmp_result result;
struct ico_image *image;
@@ -126,7 +126,8 @@ bmp_result ico_analyse(struct ico_collection *ico) {
image->bmp.bmp_data = ico->ico_data + READ_INT(data, 12);
image->bmp.ico = true;
data += 16;
- result = bmp_analyse_header(&image->bmp, image->bmp.bmp_data);
+ result = bmp_analyse_header(&image->bmp,
+ (char *) image->bmp.bmp_data);
if (result != BMP_OK)
return result;
area = image->bmp.width * image->bmp.height;
@@ -370,7 +371,7 @@ bmp_result bmp_decode(struct bmp_image *bmp) {
assert(bmp->bitmap);
- data = bmp->bmp_data + bmp->bitmap_offset;
+ data = (char *) bmp->bmp_data + bmp->bitmap_offset;
bytes = bmp->buffer_size - bmp->bitmap_offset;
switch (bmp->encoding) {
diff --git a/image/gif.c b/image/gif.c
index fb6c559db..657f1a666 100644
--- a/image/gif.c
+++ b/image/gif.c
@@ -73,7 +73,7 @@ bool nsgif_convert(struct content *c, int iwidth, int iheight) {
/* Create our animation
*/
gif = c->data.gif.gif;
- gif->gif_data = c->source_data;
+ gif->gif_data = (unsigned char *) c->source_data;
gif->buffer_size = c->source_size;
gif->buffer_position = 0;
diff --git a/image/gifread.c b/image/gifread.c
index ce826b006..30fd19e0f 100644
--- a/image/gifread.c
+++ b/image/gifread.c
@@ -149,7 +149,7 @@ int gif_initialise(struct gif_animation *gif) {
/* Check we are a GIF
*/
- if (strncmp(gif_data, "GIF", 3) != 0)
+ if (strncmp((const char *) gif_data, "GIF", 3) != 0)
return GIF_DATA_ERROR;
gif_data += 3;
@@ -410,7 +410,8 @@ int gif_initialise_frame(struct gif_animation *gif) {
*/
} else if ((gif_data[1] == 0xff) &&
(gif_data[2] == 0x0b) &&
- (strncmp(gif_data + 3, "NETSCAPE2.0", 11) == 0) &&
+ (strncmp((const char *) gif_data + 3,
+ "NETSCAPE2.0", 11) == 0) &&
(gif_data[14] == 0x03) &&
(gif_data[15] == 0x01)) {
gif->loop_count = gif_data[16] | (gif_data[17] << 8);
diff --git a/image/ico.c b/image/ico.c
index 50c69c4e3..45d445000 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -53,7 +53,7 @@ bool nsico_convert(struct content *c, int iwidth, int iheight) {
/* set our source data */
ico = c->data.ico.ico;
- ico->ico_data = c->source_data;
+ ico->ico_data = (unsigned char *) c->source_data;
ico->buffer_size = c->source_size;
/* analyse the BMP */
diff --git a/image/jpeg.c b/image/jpeg.c
index 11f591b5f..523a52fce 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -95,7 +95,7 @@ bool nsjpeg_convert(struct content *c, int w, int h)
return false;
}
jpeg_create_decompress(&cinfo);
- source_mgr.next_input_byte = c->source_data;
+ source_mgr.next_input_byte = (unsigned char *) c->source_data;
source_mgr.bytes_in_buffer = c->source_size;
cinfo.src = &source_mgr;
jpeg_read_header(&cinfo, TRUE);
@@ -180,7 +180,7 @@ void nsjpeg_init_source(j_decompress_ptr cinfo)
}
-static char nsjpeg_eoi[] = { 0xff, JPEG_EOI };
+static unsigned char nsjpeg_eoi[] = { 0xff, JPEG_EOI };
/**
* JPEG data source manager: fill the input buffer.