]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
use volatile on icolor and fcolor pointers in GL_ConvertColorsFloatToByte to avoid...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Jun 2002 21:04:36 +0000 (21:04 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Jun 2002 21:04:36 +0000 (21:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1884 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 385a3d7338f203a81d6720c246ede7e82a42f785..d25ca67dbd1b3a20033e809853ec2473df90e1ef 100644 (file)
@@ -592,8 +592,12 @@ void GL_UpdateFarclip(void)
 
 void GL_ConvertColorsFloatToByte(void)
 {
-       int i, k, total, *icolor;
-       float *fcolor;
+       int i, k, total;
+       // LordHavoc: to avoid problems with aliasing (treating memory as two
+       // different types - exactly what this is doing), these must be volatile
+       // (or a union)
+       volatile int *icolor;
+       volatile float *fcolor;
        qbyte *bcolor;
 
        total = currentvertex * 4;