Repository navigation
Closed
Labels
Description
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.
Activity
CDanU commentedon Jul 11, 2017
I haven't gone through all issues yet but it seems a bunch of them is related to indentions.
While tying to solve #1218 I made this branch: code_width. Contrary to the name the goal was to fix the width for func call params. The solution works somewhat better but fights with the rest of the code inside indent.cpp (mainly everything that gets done by uncrustify.cpp - indent_text() - L1890-L1907)
mihaipopescu commentedon Jul 11, 2017
Yes, a quite a few are double indentation related but they are different. We're not using
code_widthat all. You think it's the same code that deals with width of func call params ? What is the option for that ?CDanU commentedon Jul 11, 2017
Ohh ok, I saw the function call and thought of the the code I wrote. No the changes I had made are only triggered when
code_widthis violated. But the problems here most likely are still caused byindent_text()(it is also called a few lines above the mentioned ones).guy-maurel commentedon Jul 13, 2017
Please push Uncrustify.Common-Cpp.cfg
guy-maurel commentedon Jul 13, 2017
Should it be controlled by the option
use_indent_continue_only_once = true?CDanU commentedon Jul 13, 2017
We have both configs in the repo:
Uncrustify.Common-CStyle.cfg
Uncrustify.Common-Cpp.cfg
mihaipopescu commentedon Jul 13, 2017
Yeah, I noticed that they're missing and I started to reduce the configs but didn't finished that so I pushed it like this. But, as mentioned in the main discussion thread #1223 the config can be extracted from the dump
.uncfile.CDanU commentedon Jul 14, 2017
Caused by:
mihaipopescu commentedon Jul 14, 2017
Cool! Are you finding these with the option reducer ?
CDanU commentedon Jul 14, 2017
No, I just paste the config in my webtool, manually reduce the config in halve and check the output until I find the problem. I could use the option reducer as a prefilter, but I am faster just copy and pasting it.
Most of the config can be removed if I already know that the problem is not about spaces or newlines.
Fixes issue uncrustify#1260 uncrustify#1268 uncrustify#1277
Fixes issue uncrustify#1260 uncrustify#1268 uncrustify#1277
Fixes issue uncrustify#1260 uncrustify#1268 uncrustify#1277
Merge pull request #31 from Unity-Technologies/fixes/extra-indentatio…
gmaurel commentedon Jan 22, 2018
Fixed at 2c412d8, Dec 17 18:33:16 2017