[foreign-jextract] [Rev 01] RFR: 8238316: jextract emits a C_BOOL when source says char

Athijegannathan Sundararajan sundar at openjdk.java.net
Fri Feb 21 17:02:42 UTC 2020


On Fri, 21 Feb 2020 15:32:33 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> The pull request has been updated with 1 additional commit.
> 
> src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/LayoutUtils.java line 66:
> 
>> 65:             case Char_U:
>> 66:                 return C_UCHAR;
>> 67:             case SChar:
> 
> Could use
> 
>             case UChar, Char_U:
>                 return C_UCHAR;
> 
> Here and elsewhere in the same switch.
> 
> Or maybe it's nice to switch the whole switch to a switch-expression using `->`, since then you can remove all the `return`s?

Agree on combining cases. But there is control flow (throw with couple of more statements). I'd prefer minimal change for this fix.

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

PR: https://git.openjdk.java.net/panama-foreign/pull/25


More information about the panama-dev mailing list