X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=jpeg.c;h=a248948f327685779d497767c045dc4d3de7986f;hb=fd9860c8c2d7ff69fe2e49958e93cc9ed6c179ac;hp=49ebfd9588260f514247e96f49ecb43c6f569dcc;hpb=2cbfd57208b7e0050bf532456dedae601670af88;p=xonotic%2Fdarkplaces.git diff --git a/jpeg.c b/jpeg.c index 49ebfd95..a248948f 100644 --- a/jpeg.c +++ b/jpeg.c @@ -757,7 +757,7 @@ static void JPEG_MemDest (j_compress_ptr cinfo, void* buf, size_t bufsize) dest->pub.term_destination = JPEG_Mem_TermDestination; dest->outfile = NULL; - dest->buffer = buf; + dest->buffer = (unsigned char *) buf; dest->bufsize = bufsize; } @@ -970,7 +970,7 @@ static void CompressedImageCache_Add(const char *imagename, size_t maxsize, void if(strlen(imagename) >= MAX_QPATH) return; // can't add this - i = Z_Malloc(sizeof(CompressedImageCacheItem)); + i = (CompressedImageCacheItem*) Z_Malloc(sizeof(CompressedImageCacheItem)); strlcpy(i->imagename, imagename, sizeof(i->imagename)); i->maxsize = maxsize; i->compressed = compressed; @@ -1038,7 +1038,7 @@ qboolean Image_Compress(const char *imagename, size_t maxsize, void **buf, size_ Image_MipReduce32(imagedata, imagedata, &image_width, &image_height, &one, image_width/2, image_height/2, 1); } - newimagedata = Mem_Alloc(tempmempool, image_width * image_height * 3); + newimagedata = (unsigned char *) Mem_Alloc(tempmempool, image_width * image_height * 3); // convert the image from BGRA to RGB Image_CopyMux(newimagedata, imagedata, image_width, image_height, false, false, false, 3, 4, components); @@ -1046,7 +1046,7 @@ qboolean Image_Compress(const char *imagename, size_t maxsize, void **buf, size_ // try to compress it to JPEG *buf = Z_Malloc(maxsize); - *size = JPEG_SaveImage_to_Buffer(*buf, maxsize, image_width, image_height, newimagedata); + *size = JPEG_SaveImage_to_Buffer((char *) *buf, maxsize, image_width, image_height, newimagedata); if(!*size) { Z_Free(*buf);