]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - jpeg.c
made packfile_t (describes a file in a pack) use fs_offset_t
[xonotic/darkplaces.git] / jpeg.c
diff --git a/jpeg.c b/jpeg.c
index 70bd13dab1f5b00c537995429696bab95cd41424..420fda737a3e411161a79293161d4c276edb7e80 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -468,7 +468,7 @@ static void JPEG_SkipInputData (j_decompress_ptr cinfo, long num_bytes)
     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));
 
@@ -496,7 +496,7 @@ JPEG_LoadImage
 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;
@@ -628,7 +628,7 @@ static void JPEG_TermDestination (j_compress_ptr cinfo)
 
        // 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;
 }
 
@@ -671,7 +671,7 @@ qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height,
        }
 
        // Open the file
-       file = FS_Open (filename, "wb", true);
+       file = FS_Open (filename, "wb", true, false);
        if (!file)
                return false;