Fix clang-format differences between version 6 and 9

Version 6 does not appear to respect clang-format off for header sorting.
This commit is contained in:
Brecht Van Lommel 2020-04-21 12:39:12 +02:00
parent c73d6162be
commit 5fed9ac9b5
41 changed files with 88 additions and 152 deletions

View File

@ -27,8 +27,9 @@
# define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <ctype.h>
#include <errno.h>
#include "BLI_fnmatch.h"

View File

@ -30,7 +30,9 @@
bool BLI_file_alias_target(char targetpath[FILE_MAXDIR], const char *filepath)
{
/* clang-format off */
@autoreleasepool {
/* clang-format on */
NSError *error = nil;
NSURL *shortcutURL = [[NSURL alloc] initFileURLWithFileSystemRepresentation:filepath
isDirectory:NO
@ -64,7 +66,9 @@ eFileAttributes BLI_file_attributes(const char *path)
{
int ret = 0;
/* clang-format off */
@autoreleasepool {
/* clang-format on */
NSURL *fileURL = [[NSURL alloc] initFileURLWithFileSystemRepresentation:path
isDirectory:NO
relativeToURL:nil];

View File

@ -1,26 +1,27 @@
/* Pre-compiled headers, see: D2606. */
/* clang-format off */
#include <Python.h>
#include <pthread.h>
#include <string>
#include <vector>
#include <iostream>
#include <math.h>
#include <stdbool.h>
#include <algorithm>
#include <time.h>
#include <iterator>
#include <memory>
#include <set>
#include <map>
#include <list>
#include <deque>
#include <sstream>
#include <stdarg.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <pthread.h>
#include <set>
#include <sstream>
#include <stack>
#include <stdarg.h>
#include <stdbool.h>
#include <string>
#include <time.h>
#include <vector>
#include "intern/python/BPy_BBox.h"
#include "intern/python/BPy_BinaryPredicate0D.h"
#include "intern/python/BPy_BinaryPredicate1D.h"
@ -47,5 +48,3 @@
#include "intern/python/BPy_ViewMap.h"
#include "intern/python/BPy_ViewShape.h"
#include "intern/python/Director.h"
/* clang-format on */

View File

@ -18,18 +18,17 @@
* \ingroup freestyle
*/
/* clang-format off */
#include "Controller.h"
#include "AppView.h"
#include "../image/Image.h"
#include "../system/TimeStamp.h"
#include "../stroke/StrokeRenderer.h"
#include "AppCanvas.h"
#include "AppConfig.h"
#include "AppView.h"
#include "Controller.h"
#include "../image/Image.h"
#include "../stroke/StrokeRenderer.h"
#include "../stroke/StyleModule.h"
#include "../system/TimeStamp.h"
#include "../system/StringUtils.h"
/* clang-format on */
namespace Freestyle {
AppCanvas::AppCanvas() : Canvas()

View File

@ -22,15 +22,14 @@
* \brief Configuration file
*/
/* clang-format off */
#include <string>
#include <algorithm>
#include <string>
#include "../system/Precision.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
using namespace std;

View File

@ -18,20 +18,20 @@
* \ingroup freestyle
*/
/* clang-format off */
#include <iostream>
#include "Controller.h"
#include "AppConfig.h"
#include "AppView.h"
#include "../view_map/Silhouette.h"
#include "../view_map/ViewMap.h"
#include "Controller.h"
#include "../scene_graph/LineRep.h"
#include "../scene_graph/NodeLight.h"
#include "../scene_graph/NodeShape.h"
#include "../scene_graph/VertexRep.h"
#include "../stroke/Canvas.h"
#include "../system/StringUtils.h"
#include "../view_map/Silhouette.h"
#include "../view_map/ViewMap.h"
extern "C" {
#include "BLI_blenlib.h"
@ -46,7 +46,6 @@ extern "C" {
#include "FRS_freestyle.h"
}
/* clang-format on */
namespace Freestyle {

View File

@ -21,10 +21,10 @@
* \ingroup freestyle
*/
/* clang-format off */
#include "AppConfig.h"
#include "../geometry/Geom.h"
#include "../geometry/BBox.h"
#include "../geometry/Geom.h"
#include "../scene_graph/NodeDrawingStyle.h"
#include "../system/Precision.h"
@ -33,7 +33,6 @@
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -18,18 +18,17 @@
* \ingroup freestyle
*/
/* clang-format off */
extern "C" {
#include <Python.h>
}
#include <string>
#include <fstream>
#include <float.h>
#include <fstream>
#include <string>
#include "AppView.h"
#include "AppCanvas.h"
#include "AppConfig.h"
#include "AppView.h"
#include "Controller.h"
#include "../image/Image.h"
@ -42,12 +41,12 @@ extern "C" {
#include "../scene_graph/VertexRep.h"
#include "../stroke/PSStrokeRenderer.h"
#include "../stroke/TextStrokeRenderer.h"
#include "../stroke/StrokeTesselator.h"
#include "../stroke/StyleModule.h"
#include "../stroke/TextStrokeRenderer.h"
#include "../system/StringUtils.h"
#include "../system/PythonInterpreter.h"
#include "../system/StringUtils.h"
#include "../view_map/SteerableViewMap.h"
#include "../view_map/ViewMap.h"
@ -56,21 +55,20 @@ extern "C" {
#include "../winged_edge/Curvature.h"
#include "../winged_edge/WEdge.h"
#include "../winged_edge/WingedEdgeBuilder.h"
#include "../winged_edge/WXEdgeBuilder.h"
#include "../winged_edge/WingedEdgeBuilder.h"
#include "../blender_interface/BlenderFileLoader.h"
#include "../blender_interface/BlenderStrokeRenderer.h"
#include "../blender_interface/BlenderStyleModule.h"
#include "BKE_global.h"
#include "BLI_utildefines.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "DNA_freestyle_types.h"
#include "FRS_freestyle.h"
/* clang-format off */
namespace Freestyle {

View File

@ -21,9 +21,8 @@
* \ingroup freestyle
*/
/* clang-format off */
#include <string.h>
#include <float.h>
#include <string.h>
#include "../geometry/BBox.h"
#include "../geometry/Geom.h"
@ -31,8 +30,8 @@
#include "../geometry/GeomUtils.h"
#include "../scene_graph/IndexedFaceSet.h"
#include "../scene_graph/NodeGroup.h"
#include "../scene_graph/NodeTransform.h"
#include "../scene_graph/NodeShape.h"
#include "../scene_graph/NodeTransform.h"
#include "../system/FreestyleConfig.h"
#include "../system/RenderMonitor.h"
@ -64,7 +63,6 @@ extern "C" {
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -18,7 +18,6 @@
* \ingroup freestyle
*/
/* clang-format off */
#include "BlenderStrokeRenderer.h"
#include "../application/AppConfig.h"
@ -68,7 +67,6 @@ extern "C" {
}
#include <limits.h>
/* clang-format on */
namespace Freestyle {

View File

@ -22,16 +22,14 @@
* \brief A class to hold a bounding box
*/
/* clang-format off */
#include <stdlib.h>
#include <algorithm>
#include <stdlib.h>
#include "BLI_utildefines.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -20,13 +20,11 @@
* \brief from "Graphics Gems", Academic Press, 1990
*/
/* clang-format off */
#include <cstdlib> // for malloc and free
#include <stdio.h>
#include <math.h>
#include <stdio.h>
#include "FitCurve.h"
/* clang-format on */
using namespace std;

View File

@ -19,7 +19,6 @@
* \brief Class to define a cleaner of geometry providing a set of useful tools
*/
/* clang-format off */
#if 0
# if defined(__GNUC__) && (__GNUC__ >= 3)
// hash_map is not part of the C++ standard anymore;
@ -30,16 +29,15 @@
# endif
#endif
#include <stdio.h>
#include <list>
#include <map>
#include <stdio.h>
#include "GeomCleaner.h"
#include "../system/TimeUtils.h"
#include "BKE_global.h"
/* clang-format on */
using namespace std;

View File

@ -29,10 +29,8 @@
* \ingroup freestyle
*/
/* clang-format off */
#include "matrix_util.h"
#include "normal_cycle.h"
/* clang-format on */
#include "matrix_util.h"
namespace Freestyle {

View File

@ -19,7 +19,6 @@
* \brief Class to define a canvas designed to draw style modules
*/
/* clang-format off */
#include <sstream>
#include <vector>
@ -27,13 +26,13 @@
#include "StrokeRenderer.h"
#include "StyleModule.h"
#include "../image/Image.h"
#include "../image/GaussianFilter.h"
#include "../image/Image.h"
#include "../image/ImagePyramid.h"
#include "../system/FreestyleConfig.h"
#include "../system/TimeStamp.h"
#include "../system/PseudoNoise.h"
#include "../system/TimeStamp.h"
#include "../view_map/SteerableViewMap.h"
@ -46,7 +45,6 @@ extern "C" {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
}
/* clang-format on */
using namespace std;

View File

@ -19,12 +19,10 @@
* \brief Class to define a chain of viewedges.
*/
/* clang-format off */
#include "Chain.h"
#include "../view_map/ViewMapIterators.h"
#include "../view_map/ViewMapAdvancedIterators.h"
/* clang-format on */
#include "../view_map/ViewMapIterators.h"
namespace Freestyle {

View File

@ -22,7 +22,6 @@
* \brief Chaining iterators
*/
/* clang-format off */
#include <iostream>
#include "Predicates1D.h"
@ -30,9 +29,8 @@
#include "../system/Iterator.h"
#include "../view_map/ViewMap.h"
#include "../view_map/ViewMapIterators.h"
#include "../view_map/ViewMapAdvancedIterators.h"
/* clang-format on */
#include "../view_map/ViewMapIterators.h"
// using namespace ViewEdgeInternal;

View File

@ -19,16 +19,14 @@
* \brief Class to define a container for curves
*/
/* clang-format off */
#include <stdio.h> /* printf */
#include "Curve.h"
#include "CurveIterators.h"
#include "CurveAdvancedIterators.h"
#include "CurveIterators.h"
#include "BKE_global.h"
#include "BLI_utildefines.h"
/* clang-format on */
namespace Freestyle {

View File

@ -19,18 +19,16 @@
* \brief Class gathering stroke creation algorithms
*/
/* clang-format off */
#include <algorithm>
#include <stdexcept>
#include "Operators.h"
#include "Canvas.h"
#include "CurveIterators.h"
#include "Operators.h"
#include "Stroke.h"
#include "StrokeIterators.h"
#include "CurveIterators.h"
#include "BKE_global.h"
/* clang-format on */
namespace Freestyle {

View File

@ -19,10 +19,8 @@
* \brief Class to define the Postscript rendering of a stroke
*/
/* clang-format off */
#include "Canvas.h"
#include "PSStrokeRenderer.h"
/* clang-format on */
#include "Canvas.h"
namespace Freestyle {

View File

@ -22,20 +22,18 @@
* \brief Class gathering stroke creation algorithms
*/
/* clang-format off */
#include <string>
#include "AdvancedFunctions1D.h"
#include "../system/TimeStamp.h"
#include "../view_map/Interface1D.h"
#include "../view_map/Functions1D.h"
#include "../view_map/Interface1D.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -19,15 +19,13 @@
* \brief Classes to define a stroke
*/
/* clang-format off */
#include "Stroke.h"
#include "StrokeIterators.h"
#include "StrokeAdvancedIterators.h"
#include "StrokeIterators.h"
#include "StrokeRenderer.h"
#include "BKE_global.h"
#include "BKE_node.h"
/* clang-format on */
namespace Freestyle {

View File

@ -19,11 +19,9 @@
* \brief Class to define a layer of strokes.
*/
/* clang-format off */
#include "StrokeLayer.h"
#include "Canvas.h"
#include "Stroke.h"
#include "StrokeLayer.h"
/* clang-format on */
namespace Freestyle {

View File

@ -22,10 +22,9 @@
* \brief Classes to render a stroke with OpenGL
*/
/* clang-format off */
#include <algorithm>
#include <map>
#include <string.h>
#include <algorithm>
#include <utility>
#include <vector>
@ -37,7 +36,6 @@
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -19,15 +19,13 @@
* \brief Class to define the representation of a stroke (for display purpose)
*/
/* clang-format off */
#include "Stroke.h"
#include "StrokeIterators.h"
#include "StrokeAdvancedIterators.h"
#include "StrokeRenderer.h"
#include "StrokeRep.h"
#include "Stroke.h"
#include "StrokeAdvancedIterators.h"
#include "StrokeIterators.h"
#include "StrokeRenderer.h"
#include "BKE_global.h"
/* clang-format on */
using namespace std;

View File

@ -19,14 +19,12 @@
* \brief Class to build a Node Tree designed to be displayed from a set of strokes structure.
*/
/* clang-format off */
#include "StrokeAdvancedIterators.h"
#include "StrokeTesselator.h"
#include "StrokeAdvancedIterators.h"
#include "../scene_graph/OrientedLineRep.h"
#include "../scene_graph/NodeGroup.h"
#include "../scene_graph/NodeShape.h"
/* clang-format on */
#include "../scene_graph/OrientedLineRep.h"
namespace Freestyle {

View File

@ -34,11 +34,11 @@
#ifndef TEXTSTROKERENDERER_H
#define TEXTSTROKERENDERER_H
/* clang-format off */
#include "StrokeRenderer.h"
#include "../system/FreestyleConfig.h"
#include <fstream>
/* clang-format on */
#include "StrokeRenderer.h"
#include "../system/FreestyleConfig.h"
namespace Freestyle {

View File

@ -22,15 +22,14 @@
* \brief Python Interpreter
*/
/* clang-format off */
#include <iostream>
extern "C" {
#include <Python.h>
}
#include "StringUtils.h"
#include "Interpreter.h"
#include "StringUtils.h"
#include "MEM_guardedalloc.h"
@ -49,7 +48,6 @@ extern "C" {
#include "bpy_capi_utils.h"
}
/* clang-format on */
namespace Freestyle {

View File

@ -19,12 +19,10 @@
* \brief String utilities
*/
/* clang-format off */
// soc #include <qfileinfo.h>
#include "FreestyleConfig.h"
#include "StringUtils.h"
/* clang-format on */
#include "FreestyleConfig.h"
namespace Freestyle {

View File

@ -22,7 +22,6 @@
* \brief String utilities
*/
/* clang-format off */
#include <cstring>
#include <iostream>
#include <sstream>
@ -30,10 +29,9 @@
#include <vector>
extern "C" {
#include "BLI_string.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
}
/* clang-format on */
using namespace std;

View File

@ -22,10 +22,9 @@
* \brief Class to define a cell grid surrounding the projected image of a scene
*/
/* clang-format off */
#include <stdexcept>
#include <algorithm>
#include <memory>
#include <stdexcept>
#include "AutoPtrHelper.h"
#include "OccluderSource.h"
@ -37,7 +36,6 @@
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -20,9 +20,8 @@
* implies that this geom engine has as member data the viewpoint, transformations, projections...
*/
/* clang-format off */
#include <cstring>
#include <cstdio>
#include <cstring>
#include "Silhouette.h"
#include "SilhouetteGeomEngine.h"
@ -30,7 +29,6 @@
#include "../geometry/GeomUtils.h"
#include "BKE_global.h"
/* clang-format on */
using namespace std;

View File

@ -24,7 +24,6 @@
#define SPHERICAL_GRID_LOGGING 0
/* clang-format off */
// I would like to avoid using deque because including ViewMap.h and <deque> or <vector> separately
// results in redefinitions of identifiers. ViewMap.h already includes <vector> so it should be a
// safe fall-back.
@ -35,9 +34,9 @@
#include "OccluderSource.h"
#include "ViewMap.h"
#include "../geometry/Polygon.h"
#include "../geometry/BBox.h"
#include "../geometry/GridHelpers.h"
#include "../geometry/Polygon.h"
#include "../system/PointerSequence.h"
@ -48,7 +47,6 @@
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -20,7 +20,6 @@
* to.
*/
/* clang-format off */
#include <sstream>
#include "Silhouette.h"
@ -28,8 +27,8 @@
#include "../geometry/Geom.h"
#include "../image/ImagePyramid.h"
#include "../image/Image.h"
#include "../image/ImagePyramid.h"
#include "BKE_global.h"
#include "BLI_math.h"
@ -38,7 +37,6 @@ extern "C" {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
}
/* clang-format on */
namespace Freestyle {

View File

@ -19,15 +19,13 @@
* \brief Classes to define a View Map (ViewVertex, ViewEdge, etc.)
*/
/* clang-format off */
#include <float.h>
#include "ViewMap.h"
#include "ViewMapIterators.h"
#include "ViewMapAdvancedIterators.h"
#include "ViewMapIterators.h"
#include "../geometry/GeomUtils.h"
/* clang-format on */
namespace Freestyle {

View File

@ -19,11 +19,10 @@
* \brief Class to build silhouette edges from a Winged-Edge structure
*/
/* clang-format off */
#include <algorithm>
#include <memory>
#include <stdexcept>
#include <sstream>
#include <stdexcept>
#include "FRS_freestyle.h"
@ -34,13 +33,12 @@
#include "SphericalGrid.h"
#include "ViewMapBuilder.h"
#include "../geometry/GridHelpers.h"
#include "../geometry/GeomUtils.h"
#include "../geometry/GridHelpers.h"
#include "../winged_edge/WFillGrid.h"
#include "BKE_global.h"
/* clang-format on */
namespace Freestyle {

View File

@ -22,13 +22,12 @@
* \brief Class to build a Node Tree designed to be displayed from a Silhouette View Map structure.
*/
/* clang-format off */
#include "Silhouette.h"
#include "ViewMap.h"
#include "../scene_graph/LineRep.h"
#include "../scene_graph/NodeShape.h"
#include "../scene_graph/NodeGroup.h"
#include "../scene_graph/NodeShape.h"
#include "../scene_graph/OrientedLineRep.h"
#include "../scene_graph/VertexRep.h"
@ -37,7 +36,6 @@
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* clang-format on */
namespace Freestyle {

View File

@ -19,10 +19,8 @@
* \brief Class to fill in a grid from a SceneGraph (uses only the WingedEdge structures)
*/
/* clang-format off */
#include "WEdge.h"
#include "WFillGrid.h"
/* clang-format on */
#include "WEdge.h"
namespace Freestyle {

View File

@ -19,10 +19,8 @@
* \brief Class to fill in a grid from a SceneGraph (uses only the WingedEdge structures)
*/
/* clang-format off */
#include "WEdge.h"
#include "WSFillGrid.h"
/* clang-format on */
#include "WEdge.h"
namespace Freestyle {

View File

@ -20,10 +20,8 @@
* info (silhouette etc...)) structure from a polygonal model
*/
/* clang-format off */
#include "WXEdge.h"
#include "WXEdgeBuilder.h"
/* clang-format on */
#include "WXEdge.h"
namespace Freestyle {

View File

@ -290,12 +290,12 @@ static EnumPropertyItem rna_enum_gpencil_brush_vertex_icons_items[] = {
# include "RNA_access.h"
# include "BKE_colorband.h"
# include "BKE_brush.h"
# include "BKE_icons.h"
# include "BKE_colorband.h"
# include "BKE_gpencil.h"
# include "BKE_paint.h"
# include "BKE_icons.h"
# include "BKE_material.h"
# include "BKE_paint.h"
# include "WM_api.h"