cinfo->src->bytes_in_buffer -= num_bytes;
}
-static void JPEG_MemSrc (j_decompress_ptr cinfo, qbyte *buffer)
+static void JPEG_MemSrc (j_decompress_ptr cinfo, const qbyte *buffer)
{
cinfo->src = cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (struct jpeg_source_mgr));
Load a JPEG image into a RGBA buffer
====================
*/
-qbyte* JPEG_LoadImage (qbyte *f, int matchwidth, int matchheight)
+qbyte* JPEG_LoadImage (const qbyte *f, int matchwidth, int matchheight)
{
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
// Write any data remaining in the buffer
if (datacount > 0)
- if (FS_Write (dest->outfile, dest->buffer, datacount) != datacount)
+ if (FS_Write (dest->outfile, dest->buffer, datacount) != (fs_offset_t)datacount)
error_in_jpeg = true;
}
}
// Open the file
- file = FS_Open (filename, "wb", true);
+ file = FS_Open (filename, "wb", true, false);
if (!file)
return false;