Explorar o código

[UPDATE] Update the forked clang-format to 4.0

Panagiotis Christopoulos Charitos %!s(int64=8) %!d(string=hai) anos
pai
achega
831cc1dd28
Modificáronse 5 ficheiros con 13 adicións e 14 borrados
  1. 5 2
      .clang-format
  2. 1 1
      src/anki/gr/gl/StateTracker.h
  3. 5 5
      src/anki/util/Visitor.h
  4. 1 5
      tests/gr/Gr.cpp
  5. 1 1
      thirdparty

+ 5 - 2
.clang-format

@@ -36,6 +36,7 @@ BreakBeforeBinaryOperators: NonAssignment
 BreakBeforeBraces: Custom
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializersBeforeComma: true
 BreakConstructorInitializersBeforeComma: true
+BreakStringLiterals: true
 ColumnLimit:     120
 ColumnLimit:     120
 CommentPragmas:  '^ IWYU pragma:'
 CommentPragmas:  '^ IWYU pragma:'
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
@@ -46,7 +47,6 @@ DerivePointerAlignment: false
 DisableFormat:   false
 DisableFormat:   false
 ExperimentalAutoDetectBinPacking: false
 ExperimentalAutoDetectBinPacking: false
 ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
 ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
-IncludeCategories:
 IncludeCategories:
 IncludeCategories:
   - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
   - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
     Priority:        2
     Priority:        2
@@ -54,9 +54,12 @@ IncludeCategories:
     Priority:        3
     Priority:        3
   - Regex:           '.\*'
   - Regex:           '.\*'
     Priority:        1
     Priority:        1
+IncludeIsMainRegex: '$'
 IndentCaseLabels: false
 IndentCaseLabels: false
 IndentWidth:     4
 IndentWidth:     4
 IndentWrappedFunctionNames: false
 IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
 KeepEmptyLinesAtTheStartOfBlocks: true
 KeepEmptyLinesAtTheStartOfBlocks: true
 MacroBlockBegin: ''
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MacroBlockEnd:   ''
@@ -75,6 +78,7 @@ PointerAlignment: Left
 ReflowComments:  true
 ReflowComments:  true
 SortIncludes:    true
 SortIncludes:    true
 SpaceAfterCStyleCast: false
 SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: false
 SpaceBeforeAssignmentOperators: true
 SpaceBeforeAssignmentOperators: true
 SpaceBeforeParens: Never
 SpaceBeforeParens: Never
 SpaceInEmptyParentheses: false
 SpaceInEmptyParentheses: false
@@ -87,6 +91,5 @@ SpacesInSquareBrackets: false
 Standard:        Cpp11
 Standard:        Cpp11
 TabWidth:        4
 TabWidth:        4
 UseTab:          Always
 UseTab:          Always
-SpaceAfterTemplateKeyword: false
 ...
 ...
 
 

+ 1 - 1
src/anki/gr/gl/StateTracker.h

@@ -178,7 +178,7 @@ public:
 			m_stencilFail[0], m_stencilPassDepthFail[0], m_stencilPassDepthPass[0], m_stencilCompare[0]);
 			m_stencilFail[0], m_stencilPassDepthFail[0], m_stencilPassDepthPass[0], m_stencilCompare[0]);
 		enable = enable
 		enable = enable
 			|| !stencilTestDisabled(
 			|| !stencilTestDisabled(
-					 m_stencilFail[1], m_stencilPassDepthFail[1], m_stencilPassDepthPass[1], m_stencilCompare[1]);
+				   m_stencilFail[1], m_stencilPassDepthFail[1], m_stencilPassDepthPass[1], m_stencilCompare[1]);
 
 
 		if(enable != m_stencilTestEnabled)
 		if(enable != m_stencilTestEnabled)
 		{
 		{

+ 5 - 5
src/anki/util/Visitor.h

@@ -59,7 +59,7 @@ struct GetVariadicTypeId
 	template<typename Type>
 	template<typename Type>
 	static constexpr I get()
 	static constexpr I get()
 	{
 	{
-		return sizeof...(Types)-Helper<Type, Types...>::ID - 1;
+		return sizeof...(Types) - Helper<Type, Types...>::ID - 1;
 	}
 	}
 };
 };
 
 
@@ -172,7 +172,7 @@ private:
 	template<typename TVisitor, typename TFirst, typename TSecond, typename... Types_>
 	template<typename TVisitor, typename TFirst, typename TSecond, typename... Types_>
 	void acceptVisitorInternal(TVisitor& v)
 	void acceptVisitorInternal(TVisitor& v)
 	{
 	{
-		constexpr I i = sizeof...(Types) - sizeof...(Types_)-1;
+		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
 		{
 		{
@@ -202,7 +202,7 @@ private:
 	template<typename TVisitor, typename TFirst, typename TSecond, typename... Types_>
 	template<typename TVisitor, typename TFirst, typename TSecond, typename... Types_>
 	void acceptVisitorInternalConst(TVisitor& v) const
 	void acceptVisitorInternalConst(TVisitor& v) const
 	{
 	{
-		constexpr I i = sizeof...(Types) - sizeof...(Types_)-1;
+		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
 		{
 		{
@@ -311,7 +311,7 @@ private:
 	ANKI_USE_RESULT Error acceptVisitorInternal(TVisitor& v)
 	ANKI_USE_RESULT Error acceptVisitorInternal(TVisitor& v)
 	{
 	{
 		Error err = ErrorCode::NONE;
 		Error err = ErrorCode::NONE;
-		constexpr I i = sizeof...(Types) - sizeof...(Types_)-1;
+		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
 		{
 		{
@@ -364,7 +364,7 @@ private:
 	ANKI_USE_RESULT Error acceptVisitorInternalConst(TVisitor& v) const
 	ANKI_USE_RESULT Error acceptVisitorInternalConst(TVisitor& v) const
 	{
 	{
 		Error err = ErrorCode::NONE;
 		Error err = ErrorCode::NONE;
-		constexpr I i = sizeof...(Types) - sizeof...(Types_)-1;
+		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
 		{
 		{

+ 1 - 5
tests/gr/Gr.cpp

@@ -380,11 +380,7 @@ static void createCube(GrManager& gr, BufferPtr& verts, BufferPtr& indices)
 	indices->unmap();
 	indices->unmap();
 }
 }
 
 
-ANKI_TEST(Gr, GrManager)
-{
-	COMMON_BEGIN()
-	COMMON_END()
-}
+ANKI_TEST(Gr, GrManager){COMMON_BEGIN() COMMON_END()}
 
 
 ANKI_TEST(Gr, Shader)
 ANKI_TEST(Gr, Shader)
 {
 {

+ 1 - 1
thirdparty

@@ -1 +1 @@
-Subproject commit 40d7763bfa5b7babad7ad969e0dadddebff930f4
+Subproject commit b5bd7ae5c2d51d1220c5076f17c9adec3f5b46cc