Skip to content

Commit 71107f4

Browse files
committed
8300651: Replace NULL with nullptr in share/runtime/
Reviewed-by: rehn, dholmes
1 parent 3c61d5a commit 71107f4

File tree

112 files changed

+2067
-2067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2067
-2067
lines changed

src/hotspot/share/runtime/abstract_vm_version.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -309,14 +309,14 @@ void Abstract_VM_Version::insert_features_names(char* buf, size_t buflen, const
309309
bool Abstract_VM_Version::print_matching_lines_from_file(const char* filename, outputStream* st, const char* keywords_to_match[]) {
310310
char line[500];
311311
FILE* fp = os::fopen(filename, "r");
312-
if (fp == NULL) {
312+
if (fp == nullptr) {
313313
return false;
314314
}
315315

316316
st->print_cr("Virtualization information:");
317-
while (fgets(line, sizeof(line), fp) != NULL) {
317+
while (fgets(line, sizeof(line), fp) != nullptr) {
318318
int i = 0;
319-
while (keywords_to_match[i] != NULL) {
319+
while (keywords_to_match[i] != nullptr) {
320320
if (strncmp(line, keywords_to_match[i], strlen(keywords_to_match[i])) == 0) {
321321
st->print("%s", line);
322322
break;
@@ -354,8 +354,8 @@ int Abstract_VM_Version::number_of_sockets(void) {
354354
const char* Abstract_VM_Version::cpu_name(void) {
355355
assert(_initialized, "should be initialized");
356356
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
357-
if (NULL == tmp) {
358-
return NULL;
357+
if (nullptr == tmp) {
358+
return nullptr;
359359
}
360360
strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
361361
return tmp;
@@ -364,8 +364,8 @@ const char* Abstract_VM_Version::cpu_name(void) {
364364
const char* Abstract_VM_Version::cpu_description(void) {
365365
assert(_initialized, "should be initialized");
366366
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
367-
if (NULL == tmp) {
368-
return NULL;
367+
if (nullptr == tmp) {
368+
return nullptr;
369369
}
370370
strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
371371
return tmp;

0 commit comments

Comments
 (0)