diff options
51 files changed, 142 insertions, 142 deletions
diff --git a/src/MusicBuffer.hxx b/src/MusicBuffer.hxx index 438ade621..b3783a53f 100644 --- a/src/MusicBuffer.hxx +++ b/src/MusicBuffer.hxx @@ -50,7 +50,7 @@ public: * object is inaccessible to other threads. */ bool IsEmptyUnsafe() const { - return buffer.IsEmpty(); + return buffer.empty(); } #endif diff --git a/src/TagFile.cxx b/src/TagFile.cxx index 0bb4c9193..6a0c02968 100644 --- a/src/TagFile.cxx +++ b/src/TagFile.cxx @@ -109,7 +109,7 @@ tag_file_scan(Path path, TagBuilder &builder) if (!tag_file_scan(path, full_tag_handler, &builder)) return false; - if (builder.IsEmpty()) + if (builder.empty()) ScanGenericTags(path, full_tag_handler, &builder); return true; diff --git a/src/TagStream.cxx b/src/TagStream.cxx index 436904dc8..2d7748529 100644 --- a/src/TagStream.cxx +++ b/src/TagStream.cxx @@ -94,7 +94,7 @@ tag_stream_scan(InputStream &is, TagBuilder &builder) if (!tag_stream_scan(is, full_tag_handler, &builder)) return false; - if (builder.IsEmpty()) + if (builder.empty()) ScanGenericTags(is, full_tag_handler, &builder); return true; diff --git a/src/command/ClientCommands.cxx b/src/command/ClientCommands.cxx index c5f70b94d..16d2f1aa3 100644 --- a/src/command/ClientCommands.cxx +++ b/src/command/ClientCommands.cxx @@ -58,7 +58,7 @@ handle_password(Client &client, Request args, Response &r) static TagMask ParseTagMask(Request request) { - if (request.IsEmpty()) + if (request.empty()) throw ProtocolError(ACK_ERROR_ARG, "Not enough arguments"); TagMask result = TagMask::None(); @@ -77,14 +77,14 @@ ParseTagMask(Request request) CommandResult handle_tagtypes(Client &client, Request request, Response &r) { - if (request.IsEmpty()) { + if (request.empty()) { tag_print_types(r); return CommandResult::OK; } const char *cmd = request.shift(); if (StringIsEqual(cmd, "all")) { - if (!request.IsEmpty()) { + if (!request.empty()) { r.Error(ACK_ERROR_ARG, "Too many arguments"); return CommandResult::ERROR; } @@ -92,7 +92,7 @@ handle_tagtypes(Client &client, Request request, Response &r) client.tag_mask = TagMask::All(); return CommandResult::OK; } else if (StringIsEqual(cmd, "clear")) { - if (!request.IsEmpty()) { + if (!request.empty()) { r.Error(ACK_ERROR_ARG, "Too many arguments"); return CommandResult::ERROR; } diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index c06b5a225..aad7d3a4c 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -169,7 +169,7 @@ handle_count(Client &client, Request args, Response &r) } SongFilter filter; - if (!args.IsEmpty() && !filter.Parse(args, false)) { + if (!args.empty() && !filter.Parse(args, false)) { r.Error(ACK_ERROR_ARG, "incorrect arguments"); return CommandResult::ERROR; } @@ -235,7 +235,7 @@ handle_list(Client &client, Request args, Response &r) args.pop_back(); } - if (!args.IsEmpty()) { + if (!args.empty()) { filter.reset(new SongFilter()); if (!filter->Parse(args, false)) { r.Error(ACK_ERROR_ARG, "not able to parse args"); diff --git a/src/command/MessageCommands.cxx b/src/command/MessageCommands.cxx index 35758b0fb..b675e97d4 100644 --- a/src/command/MessageCommands.cxx +++ b/src/command/MessageCommands.cxx @@ -76,7 +76,7 @@ handle_unsubscribe(Client &client, Request args, Response &r) CommandResult handle_channels(Client &client, gcc_unused Request args, Response &r) { - assert(args.IsEmpty()); + assert(args.empty()); std::set<std::string> channels; for (const auto &c : *client.GetInstance().client_list) @@ -93,7 +93,7 @@ CommandResult handle_read_messages(Client &client, gcc_unused Request args, Response &r) { - assert(args.IsEmpty()); + assert(args.empty()); while (!client.messages.empty()) { const ClientMessage &msg = client.messages.front(); diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx index ef66cd996..b748ce2ff 100644 --- a/src/command/OtherCommands.cxx +++ b/src/command/OtherCommands.cxx @@ -284,7 +284,7 @@ handle_update(Client &client, Request args, Response &r, bool discard) const char *path = ""; assert(args.size <= 1); - if (!args.IsEmpty()) { + if (!args.empty()) { path = args.front(); if (*path == 0 || StringIsEqual(path, "/")) diff --git a/src/command/OutputCommands.cxx b/src/command/OutputCommands.cxx index 4ce03131d..36296f94f 100644 --- a/src/command/OutputCommands.cxx +++ b/src/command/OutputCommands.cxx @@ -71,7 +71,7 @@ handle_toggleoutput(Client &client, Request args, Response &r) CommandResult handle_devices(Client &client, gcc_unused Request args, Response &r) { - assert(args.IsEmpty()); + assert(args.empty()); printAudioDevices(r, client.GetPartition().outputs); return CommandResult::OK; diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx index 400ed26fb..bd80f0a9e 100644 --- a/src/command/PlayerCommands.cxx +++ b/src/command/PlayerCommands.cxx @@ -95,7 +95,7 @@ handle_pause(Client &client, Request args, gcc_unused Response &r) { auto &pc = client.GetPlayerControl(); - if (!args.IsEmpty()) { + if (!args.empty()) { bool pause_flag = args.ParseBool(0); pc.LockSetPause(pause_flag); } else diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx index 079890130..a696d24ce 100644 --- a/src/command/QueueCommands.cxx +++ b/src/command/QueueCommands.cxx @@ -242,7 +242,7 @@ handle_playlistinfo(Client &client, Request args, Response &r) CommandResult handle_playlistid(Client &client, Request args, Response &r) { - if (!args.IsEmpty()) { + if (!args.empty()) { unsigned id = args.ParseUnsigned(0); playlist_print_id(r, client.GetPlaylist(), id); } else { diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index aa532cad2..89a46b5be 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -801,7 +801,7 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection, TagBuilder tag; tag.AddItem(tag_type, pair->value); - if (tag.IsEmpty()) + if (tag.empty()) /* if no tag item has been added, then the given value was not acceptable (e.g. empty); forcefully insert an empty diff --git a/src/decoder/Bridge.cxx b/src/decoder/Bridge.cxx index 37fcb2bf9..e09e0e4dc 100644 --- a/src/decoder/Bridge.cxx +++ b/src/decoder/Bridge.cxx @@ -496,7 +496,7 @@ DecoderBridge::SubmitData(InputStream *is, SongTime::FromS(timestamp) - dc.song->GetStartTime(), kbit_rate); - if (dest.IsEmpty()) { + if (dest.empty()) { /* the chunk is full, flush it */ FlushChunk(); continue; diff --git a/src/decoder/DecoderBuffer.cxx b/src/decoder/DecoderBuffer.cxx index 829292831..d2af2db59 100644 --- a/src/decoder/DecoderBuffer.cxx +++ b/src/decoder/DecoderBuffer.cxx @@ -25,7 +25,7 @@ bool DecoderBuffer::Fill() { auto w = buffer.Write(); - if (w.IsEmpty()) + if (w.empty()) /* buffer is full */ return false; diff --git a/src/decoder/plugins/FaadDecoderPlugin.cxx b/src/decoder/plugins/FaadDecoderPlugin.cxx index ee5df4b2f..ef1bd4fa3 100644 --- a/src/decoder/plugins/FaadDecoderPlugin.cxx +++ b/src/decoder/plugins/FaadDecoderPlugin.cxx @@ -127,7 +127,7 @@ adts_song_duration(DecoderBuffer &buffer) if (frames == 0) { auto data = ConstBuffer<uint8_t>::FromVoid(buffer.Read()); - assert(!data.IsEmpty()); + assert(!data.empty()); assert(frame_length <= data.size); sample_rate = adts_sample_rates[(data.data[2] & 0x3c) >> 2]; @@ -255,7 +255,7 @@ faad_decoder_init(NeAACDecHandle decoder, DecoderBuffer &buffer, AudioFormat &audio_format) { auto data = ConstBuffer<uint8_t>::FromVoid(buffer.Read()); - if (data.IsEmpty()) + if (data.empty()) throw std::runtime_error("Empty file"); uint8_t channels; @@ -283,7 +283,7 @@ faad_decoder_decode(NeAACDecHandle decoder, DecoderBuffer &buffer, NeAACDecFrameInfo *frame_info) { auto data = ConstBuffer<uint8_t>::FromVoid(buffer.Read()); - if (data.IsEmpty()) + if (data.empty()) return nullptr; return NeAACDecDecode(decoder, frame_info, diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 73d18e4ce..94f1306ca 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -617,7 +617,7 @@ FfmpegCheckTag(DecoderClient &client, InputStream &is, TagBuilder tag; FfmpegScanTag(format_context, audio_stream, tag); - if (!tag.IsEmpty()) + if (!tag.empty()) client.SubmitTag(is, tag.Commit()); } diff --git a/src/decoder/plugins/FlacMetadata.cxx b/src/decoder/plugins/FlacMetadata.cxx index da246e335..ee4053b26 100644 --- a/src/decoder/plugins/FlacMetadata.cxx +++ b/src/decoder/plugins/FlacMetadata.cxx @@ -97,7 +97,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry, if (handler.pair != nullptr) { const char *comment = (const char *)entry->entry; const DivideString split(comment, '='); - if (split.IsDefined() && !split.IsEmpty()) + if (split.IsDefined() && !split.empty()) tag_handler_invoke_pair(handler, handler_ctx, split.GetFirst(), split.GetSecond()); diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx index 3b9a29233..4d0129e27 100644 --- a/src/decoder/plugins/OpusDecoderPlugin.cxx +++ b/src/decoder/plugins/OpusDecoderPlugin.cxx @@ -211,7 +211,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet) if (ScanOpusTags(packet.packet, packet.bytes, &rgi, add_tag_handler, &tag_builder) && - !tag_builder.IsEmpty()) { + !tag_builder.empty()) { client.SubmitReplayGain(&rgi); Tag tag = tag_builder.Commit(); diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx index 22e34c193..7e49914d3 100644 --- a/src/decoder/plugins/PcmDecoderPlugin.cxx +++ b/src/decoder/plugins/PcmDecoderPlugin.cxx @@ -44,7 +44,7 @@ FillBuffer(DecoderClient &client, InputStream &is, B &buffer) { buffer.Shift(); auto w = buffer.Write(); - if (w.IsEmpty()) + if (w.empty()) return true; size_t nbytes = decoder_read(client, is, w.data, w.size); @@ -185,7 +185,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is) r.size = (r.size / 3) * 4; } - cmd = !r.IsEmpty() + cmd = !r.empty() ? client.SubmitData(is, r.data, r.size, 0) : client.GetCommand(); if (cmd == DecoderCommand::SEEK) { diff --git a/src/event/BufferedSocket.cxx b/src/event/BufferedSocket.cxx index 0ebe582be..b13e9fded 100644 --- a/src/event/BufferedSocket.cxx +++ b/src/event/BufferedSocket.cxx @@ -53,7 +53,7 @@ BufferedSocket::ReadToBuffer() assert(IsDefined()); const auto buffer = input.Write(); - assert(!buffer.IsEmpty()); + assert(!buffer.empty()); const auto nbytes = DirectRead(buffer.data, buffer.size); if (nbytes > 0) @@ -69,7 +69,7 @@ BufferedSocket::ResumeInput() while (true) { const auto buffer = input.Read(); - if (buffer.IsEmpty()) { + if (buffer.empty()) { ScheduleRead(); return true; } diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx index 1283513c4..d11be29bd 100644 --- a/src/event/FullyBufferedSocket.cxx +++ b/src/event/FullyBufferedSocket.cxx @@ -52,7 +52,7 @@ FullyBufferedSocket::Flush() assert(IsDefined()); const auto data = output.Read(); - if (data.IsEmpty()) { + if (data.empty()) { IdleMonitor::Cancel(); CancelWrite(); return true; @@ -64,7 +64,7 @@ FullyBufferedSocket::Flush() output.Consume(nbytes); - if (output.IsEmpty()) { + if (output.empty()) { IdleMonitor::Cancel(); CancelWrite(); } @@ -80,7 +80,7 @@ FullyBufferedSocket::Write(const void *data, size_t length) if (length == 0) return true; - const bool was_empty = output.IsEmpty(); + const bool was_empty = output.empty(); if (!output.Append(data, length)) { OnSocketError(std::make_exception_ptr(std::runtime_error("Output buffer is full"))); @@ -96,7 +96,7 @@ bool FullyBufferedSocket::OnSocketReady(unsigned flags) { if (flags & WRITE) { - assert(!output.IsEmpty()); + assert(!output.empty()); assert(!IdleMonitor::IsActive()); if (!Flush()) @@ -112,6 +112,6 @@ FullyBufferedSocket::OnSocketReady(unsigned flags) void FullyBufferedSocket::OnIdle() { - if (Flush() && !output.IsEmpty()) + if (Flush() && !output.empty()) ScheduleWrite(); } diff --git a/src/fs/io/BufferedOutputStream.cxx b/src/fs/io/BufferedOutputStream.cxx index 338210070..def68081e 100644 --- a/src/fs/io/BufferedOutputStream.cxx +++ b/src/fs/io/BufferedOutputStream.cxx @@ -70,7 +70,7 @@ void BufferedOutputStream::Format(const char *fmt, ...) { auto r = buffer.Write(); - if (r.IsEmpty()) { + if (r.empty()) { Flush(); r = buffer.Write(); } @@ -123,7 +123,7 @@ BufferedOutputStream::WriteWideToUTF8(const wchar_t *src, size_t src_length) return; auto r = buffer.Write(); - if (r.IsEmpty()) { + if (r.empty()) { Flush(); r = buffer.Write(); } @@ -158,7 +158,7 @@ void BufferedOutputStream::Flush() { auto r = buffer.Read(); - if (r.IsEmpty()) + if (r.empty()) return; os.Write(r.data, r.size); diff --git a/src/fs/io/BufferedReader.cxx b/src/fs/io/BufferedReader.cxx index f3095ca93..8d4cb528b 100644 --- a/src/fs/io/BufferedReader.cxx +++ b/src/fs/io/BufferedReader.cxx @@ -34,13 +34,13 @@ BufferedReader::Fill(bool need_more) return !need_more; auto w = buffer.Write(); - if (w.IsEmpty()) { + if (w.empty()) { if (buffer.GetCapacity() >= MAX_SIZE) return !need_more; buffer.Grow(buffer.GetCapacity() * 2); w = buffer.Write(); - assert(!w.IsEmpty()); + assert(!w.empty()); } size_t nbytes = reader.Read(w.data, w.size); @@ -104,14 +104,14 @@ BufferedReader::ReadLine() } } while (Fill(true)); - if (!eof || buffer.IsEmpty()) + if (!eof || buffer.empty()) return nullptr; auto w = buffer.Write(); - if (w.IsEmpty()) { + if (w.empty()) { buffer.Grow(buffer.GetCapacity() + 1); w = buffer.Write(); - assert(!w.IsEmpty()); + assert(!w.empty()); } /* terminate the last line */ diff --git a/src/fs/io/GunzipReader.cxx b/src/fs/io/GunzipReader.cxx index ffad13fd1..f8a1a7e9b 100644 --- a/src/fs/io/GunzipReader.cxx +++ b/src/fs/io/GunzipReader.cxx @@ -39,7 +39,7 @@ inline bool GunzipReader::FillBuffer() { auto w = buffer.Write(); - assert(!w.IsEmpty()); + assert(!w.empty()); size_t nbytes = next.Read(w.data, w.size); if (nbytes == 0) @@ -62,7 +62,7 @@ GunzipReader::Read(void *data, size_t size) int flush = Z_NO_FLUSH; auto r = buffer.Read(); - if (r.IsEmpty()) { + if (r.empty()) { if (FillBuffer()) r = buffer.Read(); else diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index 6d677d350..1cf4b81cd 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -88,7 +88,7 @@ bool AsyncInputStream::IsEOF() noexcept { return (KnownSize() && offset >= size) || - (!open && buffer.IsEmpty()); + (!open && buffer.empty()); } void @@ -108,7 +108,7 @@ AsyncInputStream::Seek(offset_type new_offset) while (new_offset > offset) { auto r = buffer.Read(); - if (r.IsEmpty()) + if (r.empty()) break; const size_t nbytes = @@ -162,7 +162,7 @@ AsyncInputStream::IsAvailable() noexcept { return postponed_exception || IsEOF() || - !buffer.IsEmpty(); + !buffer.empty(); } size_t @@ -176,7 +176,7 @@ AsyncInputStream::Read(void *ptr, size_t read_size) Check(); r = buffer.Read(); - if (!r.IsEmpty() || IsEOF()) + if (!r.empty() || IsEOF()) break; cond.wait(mutex); @@ -209,7 +209,7 @@ void AsyncInputStream::AppendToBuffer(const void *data, size_t append_size) noexcept { auto w = buffer.Write(); - assert(!w.IsEmpty()); + assert(!w.empty()); size_t nbytes = std::min(w.size, append_size); memcpy(w.data, data, nbytes); @@ -218,7 +218,7 @@ AsyncInputStream::AppendToBuffer(const void *data, size_t append_size) noexcept const size_t remaining = append_size - nbytes; if (remaining > 0) { w = buffer.Write(); - assert(!w.IsEmpty()); + assert(!w.empty()); assert(w.size >= remaining); memcpy(w.data, (const uint8_t *)data + nbytes, remaining); diff --git a/src/input/AsyncInputStream.hxx b/src/input/AsyncInputStream.hxx index 6bff6cd8c..1985daf1f 100644 --- a/src/input/AsyncInputStream.hxx +++ b/src/input/AsyncInputStream.hxx @@ -114,7 +114,7 @@ protected: } bool IsBufferEmpty() const noexcept { - return buffer.IsEmpty(); + return buffer.empty(); } bool IsBufferFull() const noexcept { diff --git a/src/input/TextInputStream.cxx b/src/input/TextInputStream.cxx index d73973a65..d8fd420b9 100644 --- a/src/input/TextInputStream.cxx +++ b/src/input/TextInputStream.cxx @@ -47,7 +47,7 @@ TextInputStream::ReadLine() /* line too long: terminate the current line */ - assert(!dest.IsEmpty()); + assert(!dest.empty()); dest[0] = 0; line = buffer.Read().data; buffer.Clear(); @@ -79,12 +79,12 @@ TextInputStream::ReadLine() line */ dest = buffer.Write(); - assert(!dest.IsEmpty()); + assert(!dest.empty()); dest[0] = 0; auto r = buffer.Read(); buffer.Clear(); - return r.IsEmpty() + return r.empty() ? nullptr : r.data; } diff --git a/src/input/ThreadInputStream.cxx b/src/input/ThreadInputStream.cxx index 33fdbe3ba..15f590ec8 100644 --- a/src/input/ThreadInputStream.cxx +++ b/src/input/ThreadInputStream.cxx @@ -80,7 +80,7 @@ ThreadInputStream::ThreadFunc() assert(!postponed_exception); auto w = buffer.Write(); - if (w.IsEmpty()) { + if (w.empty()) { wake_cond.wait(mutex); } else { size_t nbytes; @@ -122,7 +122,7 @@ ThreadInputStream::IsAvailable() noexcept { assert(!thread.IsInside()); - return !buffer.IsEmpty() || eof || postponed_exception; + return !buffer.empty() || eof || postponed_exception; } inline size_t @@ -135,7 +135,7 @@ ThreadInputStream::Read(void *ptr, size_t read_size) std::rethrow_exception(postponed_exception); auto r = buffer.Read(); - if (!r.IsEmpty()) { + if (!r.empty()) { size_t nbytes = std::min(read_size, r.size); memcpy(ptr, r.data, nbytes); buffer.Consume(nbytes); diff --git a/src/lib/xiph/VorbisComments.cxx b/src/lib/xiph/VorbisComments.cxx index 9ee18d4b7..ee865b436 100644 --- a/src/lib/xiph/VorbisComments.cxx +++ b/src/lib/xiph/VorbisComments.cxx @@ -71,7 +71,7 @@ vorbis_scan_comment(const char *comment, { if (handler.pair != nullptr) { const DivideString split(comment, '='); - if (split.IsDefined() && !split.IsEmpty()) + if (split.IsDefined() && !split.empty()) tag_handler_invoke_pair(handler, handler_ctx, split.GetFirst(), split.GetSecond()); @@ -104,7 +104,7 @@ vorbis_comments_to_tag(char **comments) { TagBuilder tag_builder; vorbis_comments_scan(comments, add_tag_handler, &tag_builder); - return tag_builder.IsEmpty() + return tag_builder.empty() ? nullptr : tag_builder.CommitNew(); } diff --git a/src/output/Source.cxx b/src/output/Source.cxx index 491cc45d0..d5cbbe2c8 100644 --- a/src/output/Source.cxx +++ b/src/output/Source.cxx @@ -138,7 +138,7 @@ AudioOutputSource::GetChunkData(const MusicChunk &chunk, assert(data.size % in_audio_format.GetFrameSize() == 0); - if (!data.IsEmpty() && replay_gain_filter != nullptr) { + if (!data.empty() && replay_gain_filter != nullptr) { replay_gain_filter_set_mode(*replay_gain_filter, replay_gain_mode); @@ -161,7 +161,7 @@ AudioOutputSource::FilterChunk(const MusicChunk &chunk) { auto data = GetChunkData(chunk, replay_gain_filter_instance, &replay_gain_serial); - if (data.IsEmpty()) + if (data.empty()) return data; /* cross-fade */ @@ -170,7 +170,7 @@ AudioOutputSource::FilterChunk(const MusicChunk &chunk) auto other_data = GetChunkData(*chunk.other, other_replay_gain_filter_instance, &other_replay_gain_serial); - if (other_data.IsEmpty()) + if (other_data.empty()) return data; /* if the "other" chunk is longer, then that trailer @@ -211,7 +211,7 @@ bool AudioOutputSource::Fill(Mutex &mutex) { if (current_chunk != nullptr && pending_tag == nullptr && - pending_data.IsEmpty()) + pending_data.empty()) pipe.Consume(*std::exchange(current_chunk, nullptr)); if (current_chunk != nullptr) @@ -242,6 +242,6 @@ AudioOutputSource::ConsumeData(size_t nbytes) noexcept { pending_data.skip_front(nbytes); - if (pending_data.IsEmpty()) + if (pending_data.empty()) pipe.Consume(*std::exchange(current_chunk, nullptr)); } diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index ed2feac82..b184c5edc 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -259,7 +259,7 @@ AudioOutputControl::PlayChunk() noexcept while (command == Command::NONE) { const auto data = source.PeekData(); - if (data.IsEmpty()) + if (data.empty()) break; if (skip_delay) diff --git a/src/pcm/PcmDsd.cxx b/src/pcm/PcmDsd.cxx index 5ac2c27bd..6e6b24c1e 100644 --- a/src/pcm/PcmDsd.cxx +++ b/src/pcm/PcmDsd.cxx @@ -48,7 +48,7 @@ ConstBuffer<float> PcmDsd::ToFloat(unsigned channels, ConstBuffer<uint8_t> src) { assert(!src.IsNull()); - assert(!src.IsEmpty()); + assert(!src.empty()); assert(src.size % channels == 0); assert(channels <= dsd2pcm.max_size()); diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx index 463c9871f..d950c036b 100644 --- a/src/tag/Builder.cxx +++ b/src/tag/Builder.cxx @@ -191,7 +191,7 @@ TagBuilder::Complement(const Tag &other) inline void TagBuilder::AddItemInternal(TagType type, StringView value) { - assert(!value.IsEmpty()); + assert(!value.empty()); auto f = FixTagString(value); if (!f.IsNull()) @@ -209,7 +209,7 @@ TagBuilder::AddItemInternal(TagType type, StringView value) void TagBuilder::AddItem(TagType type, StringView value) { - if (value.IsEmpty() || !IsTagEnabled(type)) + if (value.empty() || !IsTagEnabled(type)) return; AddItemInternal(type, value); diff --git a/src/tag/Builder.hxx b/src/tag/Builder.hxx index 396b626e2..2b0d3ef7e 100644 --- a/src/tag/Builder.hxx +++ b/src/tag/Builder.hxx @@ -74,7 +74,7 @@ public: * Returns true if the tag contains no items. This ignores * the "duration" attribute. */ - bool IsEmpty() const { + bool empty() const { return items.empty(); } @@ -83,7 +83,7 @@ public: */ gcc_pure bool IsDefined() const noexcept { - return !duration.IsNegative() || has_playlist || !IsEmpty(); + return !duration.IsNegative() || has_playlist || !empty(); } void Clear(); diff --git a/src/tag/Id3Scan.cxx b/src/tag/Id3Scan.cxx index d36762845..db428137d 100644 --- a/src/tag/Id3Scan.cxx +++ b/src/tag/Id3Scan.cxx @@ -334,7 +334,7 @@ tag_id3_import(struct id3_tag *tag) { TagBuilder tag_builder; scan_id3_tag(tag, add_tag_handler, &tag_builder); - return tag_builder.IsEmpty() + return tag_builder.empty() ? nullptr : tag_builder.CommitNew(); } diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx index 3b14eb114..c7d3b9b28 100644 --- a/src/util/AllocatedArray.hxx +++ b/src/util/AllocatedArray.hxx @@ -112,7 +112,7 @@ public: * Returns true if no memory was allocated so far. */ constexpr bool empty() const { - return buffer.IsEmpty(); + return buffer.empty(); } /** diff --git a/src/util/CircularBuffer.hxx b/src/util/CircularBuffer.hxx index 17cb6541f..23d54326d 100644 --- a/src/util/CircularBuffer.hxx +++ b/src/util/CircularBuffer.hxx @@ -90,7 +90,7 @@ public: return capacity; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return head == tail; } diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index b5e9082b5..f02bd034e 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -84,7 +84,7 @@ struct ConstBuffer<void> { return data != nullptr; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return size == 0; } }; @@ -167,7 +167,7 @@ struct ConstBuffer { return data != nullptr; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return size == 0; } @@ -217,7 +217,7 @@ struct ConstBuffer { #endif reference_type front() const { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif return data[0]; } @@ -231,7 +231,7 @@ struct ConstBuffer { #endif reference_type back() const { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif return data[size - 1]; } @@ -242,7 +242,7 @@ struct ConstBuffer { */ void pop_front() { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif ++data; @@ -255,7 +255,7 @@ struct ConstBuffer { */ void pop_back() { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif --size; diff --git a/src/util/DivideString.hxx b/src/util/DivideString.hxx index 1c92e05ef..598321536 100644 --- a/src/util/DivideString.hxx +++ b/src/util/DivideString.hxx @@ -53,7 +53,7 @@ public: /** * Is the first part empty? */ - bool IsEmpty() const { + bool empty() const { assert(IsDefined()); return *first == 0; diff --git a/src/util/DynamicFifoBuffer.hxx b/src/util/DynamicFifoBuffer.hxx index 2979c57d6..3d64b4cf4 100644 --- a/src/util/DynamicFifoBuffer.hxx +++ b/src/util/DynamicFifoBuffer.hxx @@ -55,7 +55,7 @@ public: using ForeignFifoBuffer<T>::GetCapacity; using ForeignFifoBuffer<T>::Clear; - using ForeignFifoBuffer<T>::IsEmpty; + using ForeignFifoBuffer<T>::empty; using ForeignFifoBuffer<T>::IsFull; using ForeignFifoBuffer<T>::GetAvailable; using ForeignFifoBuffer<T>::Read; diff --git a/src/util/ForeignFifoBuffer.hxx b/src/util/ForeignFifoBuffer.hxx index c36a817a2..fc5fb815e 100644 --- a/src/util/ForeignFifoBuffer.hxx +++ b/src/util/ForeignFifoBuffer.hxx @@ -134,7 +134,7 @@ public: head = tail = 0; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return head == tail; } @@ -147,7 +147,7 @@ public: * When you are finished, call Append(). */ Range Write() { - if (IsEmpty()) + if (empty()) Clear(); else if (tail == capacity) Shift(); diff --git a/src/util/PeakBuffer.cxx b/src/util/PeakBuffer.cxx index ea7ad94f3..48c15c32e 100644 --- a/src/util/PeakBuffer.cxx +++ b/src/util/PeakBuffer.cxx @@ -32,10 +32,10 @@ PeakBuffer::~PeakBuffer() } bool -PeakBuffer::IsEmpty() const noexcept +PeakBuffer::empty() const noexcept { - return (normal_buffer == nullptr || normal_buffer->IsEmpty()) && - (peak_buffer == nullptr || peak_buffer->IsEmpty()); + return (normal_buffer == nullptr || normal_buffer->empty()) && + (peak_buffer == nullptr || peak_buffer->empty()); } WritableBuffer<void> @@ -43,13 +43,13 @@ PeakBuffer::Read() const noexcept { if (normal_buffer != nullptr) { const auto p = normal_buffer->Read(); - if (!p.IsEmpty()) + if (!p.empty()) return p.ToVoid(); } if (peak_buffer != nullptr) { const auto p = peak_buffer->Read(); - if (!p.IsEmpty()) + if (!p.empty()) return p.ToVoid(); } @@ -59,14 +59,14 @@ PeakBuffer::Read() const noexcept void PeakBuffer::Consume(size_t length) noexcept { - if (normal_buffer != nullptr && !normal_buffer->IsEmpty()) { + if (normal_buffer != nullptr && !normal_buffer->empty()) { normal_buffer->Consume(length); return; } - if (peak_buffer != nullptr && !peak_buffer->IsEmpty()) { + if (peak_buffer != nullptr && !peak_buffer->empty()) { peak_buffer->Consume(length); - if (peak_buffer->IsEmpty()) { + if (peak_buffer->empty()) { delete peak_buffer; peak_buffer = nullptr; } @@ -86,7 +86,7 @@ AppendTo(DynamicFifoBuffer<uint8_t> &buffer, do { const auto p = buffer.Write(); - if (p.IsEmpty()) + if (p.empty()) break; const size_t nbytes = std::min(length, p.size); @@ -107,7 +107,7 @@ PeakBuffer::Append(const void *data, size_t length) if (length == 0) return true; - if (peak_buffer != nullptr && !peak_buffer->IsEmpty()) { + if (peak_buffer != nullptr && !peak_buffer->empty()) { size_t nbytes = AppendTo(*peak_buffer, data, length); return nbytes == length; } diff --git a/src/util/PeakBuffer.hxx b/src/util/PeakBuffer.hxx index 294cba380..cd6c84ac0 100644 --- a/src/util/PeakBuffer.hxx +++ b/src/util/PeakBuffer.hxx @@ -57,7 +57,7 @@ public: PeakBuffer &operator=(const PeakBuffer &) = delete; gcc_pure - bool IsEmpty() const noexcept; + bool empty() const noexcept; gcc_pure WritableBuffer<void> Read() const noexcept; diff --git a/src/util/SliceBuffer.hxx b/src/util/SliceBuffer.hxx index 15de2d730..398f08639 100644 --- a/src/util/SliceBuffer.hxx +++ b/src/util/SliceBuffer.hxx @@ -79,7 +79,7 @@ public: return buffer.size(); } - bool IsEmpty() const { + bool empty() const { return n_allocated == 0; } diff --git a/src/util/StaticFifoBuffer.hxx b/src/util/StaticFifoBuffer.hxx index 54ec51b0d..076a573bb 100644 --- a/src/util/StaticFifoBuffer.hxx +++ b/src/util/StaticFifoBuffer.hxx @@ -78,7 +78,7 @@ public: head = tail = 0; } - bool IsEmpty() const { + bool empty() const { return head == tail; } @@ -91,7 +91,7 @@ public: * When you are finished, call Append(). */ Range Write() { - if (IsEmpty()) + if (empty()) Clear(); else if (tail == size) Shift(); diff --git a/src/util/StringView.cxx b/src/util/StringView.cxx index 083cab103..d337fd1f3 100644 --- a/src/util/StringView.cxx +++ b/src/util/StringView.cxx @@ -34,7 +34,7 @@ template<typename T> void BasicStringView<T>::StripLeft() noexcept { - while (!IsEmpty() && IsWhitespaceOrNull(front())) + while (!empty() && IsWhitespaceOrNull(front())) pop_front(); } @@ -42,7 +42,7 @@ template<typename T> void BasicStringView<T>::StripRight() noexcept { - while (!IsEmpty() && IsWhitespaceOrNull(back())) + while (!empty() && IsWhitespaceOrNull(back())) pop_back(); } diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx index ecf6ed82a..0bc8cdfab 100644 --- a/src/util/StringView.hxx +++ b/src/util/StringView.hxx @@ -58,7 +58,7 @@ struct BasicStringView : ConstBuffer<T> { constexpr BasicStringView(std::nullptr_t n) noexcept :ConstBuffer<T>(n) {} - using ConstBuffer<T>::IsEmpty; + using ConstBuffer<T>::empty; using ConstBuffer<T>::front; using ConstBuffer<T>::back; using ConstBuffer<T>::pop_front; diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx index 61b90da29..d976e6b2e 100644 --- a/src/util/UriUtil.cxx +++ b/src/util/UriUtil.cxx @@ -41,7 +41,7 @@ gcc_pure static bool IsValidScheme(StringView p) noexcept { - if (p.IsEmpty() || !IsValidSchemeStart(p.front())) + if (p.empty() || !IsValidSchemeStart(p.front())) return false; for (size_t i = 1; i < p.size; ++i) diff --git a/src/util/WritableBuffer.hxx b/src/util/WritableBuffer.hxx index 805f3d9cd..9fd8022c8 100644 --- a/src/util/WritableBuffer.hxx +++ b/src/util/WritableBuffer.hxx @@ -76,7 +76,7 @@ struct WritableBuffer<void> { return data != nullptr; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return size == 0; } }; @@ -161,7 +161,7 @@ struct WritableBuffer { return data != nullptr; } - constexpr bool IsEmpty() const { + constexpr bool empty() const { return size == 0; } @@ -201,7 +201,7 @@ struct WritableBuffer { #endif reference_type front() const { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif return data[0]; } @@ -215,7 +215,7 @@ struct WritableBuffer { #endif reference_type back() const { #ifndef NDEBUG - assert(!IsEmpty()); + assert(!empty()); #endif return data[size - 1]; } @@ -225,7 +225,7 @@ struct WritableBuffer { * not actually modify the buffer). Buffer must not be empty. */ void pop_front() { - assert(!IsEmpty()); + assert(!empty()); ++data; --size; @@ -236,7 +236,7 @@ struct WritableBuffer { * not actually modify the buffer). Buffer must not be empty. */ void pop_back() { - assert(!IsEmpty()); + assert(!empty()); --size; } diff --git a/test/DivideStringTest.hxx b/test/DivideStringTest.hxx index f6c01bdde..f1834fa82 100644 --- a/test/DivideStringTest.hxx +++ b/test/DivideStringTest.hxx @@ -23,7 +23,7 @@ public: constexpr char input[] = "foo.bar"; const DivideString ds(input, '.'); CPPUNIT_ASSERT(ds.IsDefined()); - CPPUNIT_ASSERT(!ds.IsEmpty()); + CPPUNIT_ASSERT(!ds.empty()); CPPUNIT_ASSERT_EQUAL(0, strcmp(ds.GetFirst(), "foo")); CPPUNIT_ASSERT_EQUAL(input + 4, ds.GetSecond()); } @@ -32,7 +32,7 @@ public: constexpr char input[] = ".bar"; const DivideString ds(input, '.'); CPPUNIT_ASSERT(ds.IsDefined()); - CPPUNIT_ASSERT(ds.IsEmpty()); + CPPUNIT_ASSERT(ds.empty()); CPPUNIT_ASSERT_EQUAL(0, strcmp(ds.GetFirst(), "")); CPPUNIT_ASSERT_EQUAL(input + 1, ds.GetSecond()); } @@ -47,7 +47,7 @@ public: constexpr char input[] = " foo\t.\nbar\r"; const DivideString ds(input, '.', true); CPPUNIT_ASSERT(ds.IsDefined()); - CPPUNIT_ASSERT(!ds.IsEmpty()); + CPPUNIT_ASSERT(!ds.empty()); CPPUNIT_ASSERT_EQUAL(0, strcmp(ds.GetFirst(), "foo")); CPPUNIT_ASSERT_EQUAL(input + 7, ds.GetSecond()); } diff --git a/test/TestCircularBuffer.hxx b/test/TestCircularBuffer.hxx index 4283be45b..a48a01614 100644 --- a/test/TestCircularBuffer.hxx +++ b/test/TestCircularBuffer.hxx @@ -25,52 +25,52 @@ public: /* checks on empty buffer */ /* [.......X] */ - CPPUNIT_ASSERT_EQUAL(true, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); CPPUNIT_ASSERT_EQUAL(size_t(0), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.GetSpace()); - CPPUNIT_ASSERT_EQUAL(true, buffer.Read().IsEmpty()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.Read().empty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[0], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.Write().size); /* append one element */ /* [O......X] */ buffer.Append(1); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(6), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[0], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[1], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(6), buffer.Write().size); /* append 6 elements, buffer is now full */ /* [OOOOOOOX] */ buffer.Append(6); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(true, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(0), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[0], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(true, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.Write().empty()); /* consume [0]; can append one at [7] */ /* [XOOOOOO.] */ buffer.Consume(1); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(6), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(6), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[1], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[7], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.Write().size); @@ -78,66 +78,66 @@ public: be written to because head==1 */ /* [XOOOOOOO] */ buffer.Append(1); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(true, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(0), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[1], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(true, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.Write().empty()); /* consume [1..3]; can append [0..2] */ /* [...XOOOO] */ buffer.Consume(3); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(3), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[4], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[0], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(3), buffer.Write().size); /* append [0..1] */ /* [OO.XOOOO] */ buffer.Append(2); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(6), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[4], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[2], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(1), buffer.Write().size); /* append [2] */ /* [OOOXOOOO] */ buffer.Append(1); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(true, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(0), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[4], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(true, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.Write().empty()); /* consume [4..7] */ /* [OOO....X] */ buffer.Consume(4); - CPPUNIT_ASSERT_EQUAL(false, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Read().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Read().empty()); CPPUNIT_ASSERT_EQUAL(size_t(3), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.GetSpace()); CPPUNIT_ASSERT_EQUAL(size_t(3), buffer.Read().size); CPPUNIT_ASSERT_EQUAL(&data[0], buffer.Read().data); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[3], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(4), buffer.Write().size); @@ -146,12 +146,12 @@ public: special code to rewind/reset an empty buffer */ /* [..X.....] */ buffer.Consume(3); - CPPUNIT_ASSERT_EQUAL(true, buffer.IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.empty()); CPPUNIT_ASSERT_EQUAL(false, buffer.IsFull()); CPPUNIT_ASSERT_EQUAL(size_t(0), buffer.GetSize()); CPPUNIT_ASSERT_EQUAL(size_t(7), buffer.GetSpace()); - CPPUNIT_ASSERT_EQUAL(true, buffer.Read().IsEmpty()); - CPPUNIT_ASSERT_EQUAL(false, buffer.Write().IsEmpty()); + CPPUNIT_ASSERT_EQUAL(true, buffer.Read().empty()); + CPPUNIT_ASSERT_EQUAL(false, buffer.Write().empty()); CPPUNIT_ASSERT_EQUAL(&data[3], buffer.Write().data); CPPUNIT_ASSERT_EQUAL(size_t(5), buffer.Write().size); } diff --git a/test/run_convert.cxx b/test/run_convert.cxx index 7b704c10e..1d11e44d0 100644 --- a/test/run_convert.cxx +++ b/test/run_convert.cxx @@ -62,7 +62,7 @@ try { while (true) { { const auto dest = buffer.Write(); - assert(!dest.IsEmpty()); + assert(!dest.empty()); ssize_t nbytes = read(0, dest.data, dest.size); if (nbytes <= 0) @@ -72,10 +72,10 @@ try { } auto src = buffer.Read(); - assert(!src.IsEmpty()); + assert(!src.empty()); src.size -= src.size % in_frame_size; - if (src.IsEmpty()) + if (src.empty()) continue; buffer.Consume(src.size); |