Skip to content

Commit

Permalink
Use delete on classes not meant to be copied
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsons26 authored and giulianobelinassi committed Jun 27, 2024
1 parent 8000d0a commit 6f1bf9a
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions common/b64pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class Base64Pipe : public Pipe
/*
** Explicitly disable the copy constructor and the assignment operator.
*/
Base64Pipe(Base64Pipe& rvalue);
Base64Pipe& operator=(Base64Pipe const& pipe);
Base64Pipe(Base64Pipe& rvalue) = delete;
Base64Pipe& operator=(Base64Pipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/b64straw.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class Base64Straw : public Straw
/*
** Explicitly disable the copy constructor and the assignment operator.
*/
Base64Straw(Base64Straw& rvalue);
Base64Straw& operator=(Base64Straw const& pipe);
Base64Straw(Base64Straw& rvalue) = delete;
Base64Straw& operator=(Base64Straw const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/blowpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class BlowPipe : public Pipe
int Counter;
CryptControl Control;

BlowPipe(BlowPipe& rvalue);
BlowPipe& operator=(BlowPipe const& pipe);
BlowPipe(BlowPipe& rvalue) = delete;
BlowPipe& operator=(BlowPipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/blwstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class BlowStraw : public Straw
int Counter;
CryptControl Control;

BlowStraw(BlowStraw& rvalue);
BlowStraw& operator=(BlowStraw const& straw);
BlowStraw(BlowStraw& rvalue) = delete;
BlowStraw& operator=(BlowStraw const& straw) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class BufferClass
/* could be copied and the associated buffer freed. If this were to */
/* gappen it could cause weird general protection fault. */
/*===================================================================*/
BufferClass(BufferClass const&);
BufferClass& operator=(BufferClass const&);
BufferClass(BufferClass const&) = delete;
BufferClass& operator=(BufferClass const&) = delete;

protected:
void* Buffer;
Expand Down
4 changes: 2 additions & 2 deletions common/ccfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class CCFileClass : public CDFileClass
int Position;

// Force these to never be invoked.
CCFileClass const& operator=(CCFileClass const& c);
CCFileClass(CCFileClass const&);
CCFileClass const& operator=(CCFileClass const& c) = delete;
CCFileClass(CCFileClass const&) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/cstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class CacheStraw : public Straw
{
return (BufferPtr.Is_Valid());
}
CacheStraw(CacheStraw& rvalue);
CacheStraw& operator=(CacheStraw const& pipe);
CacheStraw(CacheStraw& rvalue) = delete;
CacheStraw& operator=(CacheStraw const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/lcwpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class LCWPipe : public Pipe
unsigned short UncompCount; // Bytes of uncompressed data it represents.
} BlockHeader;

LCWPipe(LCWPipe& rvalue);
LCWPipe& operator=(LCWPipe const& pipe);
LCWPipe(LCWPipe& rvalue) = delete;
LCWPipe& operator=(LCWPipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/lcwstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class LCWStraw : public Straw
unsigned short UncompCount; // Bytes of uncompressed data it represents.
} BlockHeader;

LCWStraw(LCWStraw& rvalue);
LCWStraw& operator=(LCWStraw const& pipe);
LCWStraw(LCWStraw& rvalue) = delete;
LCWStraw& operator=(LCWStraw const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/listnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ class GenericList
GenericNode LastNode;

private:
GenericList(GenericList& list);
GenericList& operator=(GenericList const&);
GenericList(GenericList& list) = delete;
GenericList& operator=(GenericList const&) = delete;
};

/*
Expand Down
4 changes: 2 additions & 2 deletions common/pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class Pipe
/*
** Disable the copy constructor and assignment operator.
*/
Pipe(Pipe& rvalue);
Pipe& operator=(Pipe const& pipe);
Pipe(Pipe& rvalue) = delete;
Pipe& operator=(Pipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/pkpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class PKPipe : public Pipe
int Encrypted_Key_Length(void) const;
int Plain_Key_Length(void) const;

PKPipe(PKPipe& rvalue);
PKPipe& operator=(PKPipe const& pipe);
PKPipe(PKPipe& rvalue) = delete;
PKPipe& operator=(PKPipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/pkstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class PKStraw : public Straw
int Encrypted_Key_Length(void) const;
int Plain_Key_Length(void) const;

PKStraw(PKStraw& rvalue);
PKStraw& operator=(PKStraw const& straw);
PKStraw(PKStraw& rvalue) = delete;
PKStraw& operator=(PKStraw const& straw) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/rawfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class RawFileClass : public FileClass

RawFileClass(char const* filename);
RawFileClass(void);
RawFileClass(RawFileClass const& f);
RawFileClass& operator=(RawFileClass const& f);
RawFileClass(RawFileClass const& f) = delete;
RawFileClass& operator=(RawFileClass const& f) = delete;
virtual ~RawFileClass(void);

virtual char const* File_Name(void) const;
Expand Down
4 changes: 2 additions & 2 deletions common/rndstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class RandomStraw : public Straw

void Scramble_Seed(void);

RandomStraw(RandomStraw& rvalue);
RandomStraw& operator=(RandomStraw const& pipe);
RandomStraw(RandomStraw& rvalue) = delete;
RandomStraw& operator=(RandomStraw const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ template <class T> class IndexClass
NodeElement const* Archive;

//-------------------------------------------------------------------------------------
IndexClass(IndexClass const& rvalue);
IndexClass* operator=(IndexClass const& rvalue);
IndexClass(IndexClass const& rvalue) = delete;
IndexClass* operator=(IndexClass const& rvalue) = delete;

/*
** Increase size of internal index table by amount specified.
Expand Down
4 changes: 2 additions & 2 deletions common/shapipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class SHAPipe : public Pipe
SHAEngine SHA;

private:
SHAPipe(SHAPipe& rvalue);
SHAPipe& operator=(SHAPipe const& pipe);
SHAPipe(SHAPipe& rvalue) = delete;
SHAPipe& operator=(SHAPipe const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/shastraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class SHAStraw : public Straw
SHAEngine SHA;

private:
SHAStraw(SHAStraw& rvalue);
SHAStraw& operator=(SHAStraw const& straw);
SHAStraw(SHAStraw& rvalue) = delete;
SHAStraw& operator=(SHAStraw const& straw) = delete;
};

#endif
4 changes: 2 additions & 2 deletions common/straw.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class Straw
/*
** Disable the copy constructor and assignment operator.
*/
Straw(Straw& rvalue);
Straw& operator=(Straw const& pipe);
Straw(Straw& rvalue) = delete;
Straw& operator=(Straw const& pipe) = delete;
};

#endif
8 changes: 4 additions & 4 deletions common/xpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class BufferPipe : public Pipe
{
return (BufferPtr.Is_Valid());
}
BufferPipe(BufferPipe& rvalue);
BufferPipe& operator=(BufferPipe const& pipe);
BufferPipe(BufferPipe& rvalue) = delete;
BufferPipe& operator=(BufferPipe const& pipe) = delete;
};

/*
Expand Down Expand Up @@ -105,8 +105,8 @@ class FilePipe : public Pipe
{
return (File != NULL);
}
FilePipe(FilePipe& rvalue);
FilePipe& operator=(FilePipe const& pipe);
FilePipe(FilePipe& rvalue) = delete;
FilePipe& operator=(FilePipe const& pipe) = delete;
};

#endif
8 changes: 4 additions & 4 deletions common/xstraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class BufferStraw : public Straw
{
return (BufferPtr.Is_Valid());
}
BufferStraw(BufferStraw& rvalue);
BufferStraw& operator=(BufferStraw const& pipe);
BufferStraw(BufferStraw& rvalue) = delete;
BufferStraw& operator=(BufferStraw const& pipe) = delete;
};

/*
Expand Down Expand Up @@ -101,8 +101,8 @@ class FileStraw : public Straw
{
return (File != NULL);
}
FileStraw(FileStraw& rvalue);
FileStraw& operator=(FileStraw const& pipe);
FileStraw(FileStraw& rvalue) = delete;
FileStraw& operator=(FileStraw const& pipe) = delete;
};

#endif
4 changes: 2 additions & 2 deletions redalert/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ class FixedHeapClass

private:
// The assignment operator is not supported.
FixedHeapClass& operator=(FixedHeapClass const&);
FixedHeapClass& operator=(FixedHeapClass const&) = delete;

// The copy constructor is not supported.
FixedHeapClass(FixedHeapClass const&);
FixedHeapClass(FixedHeapClass const&) = delete;
};

/**************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions tiberiandawn/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class FixedHeapClass

private:
// The assignment operator is not supported.
FixedHeapClass& operator=(FixedHeapClass const&);
FixedHeapClass& operator=(FixedHeapClass const&) = delete;

// The copy constructor is not supported.
FixedHeapClass(FixedHeapClass const&);
FixedHeapClass(FixedHeapClass const&) = delete;
};

/**************************************************************************
Expand Down

0 comments on commit 6f1bf9a

Please sign in to comment.