Hello,

I am currently using the following format style options with clang-format 
v6.0.0:

---
Language:        Cpp
TabWidth: 3
IndentWidth: 3
ContinuationIndentWidth: 3
IndentCaseLabels: false
BreakBeforeBraces: Custom
BraceWrapping:
  AfterClass: true
  AfterControlStatement: true
  AfterEnum: true
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  AfterUnion: true
  AfterExternBlock: true
  BeforeCatch: true
  BeforeElse: true
...


Here a snippet of my original code, which uses 3-space indents and doesn't look 
to me like it should be changed at all by clang-format:

   for (bin = hashTable->firstBin; bin < end; ++bin)
   {
      printf("%d entries for bin %d:\n",
         (int)bin->nodes, (int)(bin - hashTable->firstBin)); 

      PrintTree(bin->firstNode);
   }

However, clang-format changes the continuation line of printf as shown below.  
Note that it is now indented by 7 spaces from the printf instead of the 3 
spaces I would expect.  In addition, obviously 7 isn't even an integral 
multiple of 3.  Is there something additional I should specify to correct this?

   for (bin = hashTable->firstBin; bin < end; ++bin)
   {
      printf("%d entries for bin %d:\n",
             (int)bin->nodes, (int)(bin - hashTable->firstBin)); 

      PrintTree(bin->firstNode);
   }
   
Thanks,
Ray
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to