Skip to content

Double indentation on C++ initialization arguments #1268

@mihaipopescu

Description

@mihaipopescu
        floatNx3 randomRotationMatrices[3];
        if (rotationRandomnessX > epsilon() || rotationRandomnessY > epsilon())
        {
            floatNx3 rotationEuler = floatNx3(
                    (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessXId)) * 2 - 1) * rotationRandomnessX,
                    (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessYId)) * 2 - 1) * rotationRandomnessY,
                    floatN(ZERO));
            eulerToMatrix(rotationEuler, randomRotationMatrices);

            toForce = mul(randomRotationMatrices, toForce);
        }

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60022-UNI-18439.cpp" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60022-UNI-18439.cpp"
index 8d467c6..446501d 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60022-UNI-18439.cpp"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60022-UNI-18439.cpp"
@@ -1,12 +1,12 @@
 floatNx3 randomRotationMatrices[3];
 if (rotationRandomnessX > epsilon() || rotationRandomnessY > epsilon())
 {
 // Parameters are being double indented.
     floatNx3 rotationEuler = floatNx3(
-        (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessXId)) * 2 - 1) * rotationRandomnessX,
-        (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessYId)) * 2 - 1) * rotationRandomnessY,
-        floatN(ZERO));
+            (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessXId)) * 2 - 1) * rotationRandomnessX,
+            (GenerateRandom(randomSeed + intN(kParticleSystemExternalForcesRotationRandomnessYId)) * 2 - 1) * rotationRandomnessY,
+            floatN(ZERO));
     eulerToMatrix(rotationEuler, randomRotationMatrices);
 
     toForce = mul(randomRotationMatrices, toForce);
 }

Debug support files:

60022-UNI-18439.cpp
60022-UNI-18439.cpp.log
60022-UNI-18439.cpp.unc
Uncrustify.Cpp.cfg
UNI-18439.cpp

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions