comparison src/share/vm/utilities/globalDefinitions_gcc.hpp @ 20287:b6a8cc1e0d92

8040121: Load variable through a pointer of an incompatible type in src/hotspot/src/share/vm: opto/output.cpp, runtime/sharedRuntimeTrans.cpp, utilities/globalDefinitions_visCPP.hpp Summary: Fixed parfait warnings in globalDefinitions files by using a union for casts. Reviewed-by: kvn
author thartmann
date Tue, 29 Jul 2014 13:54:16 +0200
parents 78bbf4d43a14
children
comparison
equal deleted inserted replaced
20286:631c3a4ea10c 20287:b6a8cc1e0d92
165 typedef uint8_t jubyte; 165 typedef uint8_t jubyte;
166 typedef uint16_t jushort; 166 typedef uint16_t jushort;
167 typedef uint32_t juint; 167 typedef uint32_t juint;
168 typedef uint64_t julong; 168 typedef uint64_t julong;
169 169
170 //----------------------------------------------------------------------------------------------------
171 // Special (possibly not-portable) casts
172 // Cast floats into same-size integers and vice-versa w/o changing bit-pattern
173 // %%%%%% These seem like standard C++ to me--how about factoring them out? - Ungar
174
175 inline jint jint_cast (jfloat x) { return *(jint* )&x; }
176 inline jlong jlong_cast (jdouble x) { return *(jlong* )&x; }
177 inline julong julong_cast (jdouble x) { return *(julong* )&x; }
178
179 inline jfloat jfloat_cast (jint x) { return *(jfloat* )&x; }
180 inline jdouble jdouble_cast(jlong x) { return *(jdouble*)&x; }
181 170
182 //---------------------------------------------------------------------------------------------------- 171 //----------------------------------------------------------------------------------------------------
183 // Constant for jlong (specifying an long long canstant is C++ compiler specific) 172 // Constant for jlong (specifying an long long canstant is C++ compiler specific)
184 173
185 // Build a 64bit integer constant 174 // Build a 64bit integer constant