Skip to content

Convert to 'east const' standard for clang-format - #336

Open
Chuck Walbourn (walbourn) wants to merge 2 commits into
mainfrom
eastconstformat
Open

Chuck Walbourn (walbourn) wants to merge 2 commits into
mainfrom
eastconstformat

Conversation

@walbourn

Copy link
Copy Markdown
Collaborator

While the C++ standard suggests const int x as the preferred standard, there are a number of reasons to prefer int const x.

This PR changes the clang-format to use "east const" style.

For more information, see http://slashslash.info/eastconst/

@walbourn

Copy link
Copy Markdown
Collaborator Author

Leaving this as a draft until I clear out some pending PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The east-const formatting update has no active review issues.

No open issues 🎉

What changed in this PR

This PR adopts east-const formatting (T const rather than const T) across DirectXMesh library implementations, utilities, and Meshconvert. The changes preserve existing types and behavior.

Changes:

  • Sets clang-format’s QualifierAlignment to Right.
  • Repositions const in declarations, parameters, return types, and casts throughout the affected C++ files.
File Description
Utilities/​WaveFrontReader.h Reformats reader constants and vertex parameters.
Utilities/​FlexibleVertexFormat.h Reformats vertex-format parameters and constants.
Meshconvert/​MeshOBJ.cpp Reformats OBJ import/export declarations and locals.
Meshconvert/​Meshconvert.cpp Reformats CLI strings, declarations, and constants.
Meshconvert/​Mesh.h Reformats mesh accessors and parameter types.
Meshconvert/​Mesh.cpp Reformats mesh operations and file I/O declarations.
Meshconvert/​CMO.h Reformats the default material declaration.
Meshconvert/​CmdLineHelpers.h Reformats command-line helper types and casts.
DirectXMesh/​scoped.h Reformats allocation sizes and deleted copy operations.
DirectXMesh/​DirectXMeshWeldVertices.cpp Reformats welding callback and point-representation parameters.
DirectXMesh/​DirectXMeshVBWriter.cpp Reformats vertex-buffer writer types and casts.
DirectXMesh/​DirectXMeshVBReader.cpp Reformats vertex-buffer reader types and casts.
DirectXMesh/​DirectXMeshValidate.cpp Reformats validation parameters and constants.
DirectXMesh/​DirectXMeshUtil.cpp Reformats utility parameters and layout constants.
DirectXMesh/​DirectXMeshTangentFrame.cpp Reformats tangent-frame parameters and constants.
DirectXMesh/​DirectXMeshRemap.cpp Reformats remapping parameters, constants, and casts.
DirectXMesh/​DirectXMeshP.h Reformats internal iterator constants and pointers.
DirectXMesh/​DirectXMeshOptimizeTVC.cpp Reformats face-optimization parameters and locals.
DirectXMesh/​DirectXMeshOptimizeLRU.cpp Reformats cache-optimization types and constants.
DirectXMesh/​DirectXMeshOptimize.cpp Reformats sorting and vertex-optimization parameters.
DirectXMesh/​DirectXMeshNormals.cpp Reformats normal-generation parameters and winding constants.
DirectXMesh/​DirectXMeshletGenerator.cpp Reformats meshlet helper types and generation parameters.
DirectXMesh/​DirectXMeshGSAdjacency.cpp Reformats geometry-shader adjacency parameters and constants.
DirectXMesh/​DirectXMeshConcat.cpp Reformats face and vertex offset constants.
DirectXMesh/​DirectXMeshClean.cpp Reformats mesh-cleaning constants and attribute parameters.
DirectXMesh/​DirectXMeshAdjacency.cpp Reformats adjacency parameters, constants, and casts.
.github/​linters/​.clang-format Enables right-aligned qualifiers for east-const formatting.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants