mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Prettifyed the code exploiting inheritance rules
added missing comma, added missing `override` --HG-- branch : minor
This commit is contained in:
@@ -79,7 +79,7 @@ FileData::~FileData()
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
Data *FileData::clone() const
|
||||
FileData *FileData::clone() const
|
||||
{
|
||||
return new FileData(*this);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
virtual ~FileData();
|
||||
|
||||
// Implements Data.
|
||||
Data *clone() const;
|
||||
FileData *clone() const;
|
||||
void *getData() const;
|
||||
size_t getSize() const;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -66,7 +66,7 @@ GlyphData::~GlyphData()
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
Data *GlyphData::clone() const
|
||||
GlyphData *GlyphData::clone() const
|
||||
{
|
||||
return new GlyphData(*this);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
virtual ~GlyphData();
|
||||
|
||||
// Implements Data.
|
||||
Data *clone() const;
|
||||
GlyphData *clone() const;
|
||||
void *getData() const;
|
||||
size_t getSize() const;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ CompressedImageData::CompressedImageData(const CompressedImageData &c)
|
||||
}
|
||||
}
|
||||
|
||||
Data *CompressedImageData::clone() const
|
||||
CompressedImageData *CompressedImageData::clone() const
|
||||
{
|
||||
return new CompressedImageData(*this);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
CompressedImageData(const CompressedImageData &c);
|
||||
virtual ~CompressedImageData();
|
||||
|
||||
virtual Data *clone() const;
|
||||
virtual CompressedImageData *clone() const;
|
||||
}; // CompressedImageData
|
||||
|
||||
} // magpie
|
||||
|
||||
@@ -103,7 +103,7 @@ ImageData::~ImageData()
|
||||
handler->release();
|
||||
}
|
||||
|
||||
Data *ImageData::clone() const
|
||||
ImageData *ImageData::clone() const
|
||||
{
|
||||
return new ImageData(*this);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -74,7 +74,7 @@ CompressedData::~CompressedData()
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
Data *CompressedData::clone() const
|
||||
CompressedData *CompressedData::clone() const
|
||||
{
|
||||
return new CompressedData(*this);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -124,7 +124,7 @@ SoundData::~SoundData()
|
||||
free(data);
|
||||
}
|
||||
|
||||
Data *SoundData::clone() const
|
||||
SoundData *SoundData::clone() const
|
||||
{
|
||||
return new SoundData(*this);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
virtual ~SoundData();
|
||||
|
||||
// Implements Data.
|
||||
Data *clone() const;
|
||||
SoundData *clone() const;
|
||||
void *getData() const;
|
||||
size_t getSize() const;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user