Skip to content

Commit

Permalink
JANITORIAL: Fix GCC 14 warnings
Browse files Browse the repository at this point in the history
Fix repetitive warnings about template-id in constructors and destructors. This ensures C++20 compatibility. Warnings are encountered when compiling with GCC 14.
  • Loading branch information
peter277 authored and bluegr committed May 25, 2024
1 parent 32f3bfe commit 86a9fd6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions common/singleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace Common {
template<class T>
class Singleton : NonCopyable {
private:
Singleton<T>(const Singleton<T> &);
Singleton<T> &operator=(const Singleton<T> &);
Singleton(const Singleton&);
Singleton &operator=(const Singleton &);

/**
* The default object factory used by the template class Singleton.
Expand Down Expand Up @@ -88,8 +88,8 @@ class Singleton : NonCopyable {
T::destroyInstance();
}
protected:
Singleton<T>() { }
virtual ~Singleton<T>() { }
Singleton() { }
virtual ~Singleton() { }

typedef T SingletonBaseType;

Expand Down
6 changes: 3 additions & 3 deletions common/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FixedStack {
public:
typedef uint size_type;

FixedStack<T, MAX_SIZE>() : _size(0) {}
FixedStack() : _size(0) {}

bool empty() const {
return _size <= 0;
Expand Down Expand Up @@ -106,8 +106,8 @@ class Stack {
public:
typedef typename Array<T>::size_type size_type;

Stack<T>() {}
Stack<T>(const Array<T> &stackContent) : _stack(stackContent) {}
Stack() {}
Stack(const Array<T> &stackContent) : _stack(stackContent) {}

bool empty() const {
return _stack.empty();
Expand Down
6 changes: 3 additions & 3 deletions engines/adl/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GraphicsMan {
template <class T>
class GraphicsMan_v1 : public GraphicsMan {
public:
GraphicsMan_v1<T>(T &display) : _display(display) { this->setBounds(Common::Rect(280, 160)); }
GraphicsMan_v1(T &display) : _display(display) { this->setBounds(Common::Rect(280, 160)); }

void drawLine(const Common::Point &p1, const Common::Point &p2, byte color) const override;
void drawShape(Common::ReadStream &shape, Common::Point &pos, byte rotation = 0, byte scaling = 1, byte color = 0x7f) const override;
Expand All @@ -69,7 +69,7 @@ class GraphicsMan_v1 : public GraphicsMan {
template <class T>
class GraphicsMan_v2 : public GraphicsMan_v1<T> {
public:
GraphicsMan_v2<T>(T &display) : GraphicsMan_v1<T>(display), _color(0) { }
GraphicsMan_v2(T &display) : GraphicsMan_v1<T>(display), _color(0) { }
void drawPic(Common::SeekableReadStream &pic, const Common::Point &pos) override;

protected:
Expand All @@ -96,7 +96,7 @@ class GraphicsMan_v2 : public GraphicsMan_v1<T> {
template <class T>
class GraphicsMan_v3 : public GraphicsMan_v2<T> {
public:
GraphicsMan_v3<T>(T &display) : GraphicsMan_v2<T>(display) { }
GraphicsMan_v3(T &display) : GraphicsMan_v2<T>(display) { }

private:
void fillRowLeft(Common::Point p, const byte pattern, const bool stopBit) override;
Expand Down
2 changes: 1 addition & 1 deletion engines/startrek/fixedint.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TFixedInt : Common::Serializable {
* Constructor from other fixed-point formats.
*/
template<typename T2, uint otherTB, uint otherDB>
explicit TFixedInt<T, totalBits, decimalBits>(const TFixedInt<T2, otherTB, otherDB> &fi) {
explicit TFixedInt(const TFixedInt<T2, otherTB, otherDB> &fi) {
int diff = otherDB - decimalBits;
if (otherDB >= decimalBits)
val = fi.raw() >> diff;
Expand Down
2 changes: 1 addition & 1 deletion engines/titanic/support/fixed_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FixedQueue {
Common::Array<T> _data;
size_type _topIndex;
public:
FixedQueue<T, MAX_SIZE>() : _topIndex(0) {
FixedQueue() : _topIndex(0) {
_data.reserve(MAX_SIZE);
}

Expand Down

0 comments on commit 86a9fd6

Please sign in to comment.