Skip to content

Conversation

@NiceAndPeter
Copy link
Owner

Replaced ~583 occurrences of NULL with nullptr in 51 C++ source files, following modern C++11 best practices for improved type safety.

Changes:

  • Converted all NULL to nullptr in src/ directory (51 files)
  • Preserved NULL in public C API headers (include/lua.h, src/auxiliary/lauxlib.h)
  • Zero semantic changes - pure mechanical text replacement

Performance:

  • Baseline: 4.20s average
  • After nullptr: 4.26s average (5 runs: 4.48, 4.21, 4.37, 4.09, 4.15)
  • Target: ≤4.33s (3% tolerance)
  • Status: ✅ PASS - within tolerance

Testing:

  • All tests passing: "final OK !!!"
  • Zero compilation errors or warnings
  • Full backward compatibility maintained

Benefits:

  • Type-safe null pointer constant (compile-time type checking)
  • Eliminates NULL macro ambiguity (0 vs pointer)
  • Modern C++11 standard practice
  • Better overload resolution
  • Zero performance impact

Replaced ~583 occurrences of NULL with nullptr in 51 C++ source files,
following modern C++11 best practices for improved type safety.

Changes:
- Converted all NULL to nullptr in src/ directory (51 files)
- Preserved NULL in public C API headers (include/lua.h, src/auxiliary/lauxlib.h)
- Zero semantic changes - pure mechanical text replacement

Performance:
- Baseline: 4.20s average
- After nullptr: 4.26s average (5 runs: 4.48, 4.21, 4.37, 4.09, 4.15)
- Target: ≤4.33s (3% tolerance)
- Status: ✅ PASS - within tolerance

Testing:
- All tests passing: "final OK !!!"
- Zero compilation errors or warnings
- Full backward compatibility maintained

Benefits:
- Type-safe null pointer constant (compile-time type checking)
- Eliminates NULL macro ambiguity (0 vs pointer)
- Modern C++11 standard practice
- Better overload resolution
- Zero performance impact
@NiceAndPeter NiceAndPeter merged commit 17291bf into main Nov 21, 2025
18 of 19 checks passed
@NiceAndPeter NiceAndPeter deleted the claude/modernize-nu-01WwycWxne9VSgahxUfqsWm1 branch November 21, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants