Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update namespace formatting #102

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ BraceWrapping:
# AfterEnum: false
# AfterExternBlock: false
# AfterFunction: false
AfterNamespace: true
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
Expand All @@ -77,7 +77,7 @@ BraceWrapping:
# IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
# SplitEmptyNamespace: true
BreakAfterAttributes: Always
BreakAfterJavaFieldAnnotations: true
BreakArrays: false
Expand Down
3 changes: 1 addition & 2 deletions core/type_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ struct TypeInherits {
&& !TypesAreSame<B volatile const, void volatile const>::value;
};

namespace GodotTypeInfo
{
namespace GodotTypeInfo {
enum Metadata {
METADATA_NONE,
METADATA_INT_IS_INT8,
Expand Down
3 changes: 1 addition & 2 deletions drivers/png/png_driver_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <png.h>
#include <string.h>

namespace PNGDriverCommon
{
namespace PNGDriverCommon {

// Print any warnings.
// On error, set explain and return true.
Expand Down
3 changes: 1 addition & 2 deletions drivers/png/png_driver_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "core/image.h"
#include "core/pool_vector.h"

namespace PNGDriverCommon
{
namespace PNGDriverCommon {

// Attempt to load png from buffer (p_source, p_size) into p_image
Error png_to_image(
Expand Down
3 changes: 1 addition & 2 deletions editor/plugins/tile_map_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ void TileMapEditor::_sbox_input(const Ref<InputEvent>& p_ie) {

// Implementation detail of TileMapEditor::_update_palette();
// In modern C++ this could have been inside its body.
namespace
{
namespace {
struct _PaletteEntry {
int id;
String name;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_astar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include <math.h>
#include <stdio.h>

namespace TestAStar
{
namespace TestAStar {

class ABCX : public AStar {
public:
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_astar.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestAStar
{
namespace TestAStar {

MainLoop* test();
} // namespace TestAStar
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_basis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "core/os/os.h"
#include "core/ustring.h"

namespace TestBasis
{
namespace TestBasis {

enum RotOrder {
EulerXYZ,
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_basis.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestBasis
{
namespace TestBasis {
MainLoop* test();
} // namespace TestBasis

Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#include "core/crypto/crypto.h"
#include "core/os/os.h"

namespace TestCrypto
{
namespace TestCrypto {

class _MockCrypto : public Crypto {
virtual PoolByteArray generate_random_bytes(int p_bytes) {
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestCrypto
{
namespace TestCrypto {

MainLoop* test();
} // namespace TestCrypto
Expand Down
6 changes: 2 additions & 4 deletions main/tests/test_gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include "modules/gdscript/gdscript_parser.h"
#include "modules/gdscript/gdscript_tokenizer.h"

namespace TestGDScript
{
namespace TestGDScript {

static void _print_indent(int p_ident, const String& p_text) {
String txt;
Expand Down Expand Up @@ -1139,8 +1138,7 @@ MainLoop* test(TestType p_type) {

#else

namespace TestGDScript
{
namespace TestGDScript {

MainLoop* test(TestType p_type) {
ERR_PRINT(
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_gdscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestGDScript
{
namespace TestGDScript {

enum TestType {
TEST_TOKENIZER,
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
#include "scene/main/scene_tree.h"
#include "scene/main/viewport.h"

namespace TestGUI
{
namespace TestGUI {

class TestMainLoop : public SceneTree {
public:
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestGUI
{
namespace TestGUI {

MainLoop* test();
} // namespace TestGUI
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#include "scene/resources/texture.h"
#include "servers/visual/shader_language.h"

namespace TestMath
{
namespace TestMath {

class GetClassAndNamespace {
String code;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestMath
{
namespace TestMath {

MainLoop* test();
} // namespace TestMath
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_oa_hash_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#include "core/oa_hash_map.h"
#include "core/os/os.h"

namespace TestOAHashMap
{
namespace TestOAHashMap {

struct CountedItem {
static int count;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_oa_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestOAHashMap
{
namespace TestOAHashMap {

MainLoop* test();
} // namespace TestOAHashMap
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_ordered_hash_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include "core/pair.h"
#include "core/vector.h"

namespace TestOrderedHashMap
{
namespace TestOrderedHashMap {

bool test_insert() {
OrderedHashMap<int, int> map;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_ordered_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestOrderedHashMap
{
namespace TestOrderedHashMap {

MainLoop* test();
} // namespace TestOrderedHashMap
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,7 @@ class TestPhysicsMainLoop : public MainLoop {
TestPhysicsMainLoop() {}
};

namespace TestPhysics
{
namespace TestPhysics {

MainLoop* test() {
return memnew(TestPhysicsMainLoop);
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_physics.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestPhysics
{
namespace TestPhysics {

MainLoop* test();
} // namespace TestPhysics
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_physics_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,7 @@ class TestPhysics2DMainLoop : public MainLoop {
TestPhysics2DMainLoop() {}
};

namespace TestPhysics2D
{
namespace TestPhysics2D {

MainLoop* test() {
return memnew(TestPhysics2DMainLoop);
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_physics_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestPhysics2D
{
namespace TestPhysics2D {

MainLoop* test();
} // namespace TestPhysics2D
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

#define OBJECT_COUNT 50

namespace TestRender
{
namespace TestRender {

class TestMainLoop : public MainLoop {
RID test_cube;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestRender
{
namespace TestRender {

MainLoop* test();
} // namespace TestRender
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_shader_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

typedef ShaderLanguage SL;

namespace TestShaderLang
{
namespace TestShaderLang {

static String _mktab(int p_level) {
String tb;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_shader_lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestShaderLang
{
namespace TestShaderLang {

MainLoop* test();
} // namespace TestShaderLang
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include <stdio.h>
#include <wchar.h>

namespace TestString
{
namespace TestString {

bool test_1() {
OS::get_singleton()->print("\n\nTest 1: Assign from cstr\n");
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "core/os/main_loop.h"
#include "core/ustring.h"

namespace TestString
{
namespace TestString {

MainLoop* test();
} // namespace TestString
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

// #define GODOT_TEST_TRANSFORM_NON_UNIFORM_SCALE_TESTS_ENABLED

namespace TestTransform
{
namespace TestTransform {

bool test_plane() {
bool pass = true;
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "core/os/main_loop.h"

namespace TestTransform
{
namespace TestTransform {
MainLoop* test();
} // namespace TestTransform

Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_xml_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#include "core/os/os.h"

namespace TestXMLParser
{
namespace TestXMLParser {
#define CHECK(X) \
if (!(X)) { \
OS::get_singleton()->print("\tFAIL at %s\n", #X); \
Expand Down
3 changes: 1 addition & 2 deletions main/tests/test_xml_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#include <inttypes.h>

namespace TestXMLParser
{
namespace TestXMLParser {

MainLoop* test();
} // namespace TestXMLParser
Expand Down
6 changes: 2 additions & 4 deletions modules/fbx/fbx_parser/ByteSwapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <locale>
#include <stdint.h>

namespace FBXDocParser
{
namespace FBXDocParser {
// --------------------------------------------------------------------------------------
/** Defines some useful byte order swap routines.
*
Expand Down Expand Up @@ -219,8 +218,7 @@ struct ByteSwap::_swapper<T, 8> {
#define LE_NCONST
#endif

namespace Intern
{
namespace Intern {

// --------------------------------------------------------------------------------------------
template <typename T, bool doit>
Expand Down
3 changes: 1 addition & 2 deletions modules/fbx/fbx_parser/FBXAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXDocumentUtil.h"
#include "FBXParser.h"

namespace FBXDocParser
{
namespace FBXDocParser {

using namespace Util;

Expand Down
Loading
Loading