Cleanup: use header guards

This commit is contained in:
Campbell Barton 2019-09-13 21:12:26 +10:00
parent 9e60e86057
commit f795bdbf21
26 changed files with 124 additions and 41 deletions

View File

@ -16,8 +16,9 @@
* The Original Code is Copyright (C) 2019 by Blender Foundation
* All rights reserved.
*/
#ifndef __BKE_REMESH_H__
#define __BKE_REMESH_H__
#ifndef __BKE_MESH_REMESH_VOXEL_H__
#define __BKE_MESH_REMESH_VOXEL_H__
/** \file
* \ingroup bke
@ -51,4 +52,4 @@ struct Mesh *BKE_mesh_remesh_quadriflow_to_mesh_nomain(struct Mesh *mesh,
/* Data reprojection functions */
void BKE_remesh_reproject_paint_mask(struct Mesh *target, struct Mesh *source);
#endif /* __BKE_REMESH_H__ */
#endif /* __BKE_MESH_REMESH_VOXEL_H__ */

View File

@ -13,6 +13,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_ALLOCATOR_H__
#define __BLI_ALLOCATOR_H__
/** \file
* \ingroup bli
@ -27,8 +29,6 @@
* job good enough.
*/
#pragma once
#include <stdlib.h>
#include "MEM_guardedalloc.h"
@ -125,3 +125,5 @@ class TemporaryAllocator {
};
} // namespace BLI
#endif /* __BLI_ALLOCATOR_H__ */

View File

@ -13,6 +13,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_ARRAY_CXX_H__
#define __BLI_ARRAY_CXX_H__
/** \file
* \ingroup bli
@ -21,8 +23,6 @@
* a template argument. Instead it can be specified at the construction time.
*/
#pragma once
#include "BLI_utildefines.h"
#include "BLI_allocator.h"
#include "BLI_array_ref.h"
@ -193,3 +193,5 @@ template<typename T, typename Allocator = GuardedAllocator> class Array {
template<typename T> using TemporaryArray = Array<T, TemporaryAllocator>;
} // namespace BLI
#endif /* __BLI_ARRAY_CXX_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_ARRAY_REF_H__
#define __BLI_ARRAY_REF_H__
/** \file
* \ingroup bli
*
@ -32,8 +35,6 @@
* Since array references do not own any memory, it is generally not save to store them.
*/
#pragma once
#include <vector>
#include <array>
#include <algorithm>
@ -421,3 +422,5 @@ template<typename T> ArrayRef<T> ref_c_array(const T *array, uint size)
}
} /* namespace BLI */
#endif /* __BLI_ARRAY_REF_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_HASH_CXX_H__
#define __BLI_HASH_CXX_H__
/** \file
* \ingroup bli
*
@ -21,8 +24,6 @@
* used by containers such as Map and Set.
*/
#pragma once
#include <functional>
#include <string>
#include <utility>
@ -98,3 +99,5 @@ template<typename T1, typename T2> struct DefaultHash<std::pair<T1, T2>> {
};
} // namespace BLI
#endif /* __BLI_HASH_CXX_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_INDEX_RANGE_H__
#define __BLI_INDEX_RANGE_H__
/** \file
* \ingroup bli
*
@ -22,8 +25,6 @@
* cases, a separate data structure should be used.
*/
#pragma once
#include <cmath>
#include <algorithm>
#include <iostream>
@ -191,3 +192,5 @@ class IndexRange {
};
} // namespace BLI
#endif /* __BLI_INDEX_RANGE_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_LISTBASE_WRAPPER_H__
#define __BLI_LISTBASE_WRAPPER_H__
/** \file
* \ingroup bli
*
@ -21,8 +24,6 @@
* instances, that are used in many places in Blender.
*/
#pragma once
#include "BLI_listbase.h"
#include "DNA_listBase.h"
@ -95,3 +96,5 @@ template<typename T> class IntrusiveListBaseWrapper {
};
} /* namespace BLI */
#endif /* __BLI_LISTBASE_WRAPPER_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_MAP_H__
#define __BLI_MAP_H__
/** \file
* \ingroup bli
*
@ -23,8 +26,6 @@
* lookups. Keys and values are stored in groups of four to avoid wasting memory due to padding.
*/
#pragma once
#include "BLI_hash_cxx.h"
#include "BLI_array_ref.h"
#include "BLI_open_addressing.h"
@ -619,3 +620,5 @@ template<typename KeyT, typename ValueT, typename Allocator = GuardedAllocator>
#undef ITER_SLOTS_END
} // namespace BLI
#endif /* __BLI_MAP_H__ */

