Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Dec 2, 2025

  • Used clang-tidy to consistently change NULL->nullptr
  • Added include for cppMacros to files that use nullptr and didn't have it (required for VC6)

Tested build and played a game successfully.

A Follow up PR can:

  • clean up the #define NULL 0
  • replace remaining NULLs with 0 (or a named

@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch from 5903988 to af7b405 Compare December 2, 2025 01:12
@bobtista bobtista closed this Dec 4, 2025
@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch from 050b3f0 to e6c28a4 Compare December 4, 2025 17:24
@bobtista bobtista reopened this Dec 4, 2025
@bobtista bobtista marked this pull request as ready for review December 4, 2025 19:35
@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch 7 times, most recently from 149474b to 5f9990b Compare December 5, 2025 04:02
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Adding the CppMacros include everwhere should not be necessary.

* DecalGeneratorClass::Set_Mesh_Transform -- sets the current mesh coordinate system *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

#include <Utility/CppMacros.h>
Copy link

@xezon xezon Dec 5, 2025

Choose a reason for hiding this comment

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

These includes should not be necessary in most cases. The include should come through WWCommon already. If not, then an always.h (WWVegas) or PreRTS.h (GameEngine) include is missing somewhere. GameEngineDevice does not use PreRTS.h there is may be necessary sometimes, but I would expect not in many cases because WWVegas stuff gets always.h

Copy link
Author

@bobtista bobtista Dec 6, 2025

Choose a reason for hiding this comment

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

Good catch, I removed it from files that include always.h, PreRTS.h, and BaseType.h - cleaned up 387 of 395 of them

@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch 2 times, most recently from 13beb77 to 252dac3 Compare December 6, 2025 03:19
@xezon
Copy link

xezon commented Dec 6, 2025

Can you merge the last commit with the first, to see which includes are left over?

@Mauller
Copy link

Mauller commented Dec 6, 2025

If you interactively rebase you should be able to drop the first and last commit entirely during the rebase so you only have the wanted commits left.

@xezon
Copy link

xezon commented Dec 6, 2025

It depends if there are any includes left added. But it is hard to review because github has trouble showing the diff :D

@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch from 252dac3 to fa822b2 Compare December 6, 2025 17:10
@bobtista
Copy link
Author

bobtista commented Dec 6, 2025

Can you merge the last commit with the first, to see which includes are left over?

Done

@xezon
Copy link

xezon commented Dec 7, 2025

This needs another pass because #1594 has added a few new NULL's

@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch from fa822b2 to d88acf7 Compare December 7, 2025 15:12
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

When I search for NULL across whole project, then it finds 20231 NULLs, but this change only touched 8724 NULLs. Why is there this large discrepancy?

@bobtista bobtista force-pushed the bobtista/build/modernize-use-nullptr branch from d88acf7 to f312de3 Compare December 7, 2025 23:12
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