Skip to content

Commit

Permalink
8300651: Replace NULL with nullptr in share/runtime/
Browse files Browse the repository at this point in the history
Reviewed-by: rehn, dholmes
  • Loading branch information
jdksjolen committed Jan 25, 2023
1 parent 3c61d5a commit 71107f4
Show file tree
Hide file tree
Showing 112 changed files with 2,067 additions and 2,067 deletions.
16 changes: 8 additions & 8 deletions src/hotspot/share/runtime/abstract_vm_version.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand Down Expand Up @@ -309,14 +309,14 @@ void Abstract_VM_Version::insert_features_names(char* buf, size_t buflen, const
bool Abstract_VM_Version::print_matching_lines_from_file(const char* filename, outputStream* st, const char* keywords_to_match[]) {
char line[500];
FILE* fp = os::fopen(filename, "r");
if (fp == NULL) {
if (fp == nullptr) {
return false;
}

st->print_cr("Virtualization information:");
while (fgets(line, sizeof(line), fp) != NULL) {
while (fgets(line, sizeof(line), fp) != nullptr) {
int i = 0;
while (keywords_to_match[i] != NULL) {
while (keywords_to_match[i] != nullptr) {
if (strncmp(line, keywords_to_match[i], strlen(keywords_to_match[i])) == 0) {
st->print("%s", line);
break;
Expand Down Expand Up @@ -354,8 +354,8 @@ int Abstract_VM_Version::number_of_sockets(void) {
const char* Abstract_VM_Version::cpu_name(void) {
assert(_initialized, "should be initialized");
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
if (NULL == tmp) {
return NULL;
if (nullptr == tmp) {
return nullptr;
}
strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
return tmp;
Expand All @@ -364,8 +364,8 @@ const char* Abstract_VM_Version::cpu_name(void) {
const char* Abstract_VM_Version::cpu_description(void) {
assert(_initialized, "should be initialized");
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
if (NULL == tmp) {
return NULL;
if (nullptr == tmp) {
return nullptr;
}
strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
return tmp;
Expand Down

1 comment on commit 71107f4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.