From 6a7550a6bade16b5319a12c3dab3aa7afb0efa00 Mon Sep 17 00:00:00 2001 From: Garux Date: Thu, 14 Oct 2021 23:31:07 +0300 Subject: [PATCH] shorten special class members declarations --- libs/selectionlib.h | 3 --- radiant/treemodel.cpp | 4 ---- tools/quake3/common/cmdlib.h | 2 -- tools/quake3/common/scriplib.cpp | 4 ---- tools/quake3/common/stringfixedsize.h | 12 ++---------- tools/quake3/common/vfs.cpp | 1 + tools/quake3/q3map2/q3map2.h | 3 --- tools/quake3/q3map2/surface_meta.cpp | 5 ----- 8 files changed, 3 insertions(+), 31 deletions(-) diff --git a/libs/selectionlib.h b/libs/selectionlib.h index 54a77328..24fda5e5 100644 --- a/libs/selectionlib.h +++ b/libs/selectionlib.h @@ -148,10 +148,7 @@ private: public: SelectionList() = default; - SelectionList( const SelectionList& ) = delete; SelectionList( SelectionList&& ) noexcept = delete; - SelectionList& operator=( const SelectionList& ) = delete; - SelectionList& operator=( SelectionList&& ) noexcept = delete; iterator begin(){ return m_selection.begin(); diff --git a/radiant/treemodel.cpp b/radiant/treemodel.cpp index 0bf79357..c2932146 100644 --- a/radiant/treemodel.cpp +++ b/radiant/treemodel.cpp @@ -774,11 +774,7 @@ public: m_instance.get().setChildSelectedChangedCallback( Callback() ); ASSERT_MESSAGE( empty(), "GraphTreeNode::~GraphTreeNode: memory leak" ); } - GraphTreeNode() = delete; - GraphTreeNode( const GraphTreeNode& ) = delete; GraphTreeNode( GraphTreeNode&& ) noexcept = delete; - GraphTreeNode& operator=( const GraphTreeNode& ) = delete; - GraphTreeNode& operator=( GraphTreeNode&& ) noexcept = delete; iterator begin(){ return m_childnodes.begin(); diff --git a/tools/quake3/common/cmdlib.h b/tools/quake3/common/cmdlib.h index b69e0f57..bd685a4a 100644 --- a/tools/quake3/common/cmdlib.h +++ b/tools/quake3/common/cmdlib.h @@ -31,10 +31,8 @@ class void_ptr { -private: void *ptr; public: - void_ptr() = delete; void_ptr( void *p ) : ptr( p ) {} template operator T*() const { diff --git a/tools/quake3/common/scriplib.cpp b/tools/quake3/common/scriplib.cpp index e4f3c8bc..7de0f6ef 100644 --- a/tools/quake3/common/scriplib.cpp +++ b/tools/quake3/common/scriplib.cpp @@ -51,11 +51,7 @@ struct script_t end( start + size ), line( 1 ) {} - script_t() = delete; - script_t( const script_t& ) = delete; script_t( script_t&& ) noexcept = delete; - script_t& operator=( const script_t& ) = delete; - script_t& operator=( script_t&& ) noexcept = delete; ~script_t(){ free( buffer ); } diff --git a/tools/quake3/common/stringfixedsize.h b/tools/quake3/common/stringfixedsize.h index 800e17ca..203684f7 100644 --- a/tools/quake3/common/stringfixedsize.h +++ b/tools/quake3/common/stringfixedsize.h @@ -19,12 +19,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined( INCLUDED_STRINGFIXESIZE_H ) -#define INCLUDED_STRINGFIXESIZE_H +#pragma once #include "stream/textstream.h" #include "string/string.h" -#include "cmdlib.h" +#include "inout.h" /// \brief A TextOutputStream which writes to a null terminated fixed length char array. @@ -41,10 +40,6 @@ public: explicit StringFixedSize( const char* string ){ operator()( string ); } - StringFixedSize( const StringFixedSize& ) = default; - StringFixedSize( StringFixedSize&& ) noexcept = default; - StringFixedSize& operator=( const StringFixedSize& ) = default; - StringFixedSize& operator=( StringFixedSize&& ) noexcept = default; std::size_t write( const char* buffer, std::size_t length ) override { if( m_length + length < SIZE ){ for( auto i = length; i != 0; --i ) @@ -91,6 +86,3 @@ inline StringFixedSize& operator<<( StringFixedSize& ostream, const } using String64 = StringFixedSize<64>; - - -#endif diff --git a/tools/quake3/common/vfs.cpp b/tools/quake3/common/vfs.cpp index 1dd7b9f4..f95209e7 100644 --- a/tools/quake3/common/vfs.cpp +++ b/tools/quake3/common/vfs.cpp @@ -77,6 +77,7 @@ struct VFS_PAK unzFile zipfile; const CopiedString unzFilePath; VFS_PAK( unzFile zipfile, const char *unzFilePath ) : zipfile( zipfile ), unzFilePath( unzFilePath ) {}; + VFS_PAK( VFS_PAK&& ) noexcept = delete; ~VFS_PAK(){ unzClose( zipfile ); } diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 70fe6455..5e92d064 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -425,7 +425,6 @@ struct image_t height(height ), pixels( pixels ) {} - image_t( const image_t& ) = delete; image_t( image_t&& other ) noexcept : name( std::move( other.name ) ), filename( std::move( other.filename ) ), @@ -433,8 +432,6 @@ struct image_t height( other.height ), pixels( std::exchange( other.pixels, nullptr ) ) {} - image_t& operator=( const image_t& ) = delete; - image_t& operator=( image_t&& ) noexcept = delete; ~image_t(){ free( pixels ); } diff --git a/tools/quake3/q3map2/surface_meta.cpp b/tools/quake3/q3map2/surface_meta.cpp index e85c6f28..0ff008ca 100644 --- a/tools/quake3/q3map2/surface_meta.cpp +++ b/tools/quake3/q3map2/surface_meta.cpp @@ -48,11 +48,6 @@ struct metaVertex_t : public bspDrawVert_t std::list *m_metaVertexGroup; // reference to own group of vertices with equal .xyz position metaVertex_t() = default; - metaVertex_t( const metaVertex_t& ) = default; - metaVertex_t( metaVertex_t&& ) noexcept = default; - metaVertex_t& operator=( const metaVertex_t& ) = default; - metaVertex_t& operator=( metaVertex_t&& ) noexcept = default; - metaVertex_t( const bspDrawVert_t& vert ) : bspDrawVert_t( vert ){} };