From 8572a33880e813b6efc2c349d4562df6326a45e9 Mon Sep 17 00:00:00 2001 From: Raidho Date: Fri, 10 Feb 2017 18:36:47 +0300 Subject: [PATCH] Prettifyed the code exploiting inheritance rules added missing comma, added missing `override` --HG-- branch : minor --- src/modules/filesystem/FileData.cpp | 2 +- src/modules/filesystem/FileData.h | 2 +- src/modules/filesystem/wrap_FileData.cpp | 2 +- src/modules/font/GlyphData.cpp | 2 +- src/modules/font/GlyphData.h | 2 +- src/modules/font/wrap_GlyphData.cpp | 2 +- src/modules/image/CompressedImageData.h | 2 +- src/modules/image/ImageData.h | 2 +- src/modules/image/magpie/CompressedImageData.cpp | 2 +- src/modules/image/magpie/CompressedImageData.h | 2 +- src/modules/image/magpie/ImageData.cpp | 2 +- src/modules/image/magpie/ImageData.h | 2 +- src/modules/image/wrap_CompressedImageData.cpp | 2 +- src/modules/image/wrap_ImageData.cpp | 2 +- src/modules/math/CompressedData.cpp | 2 +- src/modules/math/CompressedData.h | 2 +- src/modules/math/wrap_CompressedData.cpp | 2 +- src/modules/sound/SoundData.cpp | 2 +- src/modules/sound/SoundData.h | 2 +- src/modules/sound/wrap_SoundData.cpp | 4 ++-- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/modules/filesystem/FileData.cpp b/src/modules/filesystem/FileData.cpp index c065a4976..94688ad1f 100644 --- a/src/modules/filesystem/FileData.cpp +++ b/src/modules/filesystem/FileData.cpp @@ -79,7 +79,7 @@ FileData::~FileData() delete [] data; } -Data *FileData::clone() const +FileData *FileData::clone() const { return new FileData(*this); } diff --git a/src/modules/filesystem/FileData.h b/src/modules/filesystem/FileData.h index 86a8385ba..659e8218a 100644 --- a/src/modules/filesystem/FileData.h +++ b/src/modules/filesystem/FileData.h @@ -45,7 +45,7 @@ public: virtual ~FileData(); // Implements Data. - Data *clone() const; + FileData *clone() const; void *getData() const; size_t getSize() const; diff --git a/src/modules/filesystem/wrap_FileData.cpp b/src/modules/filesystem/wrap_FileData.cpp index 9f26e2593..a8c6b3732 100644 --- a/src/modules/filesystem/wrap_FileData.cpp +++ b/src/modules/filesystem/wrap_FileData.cpp @@ -35,7 +35,7 @@ FileData *luax_checkfiledata(lua_State *L, int idx) int w_FileData_clone(lua_State *L) { FileData *t = luax_checkfiledata(L, 1), *c = nullptr; - luax_catchexcept(L, [&](){ c = (FileData*)t->clone(); }); + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1; diff --git a/src/modules/font/GlyphData.cpp b/src/modules/font/GlyphData.cpp index 4e8054144..c540cdcf6 100644 --- a/src/modules/font/GlyphData.cpp +++ b/src/modules/font/GlyphData.cpp @@ -66,7 +66,7 @@ GlyphData::~GlyphData() delete[] data; } -Data *GlyphData::clone() const +GlyphData *GlyphData::clone() const { return new GlyphData(*this); } diff --git a/src/modules/font/GlyphData.h b/src/modules/font/GlyphData.h index 8c326b873..4e930cb1e 100644 --- a/src/modules/font/GlyphData.h +++ b/src/modules/font/GlyphData.h @@ -63,7 +63,7 @@ public: virtual ~GlyphData(); // Implements Data. - Data *clone() const; + GlyphData *clone() const; void *getData() const; size_t getSize() const; diff --git a/src/modules/font/wrap_GlyphData.cpp b/src/modules/font/wrap_GlyphData.cpp index 32a536183..9c9da012e 100644 --- a/src/modules/font/wrap_GlyphData.cpp +++ b/src/modules/font/wrap_GlyphData.cpp @@ -33,7 +33,7 @@ GlyphData *luax_checkglyphdata(lua_State *L, int idx) int w_GlyphData_clone(lua_State *L) { GlyphData *t = luax_checkglyphdata(L, 1), *c = nullptr; - luax_catchexcept(L, [&](){ c = (GlyphData*)t->clone(); }); + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1; diff --git a/src/modules/image/CompressedImageData.h b/src/modules/image/CompressedImageData.h index 69ee910bc..dd45d133f 100644 --- a/src/modules/image/CompressedImageData.h +++ b/src/modules/image/CompressedImageData.h @@ -59,7 +59,7 @@ public: virtual ~CompressedImageData(); // Implements Data. - virtual Data *clone() const = 0; + virtual CompressedImageData *clone() const = 0; virtual void *getData() const; virtual size_t getSize() const; diff --git a/src/modules/image/ImageData.h b/src/modules/image/ImageData.h index a2f1f519f..c2ee80a8c 100644 --- a/src/modules/image/ImageData.h +++ b/src/modules/image/ImageData.h @@ -128,7 +128,7 @@ public: love::thread::Mutex *getMutex() const; // Implements Data. - virtual Data *clone() const = 0; + virtual ImageData *clone() const = 0; virtual void *getData() const; virtual size_t getSize() const; diff --git a/src/modules/image/magpie/CompressedImageData.cpp b/src/modules/image/magpie/CompressedImageData.cpp index b7203ec5f..afc0770e9 100644 --- a/src/modules/image/magpie/CompressedImageData.cpp +++ b/src/modules/image/magpie/CompressedImageData.cpp @@ -82,7 +82,7 @@ CompressedImageData::CompressedImageData(const CompressedImageData &c) } } -Data *CompressedImageData::clone() const +CompressedImageData *CompressedImageData::clone() const { return new CompressedImageData(*this); } diff --git a/src/modules/image/magpie/CompressedImageData.h b/src/modules/image/magpie/CompressedImageData.h index eaf0d0328..c8fd624f5 100644 --- a/src/modules/image/magpie/CompressedImageData.h +++ b/src/modules/image/magpie/CompressedImageData.h @@ -44,7 +44,7 @@ public: CompressedImageData(const CompressedImageData &c); virtual ~CompressedImageData(); - virtual Data *clone() const; + virtual CompressedImageData *clone() const; }; // CompressedImageData } // magpie diff --git a/src/modules/image/magpie/ImageData.cpp b/src/modules/image/magpie/ImageData.cpp index e44533357..07959c099 100644 --- a/src/modules/image/magpie/ImageData.cpp +++ b/src/modules/image/magpie/ImageData.cpp @@ -103,7 +103,7 @@ ImageData::~ImageData() handler->release(); } -Data *ImageData::clone() const +ImageData *ImageData::clone() const { return new ImageData(*this); } diff --git a/src/modules/image/magpie/ImageData.h b/src/modules/image/magpie/ImageData.h index 59003b1e1..a0275ffb2 100644 --- a/src/modules/image/magpie/ImageData.h +++ b/src/modules/image/magpie/ImageData.h @@ -45,7 +45,7 @@ public: ImageData(const ImageData &c); virtual ~ImageData(); - virtual Data *clone() const; + virtual ImageData *clone() const; // Implements image::ImageData. virtual love::filesystem::FileData *encode(EncodedFormat encodedFormat, const char *filename); diff --git a/src/modules/image/wrap_CompressedImageData.cpp b/src/modules/image/wrap_CompressedImageData.cpp index 3c979dc7b..191e44c82 100644 --- a/src/modules/image/wrap_CompressedImageData.cpp +++ b/src/modules/image/wrap_CompressedImageData.cpp @@ -34,7 +34,7 @@ CompressedImageData *luax_checkcompressedimagedata(lua_State *L, int idx) int w_CompressedImageData_clone(lua_State *L) { CompressedImageData *t = luax_checkcompressedimagedata(L, 1), *c = nullptr; - luax_catchexcept(L, [&](){ c = (CompressedImageData *)t->clone(); }); + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1; diff --git a/src/modules/image/wrap_ImageData.cpp b/src/modules/image/wrap_ImageData.cpp index bf25750ab..f65d960c9 100644 --- a/src/modules/image/wrap_ImageData.cpp +++ b/src/modules/image/wrap_ImageData.cpp @@ -46,7 +46,7 @@ ImageData *luax_checkimagedata(lua_State *L, int idx) int w_ImageData_clone(lua_State *L) { ImageData *t = luax_checkimagedata(L, 1), *c = nullptr; - luax_catchexcept(L, [&](){ c = (ImageData*)t->clone(); }); + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1; diff --git a/src/modules/math/CompressedData.cpp b/src/modules/math/CompressedData.cpp index e6fc4c8b1..0fe65f935 100644 --- a/src/modules/math/CompressedData.cpp +++ b/src/modules/math/CompressedData.cpp @@ -74,7 +74,7 @@ CompressedData::~CompressedData() delete[] data; } -Data *CompressedData::clone() const +CompressedData *CompressedData::clone() const { return new CompressedData(*this); } diff --git a/src/modules/math/CompressedData.h b/src/modules/math/CompressedData.h index 41705ecd6..89bc569d4 100644 --- a/src/modules/math/CompressedData.h +++ b/src/modules/math/CompressedData.h @@ -58,7 +58,7 @@ public: size_t getDecompressedSize() const; // Implements Data. - Data *clone() const; + CompressedData *clone() const override; void *getData() const override; size_t getSize() const override; diff --git a/src/modules/math/wrap_CompressedData.cpp b/src/modules/math/wrap_CompressedData.cpp index 50c678828..bbeaf9e56 100644 --- a/src/modules/math/wrap_CompressedData.cpp +++ b/src/modules/math/wrap_CompressedData.cpp @@ -35,7 +35,7 @@ CompressedData *luax_checkcompresseddata(lua_State *L, int idx) int w_CompressedData_clone(lua_State *L) { CompressedData *t = luax_checkcompresseddata(L, 1), *c = nullptr; - luax_catchexcept(L, [&](){ c = (CompressedData *)t->clone(); }); + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1; diff --git a/src/modules/sound/SoundData.cpp b/src/modules/sound/SoundData.cpp index 0023ac404..c27177afc 100644 --- a/src/modules/sound/SoundData.cpp +++ b/src/modules/sound/SoundData.cpp @@ -124,7 +124,7 @@ SoundData::~SoundData() free(data); } -Data *SoundData::clone() const +SoundData *SoundData::clone() const { return new SoundData(*this); } diff --git a/src/modules/sound/SoundData.h b/src/modules/sound/SoundData.h index 6ceff6c56..2d3bf3137 100644 --- a/src/modules/sound/SoundData.h +++ b/src/modules/sound/SoundData.h @@ -45,7 +45,7 @@ public: virtual ~SoundData(); // Implements Data. - Data *clone() const; + SoundData *clone() const; void *getData() const; size_t getSize() const; diff --git a/src/modules/sound/wrap_SoundData.cpp b/src/modules/sound/wrap_SoundData.cpp index 9085940bc..9b2d14665 100644 --- a/src/modules/sound/wrap_SoundData.cpp +++ b/src/modules/sound/wrap_SoundData.cpp @@ -44,8 +44,8 @@ SoundData *luax_checksounddata(lua_State *L, int idx) int w_SoundData_clone(lua_State *L) { - SoundData *t = luax_checksounddata(L, 1)*c = nullptr; - luax_catchexcept(L, [&](){ c = (SoundData*)t->clone(); }); + SoundData *t = luax_checksounddata(L, 1), *c = nullptr; + luax_catchexcept(L, [&](){ c = t->clone(); }); luax_pushtype(L, c); c->release(); return 1;