Mercurial > hg > truffle
comparison src/share/vm/utilities/globalDefinitions_sparcWorks.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 | f08d439fab8c |
children | 17caeb034a63 |
comparison
equal
deleted
inserted
replaced
20286:631c3a4ea10c | 20287:b6a8cc1e0d92 |
---|---|
181 typedef unsigned char jubyte; | 181 typedef unsigned char jubyte; |
182 typedef unsigned short jushort; | 182 typedef unsigned short jushort; |
183 typedef unsigned int juint; | 183 typedef unsigned int juint; |
184 typedef unsigned long long julong; | 184 typedef unsigned long long julong; |
185 | 185 |
186 //---------------------------------------------------------------------------------------------------- | |
187 // Special (possibly not-portable) casts | |
188 // Cast floats into same-size integers and vice-versa w/o changing bit-pattern | |
189 | |
190 inline jint jint_cast (jfloat x) { return *(jint* )&x; } | |
191 inline jlong jlong_cast (jdouble x) { return *(jlong* )&x; } | |
192 | |
193 inline jfloat jfloat_cast (jint x) { return *(jfloat* )&x; } | |
194 inline jdouble jdouble_cast(jlong x) { return *(jdouble*)&x; } | |
195 | 186 |
196 //---------------------------------------------------------------------------------------------------- | 187 //---------------------------------------------------------------------------------------------------- |
197 // Constant for jlong (specifying an long long constant is C++ compiler specific) | 188 // Constant for jlong (specifying an long long constant is C++ compiler specific) |
198 | 189 |
199 // Build a 64bit integer constant | 190 // Build a 64bit integer constant |