forked from quickshell/quickshell
all: fix gcc warnings
This commit is contained in:
parent
92252c36a3
commit
b528be9426
19 changed files with 57 additions and 22 deletions
|
@ -1,10 +1,24 @@
|
|||
#pragma once
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
#include <qlatin1stringview.h>
|
||||
#include <qobject.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
template <size_t Length>
|
||||
struct StringLiteral {
|
||||
constexpr StringLiteral(const char (&str)[Length]) { // NOLINT
|
||||
std::copy_n(str, Length, this->value);
|
||||
}
|
||||
|
||||
constexpr operator const char*() const noexcept { return this->value; }
|
||||
operator QLatin1StringView() const { return QLatin1String(this->value, Length); }
|
||||
|
||||
char value[Length]; // NOLINT
|
||||
};
|
||||
|
||||
// NOLINTBEGIN
|
||||
#define DROP_EMIT(object, func) \
|
||||
DropEmitter(object, static_cast<void (*)(typeof(object))>([](typeof(object) o) { o->func(); }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue