mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Apply clang-tidy to remove empty constructors / destructors
This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
This commit is contained in:
@ -214,8 +214,8 @@ struct Geometry_buffer;
|
||||
class Geometry
|
||||
{
|
||||
public:
|
||||
Geometry() {} /* Remove gcc warning */
|
||||
virtual ~Geometry() {} /* Remove gcc warning */
|
||||
Geometry() = default; /* Remove gcc warning */
|
||||
virtual ~Geometry() = default; /* Remove gcc warning */
|
||||
static void *operator new(size_t size, void *buffer)
|
||||
{
|
||||
return buffer;
|
||||
@ -396,8 +396,8 @@ protected:
|
||||
class Gis_point: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_point() {} /* Remove gcc warning */
|
||||
virtual ~Gis_point() {} /* Remove gcc warning */
|
||||
Gis_point() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_point() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -466,8 +466,8 @@ public:
|
||||
class Gis_line_string: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_line_string() {} /* Remove gcc warning */
|
||||
virtual ~Gis_line_string() {} /* Remove gcc warning */
|
||||
Gis_line_string() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_line_string() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -499,8 +499,8 @@ public:
|
||||
class Gis_polygon: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_polygon() {} /* Remove gcc warning */
|
||||
virtual ~Gis_polygon() {} /* Remove gcc warning */
|
||||
Gis_polygon() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_polygon() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -536,8 +536,8 @@ class Gis_multi_point: public Geometry
|
||||
(uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
|
||||
(WKB_HEADER_SIZE + POINT_DATA_SIZE);
|
||||
public:
|
||||
Gis_multi_point() {} /* Remove gcc warning */
|
||||
virtual ~Gis_multi_point() {} /* Remove gcc warning */
|
||||
Gis_multi_point() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_multi_point() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -567,8 +567,8 @@ public:
|
||||
class Gis_multi_line_string: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_multi_line_string() {} /* Remove gcc warning */
|
||||
virtual ~Gis_multi_line_string() {} /* Remove gcc warning */
|
||||
Gis_multi_line_string() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_multi_line_string() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -598,8 +598,8 @@ public:
|
||||
class Gis_multi_polygon: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_multi_polygon() {} /* Remove gcc warning */
|
||||
virtual ~Gis_multi_polygon() {} /* Remove gcc warning */
|
||||
Gis_multi_polygon() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_multi_polygon() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
@ -629,8 +629,8 @@ public:
|
||||
class Gis_geometry_collection: public Geometry
|
||||
{
|
||||
public:
|
||||
Gis_geometry_collection() {} /* Remove gcc warning */
|
||||
virtual ~Gis_geometry_collection() {} /* Remove gcc warning */
|
||||
Gis_geometry_collection() = default; /* Remove gcc warning */
|
||||
virtual ~Gis_geometry_collection() = default; /* Remove gcc warning */
|
||||
uint32 get_data_size() const;
|
||||
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
|
||||
uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
|
||||
|
Reference in New Issue
Block a user