Skip to content

Commit bbc5c98

Browse files
8342868: Errors related to unused code on Windows after 8339120 in core libs
Reviewed-by: naoto, jlu
1 parent 563a335 commit bbc5c98

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/java.base/share/native/libzip/zip_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,9 @@ readCEN(jzfile *zip, jint knownTotal)
579579
jlong offset;
580580
#endif
581581
unsigned char endbuf[ENDHDR];
582+
#ifdef USE_MMAP
582583
jint endhdrlen = ENDHDR;
584+
#endif
583585
jzcell *entries;
584586
jint *table;
585587

@@ -604,7 +606,9 @@ readCEN(jzfile *zip, jint knownTotal)
604606
cenoff = ZIP64_ENDOFF(end64buf);
605607
total = (jint)ZIP64_ENDTOT(end64buf);
606608
endpos = end64pos;
609+
#ifdef USE_MMAP
607610
endhdrlen = ZIP64_ENDHDR;
611+
#endif
608612
}
609613
}
610614

src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -965,29 +965,34 @@ void getNumberPart(const jchar * langtag, const jint numberStyle, WCHAR * number
965965
void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BOOL prefix, WCHAR * ret) {
966966
DWORD pattern = 0;
967967
int style = numberStyle;
968-
int got = 0;
968+
// int got = 0;
969969

970970
if (positive) {
971971
if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_CURRENCY) {
972-
got = getLocaleInfoWrapper(langtag,
972+
// got =
973+
getLocaleInfoWrapper(langtag,
973974
LOCALE_ICURRENCY | LOCALE_RETURN_NUMBER,
974975
(LPWSTR)&pattern, sizeof(pattern));
975976
} else if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_PERCENT) {
976-
got = getLocaleInfoWrapper(langtag,
977+
// got =
978+
getLocaleInfoWrapper(langtag,
977979
LOCALE_IPOSITIVEPERCENT | LOCALE_RETURN_NUMBER,
978980
(LPWSTR)&pattern, sizeof(pattern));
979981
}
980982
} else {
981983
if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_CURRENCY) {
982-
got = getLocaleInfoWrapper(langtag,
984+
// got =
985+
getLocaleInfoWrapper(langtag,
983986
LOCALE_INEGCURR | LOCALE_RETURN_NUMBER,
984987
(LPWSTR)&pattern, sizeof(pattern));
985988
} else if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_PERCENT) {
986-
got = getLocaleInfoWrapper(langtag,
989+
// got =
990+
getLocaleInfoWrapper(langtag,
987991
LOCALE_INEGATIVEPERCENT | LOCALE_RETURN_NUMBER,
988992
(LPWSTR)&pattern, sizeof(pattern));
989993
} else {
990-
got = getLocaleInfoWrapper(langtag,
994+
// got =
995+
getLocaleInfoWrapper(langtag,
991996
LOCALE_INEGNUMBER | LOCALE_RETURN_NUMBER,
992997
(LPWSTR)&pattern, sizeof(pattern));
993998
}

src/java.base/windows/native/libjava/TimeZone_md.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
232232
WCHAR stdNameInReg[MAX_ZONE_CHAR];
233233
TziValue tempTzi;
234234
WCHAR *stdNamePtr = tzi.StandardName;
235-
int onlyMapID;
235+
// int onlyMapID;
236236

237237
timeType = GetTimeZoneInformation(&tzi);
238238
if (timeType == TIME_ZONE_ID_INVALID) {
@@ -304,7 +304,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
304304
* Compare to the "Std" value of each subkey and find the entry that
305305
* matches the current control panel setting.
306306
*/
307-
onlyMapID = 0;
307+
// onlyMapID = 0;
308308
for (i = 0; i < nSubKeys; ++i) {
309309
DWORD size = sizeof(subKeyName);
310310
ret = RegEnumKeyEx(hKey, i, subKeyName, &size, NULL, NULL, NULL, NULL);
@@ -325,7 +325,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
325325
* entry in the Time Zones registry.
326326
*/
327327
RegCloseKey(hSubKey);
328-
onlyMapID = 1;
328+
// onlyMapID = 1;
329329
ret = RegOpenKeyExW(hKey, stdNamePtr, 0, KEY_READ, (PHKEY)&hSubKey);
330330
if (ret != ERROR_SUCCESS) {
331331
goto err;

src/java.base/windows/native/libnet/NTLMAuthSequence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static jfieldID ntlm_ctxHandleID;
4747
static jfieldID ntlm_crdHandleID;
4848
static jfieldID status_seqCompleteID;
4949

50-
static HINSTANCE lib = NULL;
50+
// static HINSTANCE lib = NULL;
5151

5252
JNIEXPORT void JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequence_initFirst
5353
(JNIEnv *env, jclass authseq_clazz, jclass status_clazz)

0 commit comments

Comments
 (0)