Skip to content

Conversation

@tomsons26
Copy link

Cleans up whitespace issues
Fixes inconsistent comments
Makes include order consistent with ZH

@xezon xezon added this to the Code foundation build up milestone Apr 11, 2025
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Unify Unifies code between Generals and Zero Hour Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Apr 11, 2025
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.

I will pause reviewing this change.

The whitespace changes were incorrectly applied to Zero Hour source files. It looks like double spaces have been mass replaced with tabs. This is wrong, because it will affect inline spaces as well. This kind of refactor would need to be done with a script that only looks at leading whitespace and corrects them.

// Because of changes in wind, pressure, etc.
// Those changes are added here, then the


Copy link

Choose a reason for hiding this comment

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

There are 3 blank lines here in ZH :P

CString loopCountText;
loopCountText.Format( "%d", audioEventInfo->m_loopCount );
loopCountEdit->SetWindowText( loopCountText );
}

/// Move data from object to dialog controls
void MapObjectProps::dictToEnabled()
Copy link

Choose a reason for hiding this comment

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

The github diff in this function looks suspiciously broken, which indicates that something is not right.

if ( flagSpikes )
{
if ( Debug_Statistics::Get_Draw_Calls()>2000 )
fprintf( m_fp, " DRAWS OUT OF TOLERANCE(2000)\n" );
Copy link

Choose a reason for hiding this comment

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

Are these fprintf's meant to use tabs in this file!? It seems odd.

DEBUG_LOG((remark));
drawGraph( "@", graphScale, timeNoPart );

sprintf(remark, "Without Spawn %f \n", timeNoSpawn );
Copy link

Choose a reason for hiding this comment

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

2 spaces changed to tab

// Real muzzleHeight = attachTransform.Get_Z_Translation();
// DEBUG_ASSERTCRASH( muzzleHeight > 0.001f, ("YOUR TURRET HAS A VERY LOW PROJECTILE LAUNCH POSITION, BUT FOUND A VALID BONE. DID YOU PICK THE WRONG ONE? %s", launcher->getTemplate()->getName().str()));
// Real muzzleHeight = attachTransform.Get_Z_Translation();
// DEBUG_ASSERTCRASH( muzzleHeight > 0.001f, ("YOUR TURRET HAS A VERY LOW PROJECTILE LAUNCH POSITION, BUT FOUND A VALID BONE. DID YOU PICK THE WRONG ONE? %s", launcher->getTemplate()->getName().str()));
Copy link

Choose a reason for hiding this comment

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

This should not be tabs.

@tomsons26 tomsons26 marked this pull request as draft April 11, 2025 21:03
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 25, 2025
Reverting unification of these files to avoid conflicts with:
- PR TheSuperHackers#654 (tomsons26): Cleans up inconsistencies
- PR TheSuperHackers#670 (zzambers): Replacements for rest of asm code
- PR TheSuperHackers#688 (tomsons26): Backports various things from ZH
- PR TheSuperHackers#1066 (xezon): Prevent AMD/ATI driver crash
- PR TheSuperHackers#1703 (Stubbjax): Add replay archive feature
- PR TheSuperHackers#1741 (Skyaero42): Remove redundant include guards

Files reverted:
- BitFlagsIO.h, DataChunk.h, GameType.h, List.h
- Money.h, Radar.h, Recorder.h, SpecialPowerMaskType.h, StackDump.h
- NameKeyGenerator.cpp, GameCommon.cpp, StackDump.cpp
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 25, 2025
Reverting unification to avoid conflicts with:
- PR TheSuperHackers#654 (tomsons26): Cleans up inconsistencies
- PR TheSuperHackers#688 (tomsons26): Backports various things from ZH

Files reverted: Color.h, Mouse.h, Color.cpp
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 25, 2025
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 25, 2025
Reverting unification to avoid conflicts with:
- PR TheSuperHackers#654 (tomsons26): Cleans up inconsistencies
- PR TheSuperHackers#688 (tomsons26): Backports various things from ZH

Files reverted: Color.h, Mouse.h, Color.cpp
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 26, 2025
Reverting unification of these files to avoid conflicts with:
- PR TheSuperHackers#654 (tomsons26): Cleans up inconsistencies
- PR TheSuperHackers#670 (zzambers): Replacements for rest of asm code
- PR TheSuperHackers#688 (tomsons26): Backports various things from ZH
- PR TheSuperHackers#1066 (xezon): Prevent AMD/ATI driver crash
- PR TheSuperHackers#1703 (Stubbjax): Add replay archive feature
- PR TheSuperHackers#1741 (Skyaero42): Remove redundant include guards

Files reverted:
- BitFlagsIO.h, DataChunk.h, GameType.h, List.h
- Money.h, Radar.h, Recorder.h, SpecialPowerMaskType.h, StackDump.h
- NameKeyGenerator.cpp, GameCommon.cpp, StackDump.cpp
bobtista added a commit to bobtista/GeneralsGameCode that referenced this pull request Oct 26, 2025
Reverting unification to avoid conflicts with:
- PR TheSuperHackers#654 (tomsons26): Cleans up inconsistencies
- PR TheSuperHackers#688 (tomsons26): Backports various things from ZH

Files reverted: Color.h, Mouse.h, Color.cpp
@Skyaero42
Copy link

Is this something that could be automated with clang-tidy? #1807

@tomsons26 tomsons26 closed this Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants