aboutsummaryrefslogtreecommitdiffstats
path: root/code/renderer/tr_image_jpg.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-10 23:55:22 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-10 23:55:22 +0000
commit8ba546241137c6c1c43751b25e40bbaf610658a1 (patch)
treea677c3ad74326acc217842a2d927328597cfe3c8 /code/renderer/tr_image_jpg.c
parentb1613ef65246cc89a1e40e35c6e07080c56ea00b (diff)
downloadioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.tar.gz
ioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.zip
* Fix some new GCC 4.3 warnings
* Fix many many strict aliasing warnings, now that it's re-enabled git-svn-id: svn://svn.icculus.org/quake3/trunk@1487 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/renderer/tr_image_jpg.c')
-rw-r--r--code/renderer/tr_image_jpg.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/code/renderer/tr_image_jpg.c b/code/renderer/tr_image_jpg.c
index fb4f212..2e1a52a 100644
--- a/code/renderer/tr_image_jpg.c
+++ b/code/renderer/tr_image_jpg.c
@@ -57,7 +57,10 @@ void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *heig
unsigned pixelcount, memcount;
unsigned char *out;
int len;
- byte *fbuffer;
+ union {
+ byte *b;
+ void *v;
+ } fbuffer;
byte *buf;
/* In this example we want to open the input file before doing anything else,
@@ -66,8 +69,8 @@ void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *heig
* requires it in order to read binary files.
*/
- len = ri.FS_ReadFile ( ( char * ) filename, (void **)&fbuffer);
- if (!fbuffer || len < 0) {
+ len = ri.FS_ReadFile ( ( char * ) filename, &fbuffer.v);
+ if (!fbuffer.b || len < 0) {
return;
}
@@ -85,7 +88,7 @@ void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *heig
/* Step 2: specify data source (eg, a file) */
- jpeg_mem_src(&cinfo, fbuffer, len);
+ jpeg_mem_src(&cinfo, fbuffer.b, len);
/* Step 3: read file parameters with jpeg_read_header() */
@@ -203,7 +206,7 @@ void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *heig
* so as to simplify the setjmp error logic above. (Actually, I don't
* think that jpeg_destroy can do an error exit, but why assume anything...)
*/
- ri.FS_FreeFile (fbuffer);
+ ri.FS_FreeFile (fbuffer.v);
/* At this point you may want to check to see whether any corrupt-data
* warnings occurred (test whether jerr.pub.num_warnings is nonzero).