mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
refactor: use maybe unused attribute (#1918)
* refactor: replace TR_UNUSED with [[maybe_unused]]
This commit is contained in:
@@ -39,16 +39,12 @@
|
||||
|
||||
#else
|
||||
|
||||
static void sd_notify(int status, char const* str)
|
||||
static void sd_notify([[maybe_unused]] int status, [[maybe_unused]] char const* str)
|
||||
{
|
||||
TR_UNUSED(status);
|
||||
TR_UNUSED(str);
|
||||
}
|
||||
|
||||
static void sd_notifyf(int status, char const* fmt, ...)
|
||||
static void sd_notifyf([[maybe_unused]] int status, [[maybe_unused]] char const* fmt, ...)
|
||||
{
|
||||
TR_UNUSED(status);
|
||||
TR_UNUSED(fmt);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -282,7 +278,13 @@ static tr_watchdir_status onFileAdded(tr_watchdir_t dir, char const* name, void*
|
||||
return err == TR_PARSE_ERR ? TR_WATCHDIR_RETRY : TR_WATCHDIR_ACCEPT;
|
||||
}
|
||||
|
||||
static void printMessage(tr_sys_file_t file, int level, char const* name, char const* message, char const* filename, int line)
|
||||
static void printMessage(
|
||||
tr_sys_file_t file,
|
||||
[[maybe_unused]] int level,
|
||||
char const* name,
|
||||
char const* message,
|
||||
char const* filename,
|
||||
int line)
|
||||
{
|
||||
if (file != TR_BAD_SYS_FILE)
|
||||
{
|
||||
@@ -339,10 +341,6 @@ static void printMessage(tr_sys_file_t file, int level, char const* name, char c
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
TR_UNUSED(level);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -378,26 +376,18 @@ static void reportStatus(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void periodicUpdate(evutil_socket_t fd, short what, void* context)
|
||||
static void periodicUpdate([[maybe_unused]] evutil_socket_t fd, [[maybe_unused]] short what, [[maybe_unused]] void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
TR_UNUSED(context);
|
||||
|
||||
pumpLogMessages(logfile);
|
||||
reportStatus();
|
||||
}
|
||||
|
||||
static tr_rpc_callback_status on_rpc_callback(
|
||||
tr_session* session,
|
||||
[[maybe_unused]] tr_session* session,
|
||||
tr_rpc_callback_type type,
|
||||
struct tr_torrent* tor,
|
||||
void* user_data)
|
||||
[[maybe_unused]] struct tr_torrent* tor,
|
||||
[[maybe_unused]] void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(tor);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
if (type == TR_RPC_SESSION_CLOSE)
|
||||
{
|
||||
event_base_loopexit(ev_base, nullptr);
|
||||
@@ -621,10 +611,8 @@ struct daemon_data
|
||||
bool paused;
|
||||
};
|
||||
|
||||
static void daemon_reconfigure(void* arg)
|
||||
static void daemon_reconfigure([[maybe_unused]] void* arg)
|
||||
{
|
||||
TR_UNUSED(arg);
|
||||
|
||||
if (mySession == nullptr)
|
||||
{
|
||||
tr_logAddInfo("Deferring reload until session is fully started.");
|
||||
@@ -652,19 +640,13 @@ static void daemon_reconfigure(void* arg)
|
||||
}
|
||||
}
|
||||
|
||||
static void daemon_stop(void* arg)
|
||||
static void daemon_stop([[maybe_unused]] void* arg)
|
||||
{
|
||||
TR_UNUSED(arg);
|
||||
|
||||
event_base_loopexit(ev_base, nullptr);
|
||||
}
|
||||
|
||||
static int daemon_start(void* varg, bool foreground)
|
||||
static int daemon_start(void* varg, [[maybe_unused]] bool foreground)
|
||||
{
|
||||
#ifndef HAVE_SYSLOG
|
||||
TR_UNUSED(foreground);
|
||||
#endif
|
||||
|
||||
bool boolVal;
|
||||
char const* pid_filename;
|
||||
bool pidfile_created = false;
|
||||
|
||||
Reference in New Issue
Block a user