summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/assert.h2
-rw-r--r--Libraries/LibC/sched.cpp6
-rw-r--r--Libraries/LibC/stdio.cpp6
-rw-r--r--Libraries/LibC/stdlib.cpp12
-rw-r--r--Libraries/LibC/stdlib.h6
-rw-r--r--Libraries/LibC/syslog.cpp2
-rw-r--r--Libraries/LibC/syslog.h6
-rw-r--r--Libraries/LibC/termcap.cpp15
-rw-r--r--Libraries/LibC/termios.cpp4
-rw-r--r--Libraries/LibC/ulimit.cpp8
-rw-r--r--Libraries/LibC/unistd.cpp12
-rw-r--r--Libraries/LibChess/Chess.cpp3
-rw-r--r--Libraries/LibChess/UCICommand.cpp3
-rw-r--r--Libraries/LibELF/DynamicLoader.cpp4
-rw-r--r--Libraries/LibGUI/JSSyntaxHighlighter.cpp3
-rw-r--r--Libraries/LibGfx/Bitmap.cpp7
-rw-r--r--Libraries/LibGfx/PBMLoader.cpp4
-rw-r--r--Libraries/LibGfx/PGMLoader.cpp4
-rw-r--r--Libraries/LibGfx/PPMLoader.cpp4
-rw-r--r--Libraries/LibHTTP/Job.cpp3
-rw-r--r--Libraries/LibIPC/Decoder.cpp5
-rw-r--r--Libraries/LibJS/Forward.h2
-rw-r--r--Libraries/LibJS/Runtime/Accessor.h2
-rw-r--r--Libraries/LibJS/Runtime/IteratorOperations.cpp3
-rw-r--r--Libraries/LibJS/Runtime/VM.h5
-rw-r--r--Libraries/LibLine/Editor.cpp2
-rw-r--r--Libraries/LibPthread/pthread.cpp10
-rw-r--r--Libraries/LibPthread/pthread.h6
-rw-r--r--Libraries/LibPthread/pthread_once.cpp2
-rw-r--r--Libraries/LibWeb/Bindings/WindowObject.cpp1
-rw-r--r--Libraries/LibWeb/DOM/EventDispatcher.cpp5
-rw-r--r--Libraries/LibWeb/DOM/Window.cpp4
-rw-r--r--Libraries/LibWeb/Page/EventHandler.cpp3
-rw-r--r--Libraries/LibWeb/TreeNode.h6
34 files changed, 58 insertions, 112 deletions
diff --git a/Libraries/LibC/assert.h b/Libraries/LibC/assert.h
index 84e2d779fc..d1e1041e54 100644
--- a/Libraries/LibC/assert.h
+++ b/Libraries/LibC/assert.h
@@ -41,7 +41,7 @@ __attribute__((noreturn)) void __assertion_failed(const char* msg);
} while (0)
# define ASSERT_NOT_REACHED() assert(false)
#else
-# define assert(expr) ((void)0)
+# define assert(expr) (void(0))
# define ASSERT_NOT_REACHED() CRASH()
#endif
diff --git a/Libraries/LibC/sched.cpp b/Libraries/LibC/sched.cpp
index f0dbe73ca1..4e3643bd01 100644
--- a/Libraries/LibC/sched.cpp
+++ b/Libraries/LibC/sched.cpp
@@ -36,15 +36,13 @@ int sched_yield()
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int sched_get_priority_min(int policy)
+int sched_get_priority_min([[maybe_unused]] int policy)
{
- (void)policy;
return 0; // Idle
}
-int sched_get_priority_max(int policy)
+int sched_get_priority_max([[maybe_unused]] int policy)
{
- (void)policy;
return 3; // High
}
diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp
index 02f8b76702..76d1ffe860 100644
--- a/Libraries/LibC/stdio.cpp
+++ b/Libraries/LibC/stdio.cpp
@@ -1179,15 +1179,13 @@ int vfscanf(FILE* stream, const char* fmt, va_list ap)
return vsscanf(buffer, fmt, ap);
}
-void flockfile(FILE* filehandle)
+void flockfile([[maybe_unused]] FILE* filehandle)
{
- (void)filehandle;
dbgprintf("FIXME: Implement flockfile()\n");
}
-void funlockfile(FILE* filehandle)
+void funlockfile([[maybe_unused]] FILE* filehandle)
{
- (void)filehandle;
dbgprintf("FIXME: Implement funlockfile()\n");
}
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp
index 0e127d8957..c24f7f878f 100644
--- a/Libraries/LibC/stdlib.cpp
+++ b/Libraries/LibC/stdlib.cpp
@@ -804,11 +804,9 @@ size_t mbstowcs(wchar_t*, const char*, size_t)
ASSERT_NOT_REACHED();
}
-int mbtowc(wchar_t* wch, const char* data, size_t data_size)
+int mbtowc(wchar_t* wch, const char* data, [[maybe_unused]] size_t data_size)
{
// FIXME: This needs a real implementation.
- UNUSED_PARAM(data_size);
-
if (wch && data) {
*wch = *data;
return 1;
@@ -1023,7 +1021,7 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
// Serenity's PRNG is not cryptographically secure. Do not rely on this for
// any real crypto! These functions (for now) are for compatibility.
// TODO: In the future, rand can be made deterministic and this not.
-uint32_t arc4random(void)
+uint32_t arc4random()
{
char buf[4];
syscall(SC_getrandom, buf, 4, 0);
@@ -1073,15 +1071,13 @@ int posix_openpt(int flags)
return open("/dev/ptmx", flags);
}
-int grantpt(int fd)
+int grantpt([[maybe_unused]] int fd)
{
- (void)fd;
return 0;
}
-int unlockpt(int fd)
+int unlockpt([[maybe_unused]] int fd)
{
- (void)fd;
return 0;
}
}
diff --git a/Libraries/LibC/stdlib.h b/Libraries/LibC/stdlib.h
index 735e62e36a..2c225809d2 100644
--- a/Libraries/LibC/stdlib.h
+++ b/Libraries/LibC/stdlib.h
@@ -41,13 +41,13 @@ __BEGIN_DECLS
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
size_t malloc_size(void*);
-void serenity_dump_malloc_stats(void);
+void serenity_dump_malloc_stats();
void free(void*);
__attribute__((alloc_size(2))) void* realloc(void* ptr, size_t);
char* getenv(const char* name);
int putenv(char*);
int unsetenv(const char*);
-int clearenv(void);
+int clearenv();
int setenv(const char* name, const char* value, int overwrite);
int atoi(const char*);
long atol(const char*);
@@ -87,7 +87,7 @@ void srand(unsigned seed);
long int random();
void srandom(unsigned seed);
-uint32_t arc4random(void);
+uint32_t arc4random();
void arc4random_buf(void*, size_t);
uint32_t arc4random_uniform(uint32_t);
diff --git a/Libraries/LibC/syslog.cpp b/Libraries/LibC/syslog.cpp
index 650347da96..8dca066f2e 100644
--- a/Libraries/LibC/syslog.cpp
+++ b/Libraries/LibC/syslog.cpp
@@ -94,7 +94,7 @@ void closelog_r(struct syslog_data* data)
data->maskpri = LOG_UPTO(LOG_DEBUG);
}
-void closelog(void)
+void closelog()
{
closelog_r(&global_log_data);
}
diff --git a/Libraries/LibC/syslog.h b/Libraries/LibC/syslog.h
index 77f3e419eb..2eeb4b569d 100644
--- a/Libraries/LibC/syslog.h
+++ b/Libraries/LibC/syslog.h
@@ -61,8 +61,8 @@ struct syslog_data {
#define LOG_DAEMON ( 3 << 3)
#define LOG_AUTH ( 4 << 3)
#define LOG_SYSLOG ( 5 << 3)
-#define LOG_LPR ( 6 << 3)
-#define LOG_NEWS ( 7 << 3)
+#define LOG_LPR ( 6 << 3)
+#define LOG_NEWS ( 7 << 3)
#define LOG_UUCP ( 8 << 3)
#define LOG_CRON ( 9 << 3)
#define LOG_AUTHPRIV (10 << 3)
@@ -169,7 +169,7 @@ void vsyslog(int, const char* message, va_list);
void vsyslog_r(int, struct syslog_data* data, const char* message, va_list);
void openlog(const char*, int, int);
void openlog_r(const char*, int, int, struct syslog_data*);
-void closelog(void);
+void closelog();
void closelog_r(struct syslog_data*);
int setlogmask(int);
int setlogmask_r(int, struct syslog_data*);
diff --git a/Libraries/LibC/termcap.cpp b/Libraries/LibC/termcap.cpp
index 370919688e..47f88a7fe5 100644
--- a/Libraries/LibC/termcap.cpp
+++ b/Libraries/LibC/termcap.cpp
@@ -39,10 +39,8 @@ char PC;
char* UP;
char* BC;
-int tgetent(char* bp, const char* name)
+int tgetent([[maybe_unused]] char* bp, [[maybe_unused]] const char* name)
{
- (void)bp;
- (void)name;
#ifdef TERMCAP_DEBUG
fprintf(stderr, "tgetent: bp=%p, name='%s'\n", bp, name);
#endif
@@ -120,9 +118,8 @@ char* tgetstr(const char* id, char** area)
#pragma GCC diagnostic pop
-int tgetflag(const char* id)
+int tgetflag([[maybe_unused]] const char* id)
{
- (void)id;
#ifdef TERMCAP_DEBUG
fprintf(stderr, "tgetflag: '%s'\n", id);
#endif
@@ -143,17 +140,13 @@ int tgetnum(const char* id)
ASSERT_NOT_REACHED();
}
-char* tgoto(const char* cap, int col, int row)
+char* tgoto([[maybe_unused]] const char* cap, [[maybe_unused]] int col, [[maybe_unused]] int row)
{
- (void)cap;
- (void)col;
- (void)row;
ASSERT_NOT_REACHED();
}
-int tputs(const char* str, int affcnt, int (*putc)(int))
+int tputs(const char* str, [[maybe_unused]] int affcnt, int (*putc)(int))
{
- (void)affcnt;
size_t len = strlen(str);
for (size_t i = 0; i < len; ++i)
putc(str[i]);
diff --git a/Libraries/LibC/termios.cpp b/Libraries/LibC/termios.cpp
index e1cf4d15ad..1ccd5cb653 100644
--- a/Libraries/LibC/termios.cpp
+++ b/Libraries/LibC/termios.cpp
@@ -51,10 +51,8 @@ int tcsetattr(int fd, int optional_actions, const struct termios* t)
return -1;
}
-int tcflow(int fd, int action)
+int tcflow([[maybe_unused]] int fd, [[maybe_unused]] int action)
{
- (void)fd;
- (void)action;
ASSERT_NOT_REACHED();
}
diff --git a/Libraries/LibC/ulimit.cpp b/Libraries/LibC/ulimit.cpp
index 8bff47a578..0bd284c538 100644
--- a/Libraries/LibC/ulimit.cpp
+++ b/Libraries/LibC/ulimit.cpp
@@ -31,18 +31,14 @@
extern "C" {
-long ulimit(int cmd, long newlimit)
+long ulimit([[maybe_unused]] int cmd, [[maybe_unused]] long newlimit)
{
- (void)cmd;
- (void)newlimit;
ASSERT_NOT_REACHED();
return -1;
}
-int getrusage(int who, struct rusage* usage)
+int getrusage([[maybe_unused]] int who, [[maybe_unused]] struct rusage* usage)
{
- (void)who;
- (void)usage;
dbg() << "LibC: getrusage is not implemented";
return -1;
}
diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp
index da88bef354..edcedd20de 100644
--- a/Libraries/LibC/unistd.cpp
+++ b/Libraries/LibC/unistd.cpp
@@ -515,11 +515,8 @@ int mknod(const char* pathname, mode_t mode, dev_t dev)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-long fpathconf(int fd, int name)
+long fpathconf([[maybe_unused]] int fd, [[maybe_unused]] int name)
{
- (void)fd;
- (void)name;
-
switch (name) {
case _PC_PATH_MAX:
return PATH_MAX;
@@ -530,10 +527,8 @@ long fpathconf(int fd, int name)
ASSERT_NOT_REACHED();
}
-long pathconf(const char* path, int name)
+long pathconf([[maybe_unused]] const char* path, int name)
{
- (void)path;
-
switch (name) {
case _PC_PATH_MAX:
return PATH_MAX;
@@ -614,9 +609,8 @@ void sysbeep()
syscall(SC_beep);
}
-int fsync(int fd)
+int fsync([[maybe_unused]] int fd)
{
- UNUSED_PARAM(fd);
dbgprintf("FIXME: Implement fsync()\n");
return 0;
}
diff --git a/Libraries/LibChess/Chess.cpp b/Libraries/LibChess/Chess.cpp
index ccd9b02769..c8d21bdc93 100644
--- a/Libraries/LibChess/Chess.cpp
+++ b/Libraries/LibChess/Chess.cpp
@@ -770,8 +770,7 @@ Board::Result Board::game_result() const
return Result::InsufficientMaterial;
bool are_legal_moves = false;
- generate_moves([&](Move m) {
- (void)m;
+ generate_moves([&]([[maybe_unused]] Move m) {
are_legal_moves = true;
return IterationDecision::Break;
});
diff --git a/Libraries/LibChess/UCICommand.cpp b/Libraries/LibChess/UCICommand.cpp
index 056a65b39d..3676c52efe 100644
--- a/Libraries/LibChess/UCICommand.cpp
+++ b/Libraries/LibChess/UCICommand.cpp
@@ -316,9 +316,8 @@ String BestMoveCommand::to_string() const
return builder.build();
}
-InfoCommand InfoCommand::from_string(const StringView& command)
+InfoCommand InfoCommand::from_string([[maybe_unused]] const StringView& command)
{
- (void)command;
// FIXME: Implement this.
ASSERT_NOT_REACHED();
}
diff --git a/Libraries/LibELF/DynamicLoader.cpp b/Libraries/LibELF/DynamicLoader.cpp
index c238a15c41..dd19a687a5 100644
--- a/Libraries/LibELF/DynamicLoader.cpp
+++ b/Libraries/LibELF/DynamicLoader.cpp
@@ -391,7 +391,7 @@ void DynamicLoader::do_relocations(size_t total_tls_size)
// Eagerly BIND_NOW the PLT entries, doing all the symbol looking goodness
// The patch method returns the address for the LAZY fixup path, but we don't need it here
VERBOSE("patching plt reloaction: 0x%x\n", relocation.offset_in_section());
- (void)m_dynamic_object->patch_plt_entry(relocation.offset_in_section());
+ [[maybe_unused]] auto rc = m_dynamic_object->patch_plt_entry(relocation.offset_in_section());
} else {
// LAZY-ily bind the PLT slots by just adding the base address to the offsets stored there
// This avoids doing symbol lookup, which might be expensive
@@ -408,7 +408,7 @@ void DynamicLoader::do_relocations(size_t total_tls_size)
}
// Defined in <arch>/plt_trampoline.S
-extern "C" void _plt_trampoline(void) __attribute__((visibility("hidden")));
+extern "C" void _plt_trampoline() __attribute__((visibility("hidden")));
void DynamicLoader::setup_plt_trampoline()
{
diff --git a/Libraries/LibGUI/JSSyntaxHighlighter.cpp b/Libraries/LibGUI/JSSyntaxHighlighter.cpp
index 064be7069e..d2843897b9 100644
--- a/Libraries/LibGUI/JSSyntaxHighlighter.cpp
+++ b/Libraries/LibGUI/JSSyntaxHighlighter.cpp
@@ -63,9 +63,8 @@ bool JSSyntaxHighlighter::is_identifier(void* token) const
return js_token == JS::TokenType::Identifier;
}
-bool JSSyntaxHighlighter::is_navigatable(void* token) const
+bool JSSyntaxHighlighter::is_navigatable([[maybe_unused]] void* token) const
{
- (void)token;
return false;
}
diff --git a/Libraries/LibGfx/Bitmap.cpp b/Libraries/LibGfx/Bitmap.cpp
index 259077d5a7..f03851248b 100644
--- a/Libraries/LibGfx/Bitmap.cpp
+++ b/Libraries/LibGfx/Bitmap.cpp
@@ -364,13 +364,11 @@ Bitmap::~Bitmap()
delete[] m_palette;
}
-void Bitmap::set_mmap_name(const StringView& name)
+void Bitmap::set_mmap_name([[maybe_unused]] const StringView& name)
{
ASSERT(m_needs_munmap);
#ifdef __serenity__
::set_mmap_name(m_data, size_in_bytes(), name.to_string().characters());
-#else
- (void)name;
#endif
}
@@ -431,7 +429,7 @@ ShareableBitmap Bitmap::to_shareable_bitmap(pid_t peer_pid) const
return ShareableBitmap(*bitmap);
}
-Optional<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, const IntSize& size, Purgeable purgeable)
+Optional<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, const IntSize& size, [[maybe_unused]] Purgeable purgeable)
{
if (size_would_overflow(format, size))
return {};
@@ -444,7 +442,6 @@ Optional<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, const
int map_flags = purgeable == Purgeable::Yes ? (MAP_PURGEABLE | MAP_PRIVATE) : (MAP_ANONYMOUS | MAP_PRIVATE);
data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, String::format("GraphicsBitmap [%dx%d]", size.width(), size.height()).characters());
#else
- UNUSED_PARAM(purgeable);
int map_flags = (MAP_ANONYMOUS | MAP_PRIVATE);
data = mmap(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0);
#endif
diff --git a/Libraries/LibGfx/PBMLoader.cpp b/Libraries/LibGfx/PBMLoader.cpp
index 9aeba49c07..4fe1022c7a 100644
--- a/Libraries/LibGfx/PBMLoader.cpp
+++ b/Libraries/LibGfx/PBMLoader.cpp
@@ -118,10 +118,8 @@ static int read_number(Streamer& streamer)
return sb.to_string().to_uint().value_or(0);
}
-static bool read_comment(PBMLoadingContext& context, Streamer& streamer)
+static bool read_comment([[maybe_unused]] PBMLoadingContext& context, Streamer& streamer)
{
- (void)context;
-
bool exist = false;
u8 byte;
diff --git a/Libraries/LibGfx/PGMLoader.cpp b/Libraries/LibGfx/PGMLoader.cpp
index 646a17aef5..3f814c7975 100644
--- a/Libraries/LibGfx/PGMLoader.cpp
+++ b/Libraries/LibGfx/PGMLoader.cpp
@@ -135,10 +135,8 @@ static bool read_number(Streamer& streamer, u16* value)
return true;
}
-static bool read_comment(PGMLoadingContext& context, Streamer& streamer)
+static bool read_comment([[maybe_unused]] PGMLoadingContext& context, Streamer& streamer)
{
- (void)context;
-
bool exist = false;
u8 byte;
diff --git a/Libraries/LibGfx/PPMLoader.cpp b/Libraries/LibGfx/PPMLoader.cpp
index 3ada07f73c..cfafb090eb 100644
--- a/Libraries/LibGfx/PPMLoader.cpp
+++ b/Libraries/LibGfx/PPMLoader.cpp
@@ -138,10 +138,8 @@ static bool read_number(Streamer& streamer, u16* value)
return true;
}
-static bool read_comment(PPMLoadingContext& context, Streamer& streamer)
+static bool read_comment([[maybe_unused]] PPMLoadingContext& context, Streamer& streamer)
{
- (void)context;
-
bool exist = false;
u8 byte;
diff --git a/Libraries/LibHTTP/Job.cpp b/Libraries/LibHTTP/Job.cpp
index 5f422e002d..7996d52157 100644
--- a/Libraries/LibHTTP/Job.cpp
+++ b/Libraries/LibHTTP/Job.cpp
@@ -271,11 +271,10 @@ void Job::on_socket_connected()
// we've read everything, now let's get the next chunk
size = -1;
- auto line = read_line(PAGE_SIZE);
+ [[maybe_unused]] auto line = read_line(PAGE_SIZE);
#ifdef JOB_DEBUG
dbg() << "Line following (should be empty): _" << line << "_";
#endif
- (void)line;
}
m_current_chunk_remaining_size = size;
}
diff --git a/Libraries/LibIPC/Decoder.cpp b/Libraries/LibIPC/Decoder.cpp
index 438c1ddbb5..ff980bdaa5 100644
--- a/Libraries/LibIPC/Decoder.cpp
+++ b/Libraries/LibIPC/Decoder.cpp
@@ -166,7 +166,7 @@ bool Decoder::decode(Dictionary& dictionary)
return true;
}
-bool Decoder::decode(File& file)
+bool Decoder::decode([[maybe_unused]] File& file)
{
#ifdef __serenity__
int fd = recvfd(m_sockfd);
@@ -177,8 +177,7 @@ bool Decoder::decode(File& file)
file = File(fd);
return true;
#else
- (void)file;
- (void)m_sockfd;
+ [[maybe_unused]] auto fd = m_sockfd;
warnln("fd passing is not supported on this platform, sorry :(");
return false;
#endif
diff --git a/Libraries/LibJS/Forward.h b/Libraries/LibJS/Forward.h
index bb6412f506..40c37ad4bd 100644
--- a/Libraries/LibJS/Forward.h
+++ b/Libraries/LibJS/Forward.h
@@ -42,7 +42,7 @@
JS::Value name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object)
#define JS_DEFINE_NATIVE_SETTER(name) \
- void name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object, JS::Value value)
+ void name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object, [[maybe_unused]] JS::Value value)
// NOTE: Proxy is not included here as it doesn't have a prototype - m_proxy_constructor is initialized separately.
#define JS_ENUMERATE_NATIVE_OBJECTS_EXCLUDING_TEMPLATES \
diff --git a/Libraries/LibJS/Runtime/Accessor.h b/Libraries/LibJS/Runtime/Accessor.h
index 4e57f918b4..ce2d9efb57 100644
--- a/Libraries/LibJS/Runtime/Accessor.h
+++ b/Libraries/LibJS/Runtime/Accessor.h
@@ -63,7 +63,7 @@ public:
if (!m_setter)
return;
// FIXME: It might be nice if we had a way to communicate to our caller if an exception happened after this.
- (void)vm().call(*m_setter, this_value, setter_value);
+ [[maybe_unused]] auto rc = vm().call(*m_setter, this_value, setter_value);
}
void visit_edges(Cell::Visitor& visitor) override
diff --git a/Libraries/LibJS/Runtime/IteratorOperations.cpp b/Libraries/LibJS/Runtime/IteratorOperations.cpp
index 32c1c00e83..ee6a8ed057 100644
--- a/Libraries/LibJS/Runtime/IteratorOperations.cpp
+++ b/Libraries/LibJS/Runtime/IteratorOperations.cpp
@@ -87,9 +87,8 @@ Object* iterator_next(Object& iterator, Value value)
return &result.as_object();
}
-void iterator_close(Object& iterator)
+void iterator_close([[maybe_unused]] Object& iterator)
{
- (void)iterator;
TODO();
}
diff --git a/Libraries/LibJS/Runtime/VM.h b/Libraries/LibJS/Runtime/VM.h
index 0b74f28d7b..4021c217dc 100644
--- a/Libraries/LibJS/Runtime/VM.h
+++ b/Libraries/LibJS/Runtime/VM.h
@@ -225,10 +225,7 @@ public:
template<typename... Args>
[[nodiscard]] ALWAYS_INLINE Value call(Function& function, Value this_value, Args... args)
{
- // Are there any values in this argpack?
- // args = [] -> if constexpr (false)
- // args = [x, y, z] -> if constexpr ((void)x, true || ...)
- if constexpr ((((void)args, true) || ...)) {
+ if constexpr (sizeof...(Args) > 0) {
MarkedValueList arglist { heap() };
(..., arglist.append(move(args)));
return call(function, this_value, move(arglist));
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp
index 6ad89695c7..83bd85dd9b 100644
--- a/Libraries/LibLine/Editor.cpp
+++ b/Libraries/LibLine/Editor.cpp
@@ -1480,7 +1480,7 @@ Vector<size_t, 2> Editor::vt_dsr()
do {
more_junk_to_read = false;
- (void)select(1, &readfds, nullptr, nullptr, &timeout);
+ [[maybe_unused]] auto rc = select(1, &readfds, nullptr, nullptr, &timeout);
if (FD_ISSET(0, &readfds)) {
auto nread = read(0, buf, 16);
if (nread < 0) {
diff --git a/Libraries/LibPthread/pthread.cpp b/Libraries/LibPthread/pthread.cpp
index 37f336f7cf..fd53b91fb7 100644
--- a/Libraries/LibPthread/pthread.cpp
+++ b/Libraries/LibPthread/pthread.cpp
@@ -460,19 +460,13 @@ int pthread_attr_setstacksize(pthread_attr_t* attributes, size_t stack_size)
return 0;
}
-int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param)
+int pthread_getschedparam([[maybe_unused]] pthread_t thread, [[maybe_unused]] int* policy, [[maybe_unused]] struct sched_param* param)
{
- (void)thread;
- (void)policy;
- (void)param;
return 0;
}
-int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param)
+int pthread_setschedparam([[maybe_unused]] pthread_t thread, [[maybe_unused]] int policy, [[maybe_unused]] const struct sched_param* param)
{
- (void)thread;
- (void)policy;
- (void)param;
return 0;
}
diff --git a/Libraries/LibPthread/pthread.h b/Libraries/LibPthread/pthread.h
index 5e407ece05..9c6888c233 100644
--- a/Libraries/LibPthread/pthread.h
+++ b/Libraries/LibPthread/pthread.h
@@ -67,7 +67,7 @@ int pthread_attr_setstack(pthread_attr_t* attr, void*, size_t);
int pthread_attr_getstacksize(const pthread_attr_t*, size_t*);
int pthread_attr_setstacksize(pthread_attr_t*, size_t);
-int pthread_once(pthread_once_t*, void (*)(void));
+int pthread_once(pthread_once_t*, void (*)());
#define PTHREAD_ONCE_INIT 0
void* pthread_getspecific(pthread_key_t key);
int pthread_setspecific(pthread_key_t key, const void* value);
@@ -100,14 +100,14 @@ int pthread_cancel(pthread_t);
int pthread_cond_destroy(pthread_cond_t*);
int pthread_cond_timedwait(pthread_cond_t*, pthread_mutex_t*, const struct timespec*);
-void pthread_testcancel(void);
+void pthread_testcancel();
int pthread_spin_destroy(pthread_spinlock_t*);
int pthread_spin_init(pthread_spinlock_t*, int);
int pthread_spin_lock(pthread_spinlock_t*);
int pthread_spin_trylock(pthread_spinlock_t*);
int pthread_spin_unlock(pthread_spinlock_t*);
-pthread_t pthread_self(void);
+pthread_t pthread_self();
int pthread_detach(pthread_t);
int pthread_equal(pthread_t, pthread_t);
int pthread_mutexattr_init(pthread_mutexattr_t*);
diff --git a/Libraries/LibPthread/pthread_once.cpp b/Libraries/LibPthread/pthread_once.cpp
index 141ad4acb7..f46a67e292 100644
--- a/Libraries/LibPthread/pthread_once.cpp
+++ b/Libraries/LibPthread/pthread_once.cpp
@@ -37,7 +37,7 @@ enum State : i32 {
PERFORMING_WITH_WAITERS,
};
-int pthread_once(pthread_once_t* self, void (*callback)(void))
+int pthread_once(pthread_once_t* self, void (*callback)())
{
auto& state = reinterpret_cast<Atomic<State>&>(*self);
diff --git a/Libraries/LibWeb/Bindings/WindowObject.cpp b/Libraries/LibWeb/Bindings/WindowObject.cpp
index 58b2045134..f147a86bf0 100644
--- a/Libraries/LibWeb/Bindings/WindowObject.cpp
+++ b/Libraries/LibWeb/Bindings/WindowObject.cpp
@@ -337,7 +337,6 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::document_getter)
JS_DEFINE_NATIVE_SETTER(WindowObject::document_setter)
{
// FIXME: Figure out what we should do here. Just ignore attempts to set window.document for now.
- UNUSED_PARAM(value);
}
JS_DEFINE_NATIVE_GETTER(WindowObject::performance_getter)
diff --git a/Libraries/LibWeb/DOM/EventDispatcher.cpp b/Libraries/LibWeb/DOM/EventDispatcher.cpp
index 49bcd9a0ee..65376607f8 100644
--- a/Libraries/LibWeb/DOM/EventDispatcher.cpp
+++ b/Libraries/LibWeb/DOM/EventDispatcher.cpp
@@ -48,10 +48,9 @@ namespace Web::DOM {
// FIXME: This shouldn't be here, as retargeting is not only used by the event dispatcher.
// When moving this function, it needs to be generalized. https://dom.spec.whatwg.org/#retarget
-static EventTarget* retarget(EventTarget* left, EventTarget* right)
+static EventTarget* retarget(EventTarget* left, [[maybe_unused]] EventTarget* right)
{
// FIXME
- UNUSED_PARAM(right);
for (;;) {
if (!is<Node>(left))
return left;
@@ -110,7 +109,7 @@ bool EventDispatcher::inner_invoke(Event& event, Vector<EventTarget::EventListen
auto* this_value = Bindings::wrap(global, *event.current_target());
auto* wrapped_event = Bindings::wrap(global, event);
auto& vm = global.vm();
- (void)vm.call(listener.listener->function(), this_value, wrapped_event);
+ [[maybe_unused]] auto rc = vm.call(listener.listener->function(), this_value, wrapped_event);
if (vm.exception()) {
vm.clear_exception();
// FIXME: Set legacyOutputDidListenersThrowFlag if given. (Only used by IndexedDB currently)
diff --git a/Libraries/LibWeb/DOM/Window.cpp b/Libraries/LibWeb/DOM/Window.cpp
index 85fdf89169..d10620bc1e 100644
--- a/Libraries/LibWeb/DOM/Window.cpp
+++ b/Libraries/LibWeb/DOM/Window.cpp
@@ -98,7 +98,7 @@ void Window::timer_did_fire(Badge<Timer>, Timer& timer)
m_timers.remove(timer.id());
}
- (void)vm.call(timer.callback(), wrapper());
+ [[maybe_unused]] auto rc = vm.call(timer.callback(), wrapper());
if (vm.exception())
vm.clear_exception();
}
@@ -132,7 +132,7 @@ i32 Window::request_animation_frame(JS::Function& callback)
auto& function = const_cast<JS::Function&>(static_cast<const JS::Function&>(*handle.cell()));
auto& vm = function.vm();
fake_timestamp += 10;
- (void)vm.call(function, {}, JS::Value(fake_timestamp));
+ [[maybe_unused]] auto rc = vm.call(function, {}, JS::Value(fake_timestamp));
if (vm.exception())
vm.clear_exception();
GUI::DisplayLink::unregister_callback(link_id);
diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp
index e3fa3adfc3..1640f6818b 100644
--- a/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Libraries/LibWeb/Page/EventHandler.cpp
@@ -301,9 +301,8 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
return true;
}
-void EventHandler::dump_selection(const char* event_name) const
+void EventHandler::dump_selection([[maybe_unused]] const char* event_name) const
{
- UNUSED_PARAM(event_name);
#ifdef SELECTION_DEBUG
dbg() << event_name << " selection start: "
<< layout_root()->selection().start().layout_node << ":" << layout_root()->selection().start().index_in_node << ", end: "
diff --git a/Libraries/LibWeb/TreeNode.h b/Libraries/LibWeb/TreeNode.h
index 604dcb6625..f198e4e231 100644
--- a/Libraries/LibWeb/TreeNode.h
+++ b/Libraries/LibWeb/TreeNode.h
@@ -359,7 +359,7 @@ inline void TreeNode<T>::append_child(NonnullRefPtr<T> node, bool notify)
m_first_child = m_last_child;
if (notify)
node->inserted_into(static_cast<T&>(*this));
- (void)node.leak_ref();
+ [[maybe_unused]] auto& rc = node.leak_ref();
if (notify)
static_cast<T*>(this)->children_changed();
@@ -394,7 +394,7 @@ inline void TreeNode<T>::insert_before(NonnullRefPtr<T> node, RefPtr<T> child, b
node->m_parent = static_cast<T*>(this);
if (notify)
node->inserted_into(static_cast<T&>(*this));
- (void)node.leak_ref();
+ [[maybe_unused]] auto& rc = node.leak_ref();
if (notify)
static_cast<T*>(this)->children_changed();
@@ -416,7 +416,7 @@ inline void TreeNode<T>::prepend_child(NonnullRefPtr<T> node)
if (!m_last_child)
m_last_child = m_first_child;
node->inserted_into(static_cast<T&>(*this));
- (void)node.leak_ref();
+ [[maybe_unused]] auto& rc = node.leak_ref();
static_cast<T*>(this)->children_changed();
}