diff options
author | Brian Paul <[email protected]> | 2001-06-15 15:22:07 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-06-15 15:22:07 +0000 |
commit | 24ae7c4c1f18c3086a779a2ee8f480ee5f4e7612 (patch) | |
tree | 5b196d48ff5c11557acc305e3450a5f80ba9901d /src/mesa/main/glheader.h | |
parent | e4276667dafc8de0c6e64af8300fc7598437de6e (diff) |
Added fi_type union typedef to glheader.h.
Replace various float/int casts with the fi_type union cast.
Fixes -fstrict-aliasing problems.
Diffstat (limited to 'src/mesa/main/glheader.h')
-rw-r--r-- | src/mesa/main/glheader.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 0324b42ffd9..596bd2d01ee 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -1,4 +1,4 @@ -/* $Id: glheader.h,v 1.20 2001/05/14 23:11:12 brianp Exp $ */ +/* $Id: glheader.h,v 1.21 2001/06/15 15:22:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -241,5 +241,15 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC #endif +/* + * Sometimes we treat GLfloats as GLints. On x86 systems, moving a float + * as a int (thereby using integer registers instead of fp registers) is + * a performance win. Typically, this can be done with ordinary casts. + * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0) + * these casts generate warnings. + * The following union typedef is used to solve that. + */ +typedef union { GLfloat f; GLint i; } fi_type; + #endif /* GLHEADER_H */ |