RFR: 8313564: Fix -Wconversion warnings in classfile code [v4]

David Holmes dholmes at openjdk.org
Thu Aug 3 06:45:33 UTC 2023


On Thu, 3 Aug 2023 01:37:08 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This patch fixes various -Wconversion warnings in classfile code.  I broke the change into commits so the changes are easier to see.
>> Tested with tier1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix Atomic items_added code.

Changes requested by dholmes (Reviewer).

src/hotspot/share/classfile/stringTable.cpp line 804:

> 802: void StringTable::allocate_shared_strings_array(TRAPS) {
> 803:   assert(DumpSharedSpaces, "must be");
> 804:   if (_items_count > max_jint) {

This is impossible given `_items_count_` is now an int

src/hotspot/share/classfile/symbolTable.cpp line 91:

> 89: 
> 90: static volatile int    _items_count = 0;
> 91: static volatile bool   _has_items_to_clean = false;

Nit: the extra spaces are not needed now we use a shorter type name

src/hotspot/share/classfile/symbolTable.cpp line 240:

> 238: 
> 239: double SymbolTable::get_load_factor() {
> 240:   return (double)_items_count/(double)_current_size;

You shouldn't need the cast to double now `_items_count` is an int.

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

PR Review: https://git.openjdk.org/jdk/pull/15111#pullrequestreview-1560333725
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1282715657
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1282717016
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1282719265


More information about the graal-dev mailing list