Use more empty names for unused parameters.

This commit is contained in:
levlam 2023-05-05 14:18:46 +03:00
parent c0911577f7
commit dbcf3e5eec
5 changed files with 38 additions and 38 deletions

View File

@ -410,7 +410,7 @@ class Td final : public Actor {
static bool is_preauthentication_request(int32 id);
template <class T>
void on_request(uint64 id, const T &request) = delete;
void on_request(uint64 id, const T &) = delete;
void on_request(uint64 id, const td_api::setTdlibParameters &request);

View File

@ -30,7 +30,7 @@ class MutableSlice {
MutableSlice(char *s, char *t);
MutableSlice(unsigned char *s, unsigned char *t);
template <size_t N>
constexpr MutableSlice(char (&a)[N]) = delete;
constexpr MutableSlice(char (&)[N]) = delete;
bool empty() const;
size_t size() const;
@ -84,16 +84,16 @@ class Slice {
Slice(const unsigned char *s, const unsigned char *t);
template <size_t N>
constexpr Slice(char (&a)[N]) = delete;
constexpr Slice(char (&)[N]) = delete;
template <size_t N>
constexpr Slice(const char (&a)[N]) : s_(a), len_(N - 1) {
}
Slice &operator=(string &&s) = delete;
Slice &operator=(string &&) = delete;
template <size_t N>
constexpr Slice &operator=(char (&a)[N]) = delete;
constexpr Slice &operator=(char (&)[N]) = delete;
template <size_t N>
constexpr Slice &operator=(const char (&a)[N]) {
@ -149,7 +149,7 @@ class MutableCSlice : public MutableSlice {
MutableCSlice(char *s, char *t);
template <size_t N>
constexpr MutableCSlice(char (&a)[N]) = delete;
constexpr MutableCSlice(char (&)[N]) = delete;
const char *c_str() const {
return begin();
@ -180,7 +180,7 @@ class CSlice : public Slice {
CSlice(const char *s, const char *t);
template <size_t N>
constexpr CSlice(char (&a)[N]) = delete;
constexpr CSlice(char (&)[N]) = delete;
template <size_t N>
constexpr CSlice(const char (&a)[N]) : Slice(a) {
@ -189,10 +189,10 @@ class CSlice : public Slice {
CSlice() : CSlice("") {
}
CSlice &operator=(string &&s) = delete;
CSlice &operator=(string &&) = delete;
template <size_t N>
constexpr CSlice &operator=(char (&a)[N]) = delete;
constexpr CSlice &operator=(char (&)[N]) = delete;
template <size_t N>
constexpr CSlice &operator=(const char (&a)[N]) {

View File

@ -21,17 +21,17 @@ class As {
explicit As(void *ptr) : ptr_(ptr) {
}
As(const As &new_value) = delete;
As(const As &) = delete;
As &operator=(const As &) = delete;
As(As &&) = default;
As &operator=(As &&new_value) && noexcept {
std::memcpy(ptr_, new_value.ptr_, sizeof(T));
As &operator=(As &&other) && noexcept {
std::memcpy(ptr_, other.ptr_, sizeof(T));
return *this;
}
~As() = default;
As &operator=(const T &new_value) && {
std::memcpy(ptr_, &new_value, sizeof(T));
As &operator=(const T &other) && {
std::memcpy(ptr_, &other, sizeof(T));
return *this;
}

View File

@ -319,10 +319,10 @@ class Evp {
ctx_ = EVP_CIPHER_CTX_new();
LOG_IF(FATAL, ctx_ == nullptr);
}
Evp(const Evp &from) = delete;
Evp &operator=(const Evp &from) = delete;
Evp(Evp &&from) = delete;
Evp &operator=(Evp &&from) = delete;
Evp(const Evp &) = delete;
Evp &operator=(const Evp &) = delete;
Evp(Evp &&) = delete;
Evp &operator=(Evp &&) = delete;
~Evp() {
CHECK(ctx_ != nullptr);
EVP_CIPHER_CTX_free(ctx_);
@ -436,8 +436,8 @@ struct AesState::Impl {
};
AesState::AesState() = default;
AesState::AesState(AesState &&from) noexcept = default;
AesState &AesState::operator=(AesState &&from) noexcept = default;
AesState::AesState(AesState &&) noexcept = default;
AesState &AesState::operator=(AesState &&) noexcept = default;
AesState::~AesState() = default;
void AesState::init(Slice key, bool encrypt) {
@ -555,8 +555,8 @@ class AesIgeStateImpl {
};
AesIgeState::AesIgeState() = default;
AesIgeState::AesIgeState(AesIgeState &&from) noexcept = default;
AesIgeState &AesIgeState::operator=(AesIgeState &&from) noexcept = default;
AesIgeState::AesIgeState(AesIgeState &&) noexcept = default;
AesIgeState &AesIgeState::operator=(AesIgeState &&) noexcept = default;
AesIgeState::~AesIgeState() = default;
void AesIgeState::init(Slice key, Slice iv, bool encrypt) {
@ -620,8 +620,8 @@ AesCbcState::AesCbcState(Slice key256, Slice iv128) : raw_{SecureString(key256),
CHECK(raw_.iv.size() == 16);
}
AesCbcState::AesCbcState(AesCbcState &&from) noexcept = default;
AesCbcState &AesCbcState::operator=(AesCbcState &&from) noexcept = default;
AesCbcState::AesCbcState(AesCbcState &&) noexcept = default;
AesCbcState &AesCbcState::operator=(AesCbcState &&) noexcept = default;
AesCbcState::~AesCbcState() = default;
void AesCbcState::encrypt(Slice from, MutableSlice to) {
@ -674,8 +674,8 @@ struct AesCtrState::Impl {
};
AesCtrState::AesCtrState() = default;
AesCtrState::AesCtrState(AesCtrState &&from) noexcept = default;
AesCtrState &AesCtrState::operator=(AesCtrState &&from) noexcept = default;
AesCtrState::AesCtrState(AesCtrState &&) noexcept = default;
AesCtrState &AesCtrState::operator=(AesCtrState &&) noexcept = default;
AesCtrState::~AesCtrState() = default;
void AesCtrState::init(Slice key, Slice iv) {
@ -828,10 +828,10 @@ class Sha256State::Impl {
~Impl() = default;
#endif
Impl(const Impl &from) = delete;
Impl &operator=(const Impl &from) = delete;
Impl(Impl &&from) = delete;
Impl &operator=(Impl &&from) = delete;
Impl(const Impl &) = delete;
Impl &operator=(const Impl &) = delete;
Impl(Impl &&) = delete;
Impl &operator=(Impl &&) = delete;
};
Sha256State::Sha256State() = default;

View File

@ -24,8 +24,8 @@ int pq_factorize(Slice pq_str, string *p_str, string *q_str);
class AesState {
public:
AesState();
AesState(const AesState &from) = delete;
AesState &operator=(const AesState &from) = delete;
AesState(const AesState &) = delete;
AesState &operator=(const AesState &) = delete;
AesState(AesState &&from) noexcept;
AesState &operator=(AesState &&from) noexcept;
~AesState();
@ -49,8 +49,8 @@ class AesIgeStateImpl;
class AesIgeState {
public:
AesIgeState();
AesIgeState(const AesIgeState &from) = delete;
AesIgeState &operator=(const AesIgeState &from) = delete;
AesIgeState(const AesIgeState &) = delete;
AesIgeState &operator=(const AesIgeState &) = delete;
AesIgeState(AesIgeState &&from) noexcept;
AesIgeState &operator=(AesIgeState &&from) noexcept;
~AesIgeState();
@ -71,8 +71,8 @@ void aes_cbc_decrypt(Slice aes_key, MutableSlice aes_iv, Slice from, MutableSlic
class AesCtrState {
public:
AesCtrState();
AesCtrState(const AesCtrState &from) = delete;
AesCtrState &operator=(const AesCtrState &from) = delete;
AesCtrState(const AesCtrState &) = delete;
AesCtrState &operator=(const AesCtrState &) = delete;
AesCtrState(AesCtrState &&from) noexcept;
AesCtrState &operator=(AesCtrState &&from) noexcept;
~AesCtrState();
@ -91,8 +91,8 @@ class AesCtrState {
class AesCbcState {
public:
AesCbcState(Slice key256, Slice iv128);
AesCbcState(const AesCbcState &from) = delete;
AesCbcState &operator=(const AesCbcState &from) = delete;
AesCbcState(const AesCbcState &) = delete;
AesCbcState &operator=(const AesCbcState &) = delete;
AesCbcState(AesCbcState &&from) noexcept;
AesCbcState &operator=(AesCbcState &&from) noexcept;
~AesCbcState();