RFR: JDK-8288094: cleanup old _MSC_VER handling [v2]

Matthias Baesken mbaesken at openjdk.java.net
Mon Jun 13 07:24:53 UTC 2022


On Fri, 10 Jun 2022 21:04:04 GMT, Phil Race <prr at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   use round directly
>
> src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp line 38:
> 
>> 36: #  define ROUND_TO_INT(num)    ((int) round(num))
>> 37: #else
>> 38: #  define ROUND_TO_INT(num)    ((int) floor((num) + 0.5))
> 
> If you look at when and why this was introduced (*), the "else" was not to support some other compiler - it was to support the older MS compiler. So if you don't want that, then the whole thing reduces to
> #define ROUND_TO_INT(num) ((int) round(num))
> 
> .. you could even go further and eliminate the macro altogether if it makes sense - you'd have to look at the usages.
> 
> Same logic applies to the other files.
> 
> 
> (*) https://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010889.html

Hi Phil, I simplified the code more and now use round directly.

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

PR: https://git.openjdk.org/jdk/pull/9105


More information about the core-libs-dev mailing list