Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: replace NULL for nullptr #25179

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions tools/icu/iculslocs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ int dumpAllButInstalledLocales(int lev,
int list(const char* toBundle) {
UErrorCode status = U_ZERO_ERROR;

FILE* bf = NULL; // NOLINT (readability/null_usage)
FILE* bf = nullptr;

if (toBundle != NULL) { // NOLINT (readability/null_usage)
if (toBundle != nullptr) {
if (VERBOSE) {
printf("writing to bundle %s\n", toBundle);
}
bf = fopen(toBundle, "wb");
if (bf == NULL) { // NOLINT (readability/null_usage)
if (bf == nullptr) {
printf("ERROR: Could not open '%s' for writing.\n", toBundle);
return 1;
}
Expand All @@ -260,15 +260,15 @@ int list(const char* toBundle) {
ASSERT_SUCCESS(&status, "while opening the bundle");
icu::LocalUResourceBundlePointer installedLocales(
// NOLINTNEXTLINE (readability/null_usage)
ures_getByKey(bund.getAlias(), INSTALLEDLOCALES, NULL, &status));
ures_getByKey(bund.getAlias(), INSTALLEDLOCALES, nullptr, &status));
ASSERT_SUCCESS(&status, "while fetching installed locales");

int32_t count = ures_getSize(installedLocales.getAlias());
if (VERBOSE) {
printf("Locales: %d\n", count);
}

if (bf != NULL) { // NOLINT (readability/null_usage)
if (bf != nullptr) {
// write the HEADER
fprintf(bf,
"// NOTE: This file was generated during the build process.\n"
Expand Down Expand Up @@ -312,17 +312,17 @@ int list(const char* toBundle) {

UBool exists;
if (localeExists(key, &exists)) {
if (bf != NULL) fclose(bf); // NOLINT (readability/null_usage)
if (bf != nullptr) fclose(bf);
return 1; // get out.
}
if (exists) {
validCount++;
printf("%s\n", key);
if (bf != NULL) { // NOLINT (readability/null_usage)
if (bf != nullptr) {
fprintf(bf, " %s {\"\"}\n", key);
}
} else {
if (bf != NULL) { // NOLINT (readability/null_usage)
if (bf != nullptr) {
fprintf(bf, "// %s {\"\"}\n", key);
}
if (VERBOSE) {
Expand All @@ -331,7 +331,7 @@ int list(const char* toBundle) {
}
}

if (bf != NULL) { // NOLINT (readability/null_usage)
if (bf != nullptr) {
fprintf(bf, " } // %d/%d valid\n", validCount, count);
// write the HEADER
fprintf(bf, "}\n");
Expand Down Expand Up @@ -373,7 +373,7 @@ int main(int argc, const char* argv[]) {
usage();
return 0;
} else if (!strcmp(arg, "-l")) {
if (list(NULL)) { // NOLINT (readability/null_usage)
if (list(nullptr)) {
return 1;
}
} else if (!strcmp(arg, "-b") && (argsLeft >= 1)) {
Expand Down