summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-12 12:56:11 -0700
committerRosen Penev <rosenp@gmail.com>2020-03-16 00:08:21 -0700
commit97425d56e7ad0ce19357b5d8984de082c0dacffc (patch)
treeceff26b07d79daa4fd2f93f2d37007f1f52de8f3 /test
parent0afb156a5bbb23a9602ef3b8188e82e4afe300e4 (diff)
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>
Diffstat (limited to 'test')
-rw-r--r--test/DumpDecoderClient.cxx12
-rw-r--r--test/MakeTag.hxx2
-rw-r--r--test/ReadApeTags.cxx2
-rw-r--r--test/read_mixer.cxx4
-rw-r--r--test/run_avahi.cxx2
-rw-r--r--test/run_convert.cxx4
-rw-r--r--test/run_filter.cxx4
-rw-r--r--test/run_gunzip.cxx2
-rw-r--r--test/run_gzip.cxx2
-rw-r--r--test/run_inotify.cxx4
-rw-r--r--test/run_normalize.cxx2
-rw-r--r--test/software_volume.cxx2
-rw-r--r--test/test_translate_song.cxx6
-rw-r--r--test/test_vorbis_encoder.cxx2
14 files changed, 25 insertions, 25 deletions
diff --git a/test/DumpDecoderClient.cxx b/test/DumpDecoderClient.cxx
index 75a8c44e3..f107cc53a 100644
--- a/test/DumpDecoderClient.cxx
+++ b/test/DumpDecoderClient.cxx
@@ -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());
diff --git a/test/MakeTag.hxx b/test/MakeTag.hxx
index db8cd315f..283519058 100644
--- a/test/MakeTag.hxx
+++ b/test/MakeTag.hxx
@@ -22,7 +22,7 @@
#include "util/Compiler.h"
inline void
-BuildTag(gcc_unused TagBuilder &tag) noexcept
+BuildTag([[maybe_unused]] TagBuilder &tag) noexcept
{
}
diff --git a/test/ReadApeTags.cxx b/test/ReadApeTags.cxx
index 65f56d36a..90f50a46b 100644
--- a/test/ReadApeTags.cxx
+++ b/test/ReadApeTags.cxx
@@ -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)
diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx
index 2afbb4c26..3cf1b1796 100644
--- a/test/read_mixer.cxx
+++ b/test/read_mixer.cxx
@@ -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;
diff --git a/test/run_avahi.cxx b/test/run_avahi.cxx
index 857913f6b..3624fc28a 100644
--- a/test/run_avahi.cxx
+++ b/test/run_avahi.cxx
@@ -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);
diff --git a/test/run_convert.cxx b/test/run_convert.cxx
index 9162c97ce..deb704ce3 100644
--- a/test/run_convert.cxx
+++ b/test/run_convert.cxx
@@ -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);
}
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 7fd2ce327..77c76106a 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -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)
{
}
diff --git a/test/run_gunzip.cxx b/test/run_gunzip.cxx
index e8c51a7b3..fe719bfa4 100644
--- a/test/run_gunzip.cxx
+++ b/test/run_gunzip.cxx
@@ -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");
diff --git a/test/run_gzip.cxx b/test/run_gzip.cxx
index 0a7ac7d11..fccd14356 100644
--- a/test/run_gzip.cxx
+++ b/test/run_gzip.cxx
@@ -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");
diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx
index b76b455f9..6edcbeeaf 100644
--- a/test/run_inotify.cxx
+++ b/test/run_inotify.cxx
@@ -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);
}
diff --git a/test/run_normalize.cxx b/test/run_normalize.cxx
index e4acdc204..db626e955 100644
--- a/test/run_normalize.cxx
+++ b/test/run_normalize.cxx
@@ -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);
diff --git a/test/software_volume.cxx b/test/software_volume.cxx
index e3d3ff56e..e628ba02f 100644
--- a/test/software_volume.cxx
+++ b/test/software_volume.cxx
@@ -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();
diff --git a/test/test_translate_song.cxx b/test/test_translate_song.cxx
index c1f0feaa5..6619066d6 100644
--- a/test/test_translate_song.cxx
+++ b/test/test_translate_song.cxx
@@ -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
diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx
index cf768f1f6..b9c1daddd 100644
--- a/test/test_vorbis_encoder.cxx
+++ b/test/test_vorbis_encoder.cxx
@@ -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 */