RFR: 8313785: Fix -Wconversion warnings in prims code

Serguei Spitsyn sspitsyn at openjdk.org
Fri Aug 4 20:32:31 UTC 2023


On Fri, 4 Aug 2023 19:27:50 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/prims/unsafe.cpp line 111:
>> 
>>> 109: }
>>> 110: 
>>> 111: static inline int field_offset_from_byte_offset(int byte_offset) {
>> 
>> Nit: I wonder if the same fix is needed for the previous function at line 107 to make it consistent.
>>        But I guess there is no warning related to it.
>
> The names look almost the same, but field_offset_to_byte_offset() is called primarily passing jlong in several places so changing that would have had more fan out (and might not have been correct).
> The callers of field_offset_from_byte_offset() had callers that passed int and expected int returns, so that's why I changed only that one.

Okay, thanks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15160#discussion_r1284824110


More information about the serviceability-dev mailing list