View File

@ -14,12 +14,13 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_MEMORY_UTILS_CXX_H__
#define __BLI_MEMORY_UTILS_CXX_H__
/** \file
* \ingroup bli
*/
#pragma once
#include <memory>
#include <algorithm>
@ -79,3 +80,5 @@ template<typename T> void relocate_n(T *src, uint n, T *dst)
}
} // namespace BLI
#endif /* __BLI_MEMORY_UTILS_CXX_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_OPEN_ADDRESSING_H__
#define __BLI_OPEN_ADDRESSING_H__
/** \file
* \ingroup bli
*
@ -28,8 +31,6 @@
* actual hash table implementation.
*/
#pragma once
#include <cmath>
#include "BLI_utildefines.h"
@ -300,3 +301,5 @@ class OpenAddressingArray {
};
} // namespace BLI
#endif /* __BLI_OPEN_ADDRESSING_H__ */

View File

@ -14,14 +14,15 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_SET_H__
#define __BLI_SET_H__
/** \file
* \ingroup bli
*
* This file provides a set implementation that uses open addressing with probing.
*/
#pragma once
#include "BLI_hash_cxx.h"
#include "BLI_open_addressing.h"
#include "BLI_vector.h"
@ -468,3 +469,5 @@ template<typename T, typename Allocator = GuardedAllocator> class Set {
#undef ITER_SLOTS_END
} // namespace BLI
#endif /* __BLI_SET_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_SET_VECTOR_H__
#define __BLI_SET_VECTOR_H__
/** \file
* \ingroup bli
*
@ -22,8 +25,6 @@
* there are no deletes. The expected time to check if a value is in the SetVector is O(1).
*/
#pragma once
#include "BLI_hash_cxx.h"
#include "BLI_open_addressing.h"
#include "BLI_vector.h"
@ -374,3 +375,5 @@ template<typename T, typename Allocator = GuardedAllocator> class SetVector {
#undef ITER_SLOTS_END
} // namespace BLI
#endif /* __BLI_SET_VECTOR_H__ */

View File

@ -14,14 +14,15 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_STACK_CXX_H__
#define __BLI_STACK_CXX_H__
/** \file
* \ingroup bli
*
* Basic stack implementation with support for small object optimization.
*/
#pragma once
#include "BLI_vector.h"
namespace BLI {
@ -140,3 +141,5 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class St
};
} /* namespace BLI */
#endif /* __BLI_STACK_CXX_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_STRING_MAP_H__
#define __BLI_STRING_MAP_H__
/** \file
* \ingroup bli
*
@ -24,8 +27,6 @@
* make it more efficient later on. Also, even if we will never implement this optimization, having
* a special map with string keys can be quite handy. */
#pragma once
#include "BLI_map.h"
#include "BLI_string_ref.h"
#include "BLI_vector.h"
@ -418,3 +419,5 @@ template<typename T, typename Allocator = GuardedAllocator> class StringMap {
#undef ITER_SLOTS_END
} // namespace BLI
#endif /* __BLI_STRING_MAP_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_STRING_REF_H__
#define __BLI_STRING_REF_H__
/** \file
* \ingroup bli
*
@ -25,8 +28,6 @@
* not.
*/
#pragma once
#include <cstring>
#include <string>
#include <sstream>
@ -242,3 +243,5 @@ inline bool StringRefBase::endswith(StringRef suffix) const
}
} // namespace BLI
#endif /* __BLI_STRING_REF_H__ */

View File

@ -14,12 +14,13 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_TEMPORARY_ALLOCATOR_CXX_H__
#define __BLI_TEMPORARY_ALLOCATOR_CXX_H__
/** \file
* \ingroup bli
*/
#pragma once
#include "BLI_temporary_allocator.h"
namespace BLI {
@ -33,3 +34,5 @@ template<typename T> MutableArrayRef<T> temporary_allocate_array(uint size)
}
}; // namespace BLI
#endif /* __BLI_TEMPORARY_ALLOCATOR_CXX_H__ */

View File

