diff --git a/src/hotspot/share/c1/c1_Canonicalizer.hpp b/src/hotspot/share/c1/c1_Canonicalizer.hpp index bc340587cba..8c7651256e9 100644 --- a/src/hotspot/share/c1/c1_Canonicalizer.hpp +++ b/src/hotspot/share/c1/c1_Canonicalizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,6 @@ class Canonicalizer: InstructionVisitor { void set_constant(jlong x) { set_canonical(new Constant(new LongConstant(x))); } void set_constant(jfloat x) { set_canonical(new Constant(new FloatConstant(x))); } void set_constant(jdouble x) { set_canonical(new Constant(new DoubleConstant(x))); } -#ifdef _WINDOWS - // jint is defined as long in jni_md.h, so convert from int to jint - void set_constant(int x) { set_constant((jint)x); } -#endif void move_const_to_right(Op2* x); void do_Op2(Op2* x); diff --git a/src/java.base/windows/native/include/jni_md.h b/src/java.base/windows/native/include/jni_md.h index b8c144fb047..f795421937e 100644 --- a/src/java.base/windows/native/include/jni_md.h +++ b/src/java.base/windows/native/include/jni_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,9 +32,8 @@ #define JNIIMPORT __declspec(dllimport) #define JNICALL __stdcall -// 'long' is always 32 bit on windows so this matches what jdk expects -typedef long jint; -typedef __int64 jlong; +typedef int jint; +typedef long long jlong; typedef signed char jbyte; #endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp b/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp index 5e35ac7af34..08ff3214632 100644 --- a/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp +++ b/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ extern "C" { #define POLYTEMPSIZE (512 / sizeof(POINT)) -static void AngleToCoord(jint angle, jint w, jint h, jint *x, jint *y) +static void AngleToCoord(int angle, int w, int h, int *x, int *y) { const double pi = 3.1415926535; const double toRadians = 2 * pi / 360; @@ -322,7 +322,7 @@ Java_sun_java2d_windows_GDIRenderer_doDrawArc return; } - long sx, sy, ex, ey; + int sx, sy, ex, ey; if (angleExtent >= 360 || angleExtent <= -360) { sx = ex = x + w; sy = ey = y + h/2; @@ -602,7 +602,7 @@ Java_sun_java2d_windows_GDIRenderer_doFillArc if (wsdo == NULL) { return; } - long sx, sy, ex, ey; + int sx, sy, ex, ey; int angleEnd; if (angleExtent < 0) { angleEnd = angleStart; diff --git a/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp b/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp index 804a8efb8e9..77528dc3330 100644 --- a/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp +++ b/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -897,7 +897,7 @@ static void GDIWinSD_GetRasInfo(JNIEnv *env, } if (wsdo->lockFlags & SD_LOCK_LUT) { pRasInfo->lutBase = - (long *) wsdo->device->GetSystemPaletteEntries(); + (jint *) wsdo->device->GetSystemPaletteEntries(); pRasInfo->lutSize = 256; } else { pRasInfo->lutBase = NULL; diff --git a/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp b/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp index 2d0745f763f..b3f13a5bf82 100644 --- a/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp +++ b/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp @@ -1080,12 +1080,12 @@ JNIEXPORT jintArray JNICALL Java_sun_awt_shell_Win32ShellFolder2_getIconBits // Extract the color bitmap int nBits = iconSize * iconSize; - long *colorBits = NULL; - long *maskBits = NULL; + jint *colorBits = NULL; + int *maskBits = NULL; try { entry_point(); - colorBits = (long*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(long)); + colorBits = (jint*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(jint)); GetDIBits(dc, iconInfo.hbmColor, 0, iconSize, colorBits, &bmi, DIB_RGB_COLORS); // XP supports alpha in some icons, and depending on device. // This should take precedence over the icon mask bits. @@ -1100,7 +1100,7 @@ JNIEXPORT jintArray JNICALL Java_sun_awt_shell_Win32ShellFolder2_getIconBits } if (!hasAlpha) { // Extract the mask bitmap - maskBits = (long*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(long)); + maskBits = (int*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(int)); GetDIBits(dc, iconInfo.hbmMask, 0, iconSize, maskBits, &bmi, DIB_RGB_COLORS); // Copy the mask alphas into the color bits for (int i = 0; i < nBits; i++) { diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Menu.h b/src/java.desktop/windows/native/libawt/windows/awt_Menu.h index 4392f293678..9ee61f8b433 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Menu.h +++ b/src/java.desktop/windows/native/libawt/windows/awt_Menu.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,7 +73,7 @@ class AwtMenu : public AwtMenuItem { /*for multifont menu */ BOOL IsTopMenu(); - virtual AwtMenuItem* GetItem(jobject target, long index); + virtual AwtMenuItem* GetItem(jobject target, jint index); virtual int CountItem(jobject target); diff --git a/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp b/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp index cf12bf59607..24a9a24281b 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,7 +145,7 @@ int AwtMenuBar::CountItem(jobject menuBar) return nCount; } -AwtMenuItem* AwtMenuBar::GetItem(jobject target, long index) +AwtMenuItem* AwtMenuBar::GetItem(jobject target, jint index) { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); if (env->EnsureLocalCapacity(2) < 0) { diff --git a/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.h b/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.h index 3e60a9b399a..d55f656b539 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.h +++ b/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ class AwtMenuBar : public AwtMenu { virtual HWND GetOwnerHWnd(); virtual void RedrawMenuBar(); - AwtMenuItem* GetItem(jobject target, long index); + AwtMenuItem* GetItem(jobject target, jint index); int CountItem(jobject menuBar); void DrawItem(DRAWITEMSTRUCT& drawInfo); diff --git a/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp b/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp index 726ed4010bd..797e6fc4762 100644 --- a/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp +++ b/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp @@ -543,7 +543,7 @@ void Jaccesswalker::addComponentNodes(long vmID, AccessibleContext context, } else { char s[LINE_BUFSIZE]; snprintf( s, sizeof(s), - "ERROR calling GetAccessibleContextInfo; vmID = %X, context = %p", + "ERROR calling GetAccessibleContextInfo; vmID = %lX, context = %p", vmID, (void*)context ); TVITEM tvi; diff --git a/src/jdk.accessibility/windows/native/toolscommon/AccessInfo.cpp b/src/jdk.accessibility/windows/native/toolscommon/AccessInfo.cpp index 76d8f71ca3f..b9cd8434fc7 100644 --- a/src/jdk.accessibility/windows/native/toolscommon/AccessInfo.cpp +++ b/src/jdk.accessibility/windows/native/toolscommon/AccessInfo.cpp @@ -149,8 +149,8 @@ char *getAccessibleInfo(long vmID, AccessibleContext ac, int x, int y, wchar_t tmpBuf[LINE_BUFSIZE]; wchar_t name[LINE_BUFSIZE]; int i, j; - long start; - long end; + jint start; + jint end; if (buffer == NULL || bufsize <= 0) { return NULL;