Procházet zdrojové kódy

src/*: code-style: fix ctor/dtor definition style

Daniele Bartolini před 3 roky
rodič
revize
d6e10c1ea4

+ 6 - 2
src/core/filesystem/file.h

@@ -16,10 +16,14 @@ namespace crown
 struct File
 {
 	///
-	File() {}
+	File()
+	{
+	}
 
 	///
-	virtual ~File() {}
+	virtual ~File()
+	{
+	}
 
 	/// Opens the file at @a path with specified @a mode
 	virtual void open(const char* path, FileOpenMode::Enum mode) = 0;

+ 6 - 2
src/core/filesystem/filesystem.h

@@ -19,10 +19,14 @@ namespace crown
 struct Filesystem
 {
 	///
-	Filesystem() {};
+	Filesystem()
+	{
+	};
 
 	///
-	virtual ~Filesystem() {};
+	virtual ~Filesystem()
+	{
+	};
 
 	///
 	Filesystem(const Filesystem&) = delete;

+ 2 - 1
src/core/memory/globals.cpp

@@ -237,7 +237,8 @@ namespace memory
 		/// that don't fit in the ring buffer.
 		///
 		/// size specifies the size of the ring buffer.
-		ScratchAllocator(Allocator &backing, u32 size) : _backing(backing)
+		ScratchAllocator(Allocator &backing, u32 size)
+			: _backing(backing)
 		{
 			_begin = (char*)_backing.allocate(size);
 			_end = _begin + size;

+ 3 - 1
src/core/memory/temp_allocator.inl

@@ -66,7 +66,9 @@ typedef TempAllocator<4096> TempAllocator4096;
 // ---------------------------------------------------------------
 
 template<int BUFFER_SIZE>
-TempAllocator<BUFFER_SIZE>::TempAllocator(Allocator &backing) : _backing(backing), _chunk_size(4*1024)
+TempAllocator<BUFFER_SIZE>::TempAllocator(Allocator &backing)
+	: _backing(backing)
+	, _chunk_size(4*1024)
 {
 	_p = _start = _buffer;
 	_end = _start + BUFFER_SIZE;

+ 20 - 4
src/core/strings/string_id.h

@@ -19,8 +19,16 @@ struct StringId32
 {
 	u32 _id;
 
-	StringId32() : _id(0) {}
-	StringId32(u32 idx) : _id(idx) {}
+	StringId32()
+		: _id(0)
+	{
+	}
+
+	StringId32(u32 idx)
+		: _id(idx)
+	{
+	}
+
 	explicit StringId32(const char* str);
 	explicit StringId32(const char* str, u32 len);
 
@@ -42,8 +50,16 @@ struct StringId64
 {
 	u64 _id;
 
-	StringId64() : _id(0) {}
-	StringId64(u64 idx) : _id(idx) {}
+	StringId64()
+		: _id(0)
+	{
+	}
+
+	StringId64(u64 idx)
+		: _id(idx)
+	{
+	}
+
 	explicit StringId64(const char* str);
 	explicit StringId64(const char* str, u32 len);
 

+ 3 - 1
src/device/display.h

@@ -26,7 +26,9 @@ struct DisplayMode
 struct Display
 {
 	///
-	virtual ~Display() {};
+	virtual ~Display()
+	{
+	};
 
 	/// Fills @a modes with all available display modes.
 	virtual void modes(Array<DisplayMode>& modes) = 0;

+ 3 - 1
src/device/window.h

@@ -52,7 +52,9 @@ struct CursorMode
 struct Window
 {
 	///
-	virtual ~Window() {};
+	virtual ~Window()
+	{
+	};
 
 	/// Opens the window.
 	virtual void open(u16 x, u16 y, u16 width, u16 height, u32 parent) = 0;

+ 43 - 8
src/resource/expression_language.cpp

@@ -146,10 +146,28 @@ namespace expression_language
 	{
 		enum TokenType {EMPTY, NUMBER, FUNCTION, VARIABLE, LEFT_PARENTHESIS, RIGHT_PARENTHESIS};
 
-		Token() : type(EMPTY), id(0) {}
-		explicit Token(TokenType type) : type(type) {}
-		Token(TokenType type, unsigned id) : type(type), id(id) {}
-		Token(TokenType type, float value) : type(type), value(value) {}
+		Token()
+			: type(EMPTY)
+			, id(0)
+		{
+		}
+
+		explicit Token(TokenType type)
+			: type(type)
+		{
+		}
+
+		Token(TokenType type, unsigned id)
+			: type(type)
+			, id(id)
+		{
+		}
+
+		Token(TokenType type, float value)
+			: type(type)
+			, value(value)
+		{
+		}
 
 		TokenType type;		///< Identifies the type of the token
 		union {
@@ -161,8 +179,16 @@ namespace expression_language
 	/// Describes a function.
 	struct Function
 	{
-		Function() {}
-		Function(OpCode op_code, unsigned precedence, unsigned arity) : op_code(op_code), precedence(precedence), arity(arity) {}
+		Function()
+		{
+		}
+
+		Function(OpCode op_code, unsigned precedence, unsigned arity)
+			: op_code(op_code)
+			, precedence(precedence)
+			, arity(arity)
+		{
+		}
 
 		OpCode 		op_code;	///< The opcode of the function
 		unsigned 	precedence;	///< The precedence of the function operator.
@@ -375,8 +401,17 @@ namespace expression_language
 	/// before others.
 	struct FunctionStackItem
 	{
-		FunctionStackItem() {}
-		FunctionStackItem(Token t, int p, int pl) : token(t), precedence(p), par_level(pl) {}
+		FunctionStackItem()
+		{
+		}
+
+		FunctionStackItem(Token t, int p, int pl)
+			: token(t)
+			, precedence(p)
+			, par_level(pl)
+		{
+		}
+
 		inline int cmp(const FunctionStackItem &f) const {
 			if (par_level != f.par_level) return par_level - f.par_level;
 			return precedence - f.precedence;