@ -14,6 +14,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BLI_VECTOR_H__
#define __BLI_VECTOR_H__
/** \file
* \ingroup bli
*
@ -22,8 +25,6 @@
* performed. Instead, those elements are stored directly in the vector.
*/
#pragma once
#include <algorithm>
#include <cstdlib>
#include <cstring>
@ -599,3 +600,5 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
template<typename T, uint N = 4> using TemporaryVector = Vector<T, N, TemporaryAllocator>;
} /* namespace BLI */
#endif /* __BLI_VECTOR_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2011, Blender Foundation.
*/
#ifndef __COM_IMAGENODE_H__
#define __COM_IMAGENODE_H__
#include "COM_defines.h"
#include "COM_Node.h"
#include "DNA_node_types.h"
@ -44,3 +47,5 @@ class ImageNode : public Node {
ImageNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_IMAGENODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2012, Blender Foundation.
*/
#ifndef __COM_KEYINGNODE_H__
#define __COM_KEYINGNODE_H__
#include "COM_Node.h"
/**
@ -55,3 +58,5 @@ class KeyingNode : public Node {
KeyingNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_KEYINGNODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2012, Blender Foundation.
*/
#ifndef __COM_KEYINGSCREENNODE_H__
#define __COM_KEYINGSCREENNODE_H__
#include "COM_Node.h"
#include "DNA_node_types.h"
@ -28,3 +31,5 @@ class KeyingScreenNode : public Node {
KeyingScreenNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_KEYINGSCREENNODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2013, Blender Foundation.
*/
#ifndef __COM_PLANETRACKDEFORMNODE_H__
#define __COM_PLANETRACKDEFORMNODE_H__
#include "COM_Node.h"
extern "C" {
@ -32,3 +35,5 @@ class PlaneTrackDeformNode : public Node {
PlaneTrackDeformNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_PLANETRACKDEFORMNODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2011, Blender Foundation.
*/
#ifndef __COM_RENDERLAYERSNODE_H__
#define __COM_RENDERLAYERSNODE_H__
#include "COM_Node.h"
#include "DNA_node_types.h"
#include "COM_RenderLayersProg.h"
@ -46,3 +49,5 @@ class RenderLayersNode : public Node {
void missingSocketLink(NodeConverter &converter, NodeOutput *output) const;
void missingRenderLink(NodeConverter &converter) const;
};
#endif /* __COM_RENDERLAYERSNODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2011, Blender Foundation.
*/
#ifndef __COM_TEXTURENODE_H__
#define __COM_TEXTURENODE_H__
#include "COM_Node.h"
#include "DNA_node_types.h"
@ -28,3 +31,5 @@ class TextureNode : public Node {
TextureNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_TEXTURENODE_H__ */

View File

@ -16,6 +16,9 @@
* Copyright 2012, Blender Foundation.
*/
#ifndef __COM_TRACKPOSITIONNODE_H__
#define __COM_TRACKPOSITIONNODE_H__
#include "COM_Node.h"
#include "DNA_node_types.h"
@ -28,3 +31,5 @@ class TrackPositionNode : public Node {
TrackPositionNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif /* __COM_TRACKPOSITIONNODE_H__ */

View File

@ -19,8 +19,8 @@
* Stefan Werner
*/
#ifndef __COM_DENOISEBASEOPERATION_H__
#define __COM_DENOISEBASEOPERATION_H__
#ifndef __COM_DENOISEOPERATION_H__
#define __COM_DENOISEOPERATION_H__
#include "COM_SingleThreadedOperation.h"
#include "DNA_node_types.h"
@ -68,4 +68,5 @@ class DenoiseOperation : public SingleThreadedOperation {
MemoryBuffer *createMemoryBuffer(rcti *rect);
};
#endif
#endif /* __COM_DENOISEOPERATION_H__ */

View File

@ -20,8 +20,8 @@
* \ingroup draw
*/
#ifndef __DRAW_CACHE_EXTRACT_MESH_H__
#define __DRAW_CACHE_EXTRACT_MESH_H__
#ifndef __DRAW_CACHE_EXTRACT_H__
#define __DRAW_CACHE_EXTRACT_H__
/* Vertex Group Selection and display options */
typedef struct DRW_MeshWeightState {
@ -253,4 +253,4 @@ void mesh_buffer_cache_create_requested(MeshBatchCache *cache,
const ToolSettings *ts,
const bool use_hide);
#endif /* __DRAW_CACHE_EXTRACT_MESH_H__ */
#endif /* __DRAW_CACHE_EXTRACT_H__ */