Use nullptr instead of NULL#2487
Conversation
* ACE/ace/Activation_Queue.cpp:
* ACE/ace/Future.cpp:
* ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h:
* ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h:
* ACE/tests/Network_Adapters_Test.cpp:
* TAO/tests/Bug_2234_Regression/server.cpp:
* TAO/tests/MProfile_Forwarding/client.cpp:
WalkthroughThis PR modernizes the codebase by replacing "NULL" with "nullptr" in debug messages, error output, and documentation strings across ACE and TAO libraries. Additionally, it removes associated FUZZ preprocessor directives and eliminates a NULL macro definition from a platform-specific header file. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
ACE/tests/Network_Adapters_Test.cpp (1)
213-217: Reactor nullptr message is fine; consider aligning remaining "NULL" stringsThe updated error in the multi-remote
Echo_Handler::open()correctly mentions anullptrreactor pointer; behavior is unchanged and looks good.For consistency with the PR goal and within this file, you may want to also:
- Update the earlier
Echo_Handler::open()overload’s"NULL pointer to reactor provided.\n"message to saynullptr.- Optionally modernize other diagnostics that still say
"NULL ... pointer"/"NULL reactor"(e.g., the"NULL remote_addr pointer provided.\n","NULL check_handler.\n", and"NULL reactor.\n"messages).All of these are cosmetic; no functional issue if left as-is.
Also applies to: 138-142, 222-226, 758-771
ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h (1)
117-121: http_status nullptr documentation is correct; small remaining NULL mentionThe updated
http_statuscomment correctly documents that passingnullptrforrtriggers lookup of a default reason phrase; no API change.For consistency with the rest of this header and the PR’s nullptr migration, you might optionally also change the later comment:
If you want either prefix or suffix to be skipped, use "" instead of NULL.to say
nullptrinstead ofNULL, or rephrase it in terms of “null pointer”, depending on how you want to present the C vs C++ story here.Also applies to: 157-162
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
ACE/ace/Activation_Queue.cpp(1 hunks)ACE/ace/Future.cpp(1 hunks)ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h(1 hunks)ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h(0 hunks)ACE/tests/Network_Adapters_Test.cpp(1 hunks)TAO/tests/Bug_2234_Regression/server.cpp(4 hunks)TAO/tests/MProfile_Forwarding/client.cpp(1 hunks)
💤 Files with no reviewable changes (1)
- ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-02-11T10:00:08.023Z
Learnt from: jwillemsen
Repo: DOCGroup/ACE_TAO PR: 870
File: ACE/ace/UNIX_Addr.inl:39-39
Timestamp: 2025-02-11T10:00:08.023Z
Learning: In ACE_UNIX_Addr's equality operator, the comparison length should be sizeof(sun_path) - 1 to exclude the null terminator, not i. For Linux abstract paths, i is used to skip the first character (i=1) when both paths are empty, but the -1 is still needed to handle the null terminator correctly.
Applied to files:
TAO/tests/Bug_2234_Regression/server.cpp
📚 Learning: 2025-02-11T10:00:08.023Z
Learnt from: jwillemsen
Repo: DOCGroup/ACE_TAO PR: 870
File: ACE/ace/UNIX_Addr.inl:39-39
Timestamp: 2025-02-11T10:00:08.023Z
Learning: In ACE_UNIX_Addr's equality operator, the comparison length should be sizeof(sun_path) - 1 to exclude the null terminator. For Linux abstract paths, while i=1 is used to skip the first character, using i instead of -1 in the length calculation would be incorrect as it would either include the null terminator (for regular paths) or miss the last valid character (for abstract paths).
Applied to files:
TAO/tests/Bug_2234_Regression/server.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
TAO/tests/MProfile_Forwarding/client.cpp (1)
50-55: Updated objref null diagnostic looks goodLog text now correctly mentions
nullptr; behavior and null check remain unchanged and correct.ACE/ace/Activation_Queue.cpp (1)
25-30: dump() output now consistent with nullptr usage
ACE_Activation_Queue::dump()now reports(nullptr)whenqueue_is null; this is consistent with the rest of the codebase and purely cosmetic.TAO/tests/Bug_2234_Regression/server.cpp (1)
100-105: String-parameter nullptr diagnostics are updated and clearAll four messages now explicitly mention
nullptrin the null-string cases for parametersaandc; exception paths and validation logic are unchanged and correct.Also applies to: 116-120, 183-188, 199-203
ACE/ace/Future.cpp (1)
38-43: ACE_Future_Rep::dump() nullptr wording is consistent and correctThe dump now distinguishes
value_being set vs. null using(non-nullptr)and(nullptr); this aligns with modern C++ pointer terminology and does not affect behavior.
Summary by CodeRabbit
Release Notes
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.