remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++. https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused says that this is equivalent to the GNU unused attribute. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -86,26 +86,26 @@ DumpDecoderClient::Read(InputStream &is, void *buffer, size_t length) noexcept
|
||||
}
|
||||
|
||||
void
|
||||
DumpDecoderClient::SubmitTimestamp(gcc_unused FloatDuration t) noexcept
|
||||
DumpDecoderClient::SubmitTimestamp([[maybe_unused]] FloatDuration t) noexcept
|
||||
{
|
||||
}
|
||||
|
||||
DecoderCommand
|
||||
DumpDecoderClient::SubmitData(gcc_unused InputStream *is,
|
||||
DumpDecoderClient::SubmitData([[maybe_unused]] InputStream *is,
|
||||
const void *data, size_t datalen,
|
||||
gcc_unused uint16_t kbit_rate) noexcept
|
||||
[[maybe_unused]] uint16_t kbit_rate) noexcept
|
||||
{
|
||||
if (kbit_rate != prev_kbit_rate) {
|
||||
prev_kbit_rate = kbit_rate;
|
||||
fprintf(stderr, "%u kbit/s\n", kbit_rate);
|
||||
}
|
||||
|
||||
gcc_unused ssize_t nbytes = write(STDOUT_FILENO, data, datalen);
|
||||
[[maybe_unused]] ssize_t nbytes = write(STDOUT_FILENO, data, datalen);
|
||||
return GetCommand();
|
||||
}
|
||||
|
||||
DecoderCommand
|
||||
DumpDecoderClient::SubmitTag(gcc_unused InputStream *is,
|
||||
DumpDecoderClient::SubmitTag([[maybe_unused]] InputStream *is,
|
||||
Tag &&tag) noexcept
|
||||
{
|
||||
fprintf(stderr, "TAG: duration=%f\n", tag.duration.ToDoubleS());
|
||||
@@ -139,7 +139,7 @@ DumpDecoderClient::SubmitReplayGain(const ReplayGainInfo *rgi) noexcept
|
||||
}
|
||||
|
||||
void
|
||||
DumpDecoderClient::SubmitMixRamp(gcc_unused MixRampInfo &&mix_ramp) noexcept
|
||||
DumpDecoderClient::SubmitMixRamp([[maybe_unused]] MixRampInfo &&mix_ramp) noexcept
|
||||
{
|
||||
fprintf(stderr, "MixRamp: start='%s' end='%s'\n",
|
||||
mix_ramp.GetStart(), mix_ramp.GetEnd());
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "util/Compiler.h"
|
||||
|
||||
inline void
|
||||
BuildTag(gcc_unused TagBuilder &tag) noexcept
|
||||
BuildTag([[maybe_unused]] TagBuilder &tag) noexcept
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#endif
|
||||
|
||||
static bool
|
||||
MyApeTagCallback(gcc_unused unsigned long flags,
|
||||
MyApeTagCallback([[maybe_unused]] unsigned long flags,
|
||||
const char *key, StringView value)
|
||||
{
|
||||
if ((flags & (0x3 << 1)) == 0)
|
||||
|
@@ -30,13 +30,13 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
const FilterPlugin *
|
||||
filter_plugin_by_name(gcc_unused const char *name) noexcept
|
||||
filter_plugin_by_name([[maybe_unused]] const char *name) noexcept
|
||||
{
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int main(int argc, gcc_unused char **argv)
|
||||
int main(int argc, [[maybe_unused]] char **argv)
|
||||
try {
|
||||
int volume;
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
unsigned listen_port = 1234;
|
||||
|
||||
int
|
||||
main(gcc_unused int argc, gcc_unused char **argv)
|
||||
main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
|
||||
{
|
||||
EventLoop event_loop;
|
||||
const ShutdownHandler shutdown_handler(event_loop);
|
||||
|
@@ -137,7 +137,7 @@ try {
|
||||
|
||||
auto output = state.Convert({src.data, src.size});
|
||||
|
||||
gcc_unused ssize_t ignored = write(1, output.data,
|
||||
[[maybe_unused]] ssize_t ignored = write(1, output.data,
|
||||
output.size);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ try {
|
||||
if (output.IsNull())
|
||||
break;
|
||||
|
||||
gcc_unused ssize_t ignored = write(1, output.data,
|
||||
[[maybe_unused]] ssize_t ignored = write(1, output.data,
|
||||
output.size);
|
||||
}
|
||||
|
||||
|
@@ -42,8 +42,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
mixer_set_volume(gcc_unused Mixer *mixer,
|
||||
gcc_unused unsigned volume)
|
||||
mixer_set_volume([[maybe_unused]] Mixer *mixer,
|
||||
[[maybe_unused]] unsigned volume)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,7 @@ CopyGunzip(FILE *_dest, Path src_path)
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, gcc_unused char **argv)
|
||||
main(int argc, [[maybe_unused]] char **argv)
|
||||
try {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: run_gunzip PATH\n");
|
||||
|
@@ -59,7 +59,7 @@ CopyGzip(FILE *_dest, int src)
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, gcc_unused char **argv)
|
||||
main(int argc, [[maybe_unused]] char **argv)
|
||||
try {
|
||||
if (argc != 1) {
|
||||
fprintf(stderr, "Usage: run_gzip\n");
|
||||
|
@@ -34,8 +34,8 @@ static constexpr unsigned IN_MASK =
|
||||
|IN_MOVE|IN_MOVE_SELF;
|
||||
|
||||
static void
|
||||
my_inotify_callback(gcc_unused int wd, unsigned mask,
|
||||
const char *name, gcc_unused void *ctx)
|
||||
my_inotify_callback([[maybe_unused]] int wd, unsigned mask,
|
||||
const char *name, [[maybe_unused]] void *ctx)
|
||||
{
|
||||
printf("mask=0x%x name='%s'\n", mask, name);
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ try {
|
||||
Compressor_Process_int16(compressor,
|
||||
(int16_t *)buffer, nbytes / 2);
|
||||
|
||||
gcc_unused ssize_t ignored = write(1, buffer, nbytes);
|
||||
[[maybe_unused]] ssize_t ignored = write(1, buffer, nbytes);
|
||||
}
|
||||
|
||||
Compressor_delete(compressor);
|
||||
|
@@ -58,7 +58,7 @@ try {
|
||||
|
||||
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
|
||||
auto dest = pv.Apply({buffer, size_t(nbytes)});
|
||||
gcc_unused ssize_t ignored = write(1, dest.data, dest.size);
|
||||
[[maybe_unused]] ssize_t ignored = write(1, dest.data, dest.size);
|
||||
}
|
||||
|
||||
pv.Close();
|
||||
|
@@ -85,8 +85,8 @@ static const char *uri1 = "/foo/bar.ogg";
|
||||
static const char *uri2 = "foo/bar.ogg";
|
||||
|
||||
DetachedSong
|
||||
DatabaseDetachSong(gcc_unused const Database &db,
|
||||
gcc_unused const Storage *_storage,
|
||||
DatabaseDetachSong([[maybe_unused]] const Database &db,
|
||||
[[maybe_unused]] const Storage *_storage,
|
||||
const char *uri)
|
||||
{
|
||||
if (strcmp(uri, uri2) == 0)
|
||||
@@ -119,7 +119,7 @@ Client::GetStorage() const noexcept
|
||||
}
|
||||
|
||||
void
|
||||
Client::AllowFile(gcc_unused Path path_fs) const
|
||||
Client::AllowFile([[maybe_unused]] Path path_fs) const
|
||||
{
|
||||
/* always fail, so a SongLoader with a non-nullptr
|
||||
Client pointer will be regarded "insecure", while one with
|
||||
|
@@ -36,7 +36,7 @@
|
||||
static uint8_t zero[256];
|
||||
|
||||
int
|
||||
main(gcc_unused int argc, gcc_unused char **argv)
|
||||
main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
|
||||
try {
|
||||
/* create the encoder */
|
||||
|
||||
|
Reference in New Issue
Block a user