summaryrefslogtreecommitdiff
path: root/pxl/pxvalue.c
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2007-12-28 00:55:54 +0000
committerHenry Stiles <henry.stiles@artifex.com>2007-12-28 00:55:54 +0000
commitfe5cd5ed5348c15040a7502bfc6378d2b7253e91 (patch)
tree786d4c796dcc207f1d06429f42d26e9989daa669 /pxl/pxvalue.c
parentda613002a7133935fd6ec404e5d860d81c9adf83 (diff)
Fixes several issues associated with bug #689598. pcl6_gcc.mak now
initializes FPU_TYPE and adopts similar warning and code generation options from gs. In pxvalue.c:real32at the compiler did not generate the expected code with -O2 optimization. We suspect this is because the code was not compliant with C99 strict aliasing rules but don't know for sure. The procedure has been replaced with a "legal" equivalent. No differences expected on 32 bit regression tests. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2997 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl/pxvalue.c')
-rw-r--r--pxl/pxvalue.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pxl/pxvalue.c b/pxl/pxvalue.c
index c3982b5ae..8431e78e0 100644
--- a/pxl/pxvalue.c
+++ b/pxl/pxvalue.c
@@ -40,9 +40,14 @@ sint32at(const byte *p, bool big_endian)
}
real
real32at(const byte *p, bool big_endian)
-{ float f;
- *(integer *)&f = uint32at(p, big_endian);
- return (real)f;
+{
+ union {
+ float f;
+ integer d;
+ } df;
+
+ df.d = uint32at(p, big_endian);
+ return (real)df.f;
}
/* Get an element from an array. */