On Thu, 8 Oct 2026 14:26:05 GMT, Matthias Baesken <[email protected]> wrote:
>> We currently disable the unused-variable warning in BUILD_LIBAWT for >> gcc/clang, this should be avoided. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Matthias Baesken has updated the pull request incrementally with one > additional commit since the last revision: > > remove dummy variable src/java.desktop/share/native/libawt/java2d/Disposer.c line 51: > 49: if (dispClass == NULL) { > 50: /* Needed to initialize the Disposer class as it may be not yet > referenced */ > 51: (*env)->FindClass(env, "sun/java2d/Disposer"); Let's hope that doesn't tickle another complaint in the future that the return value is un-used .. src/java.desktop/share/native/libawt/java2d/loops/AnyByteBinary.h line 399: > 397: InitialLoad ## DST(pPix, DstPix); \ > 398: Xor ## DST ## PixelData(pPix, 0, DstPix, \ > 399: pixel, xorpixel, > pCompInfo->alphaMask); \ I can imagine why byte binary doesn't use alphaMask, but this causes an extra load per row all for an un-used variable. These loops are performance critical but byte binary is very uncommon so it likely doesn't matter much. src/java.desktop/share/native/libawt/java2d/loops/Index12Gray.c line 160: > 158: DeclareIndex12GrayLoadVars(DstRead) > 159: jint srcScan = pSrcInfo->scanStride; > 160: jint dstScan = pDstInfo->scanStride; The change below perhaps points out that these assignments could be moved inside the if block that uses them but I think that's out of scope for this PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4233254575 PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4233188723 PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4233245487
