Skip to content

Commit 0f19d07

Browse files
committed
Merge branch 'v0.24.x'
2 parents 3cc22f0 + 991f044 commit 0f19d07

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/decoder/DecoderBuffer.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DecoderBuffer::GetOffset() const noexcept
1212
}
1313

1414
bool
15-
DecoderBuffer::Fill()
15+
DecoderBuffer::Fill() noexcept
1616
{
1717
auto w = buffer.Write();
1818
if (w.empty())
@@ -30,7 +30,7 @@ DecoderBuffer::Fill()
3030
}
3131

3232
std::span<const std::byte>
33-
DecoderBuffer::Need(size_t min_size)
33+
DecoderBuffer::Need(size_t min_size) noexcept
3434
{
3535
while (true) {
3636
const auto r = Read();
@@ -43,7 +43,7 @@ DecoderBuffer::Need(size_t min_size)
4343
}
4444

4545
bool
46-
DecoderBuffer::Skip(size_t nbytes)
46+
DecoderBuffer::Skip(size_t nbytes) noexcept
4747
{
4848
const auto r = buffer.Read();
4949
if (r.size() >= nbytes) {

src/decoder/DecoderBuffer.hxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public:
5454
* data available (yet), end of file, I/O error or a decoder
5555
* command was received
5656
*/
57-
bool Fill();
57+
bool Fill() noexcept;
5858

5959
/**
6060
* How many bytes are stored in the buffer?
@@ -77,7 +77,8 @@ public:
7777
* Wait until this number of bytes are available. Returns nullptr on
7878
* error.
7979
*/
80-
std::span<const std::byte> Need(size_t min_size);
80+
[[nodiscard]]
81+
std::span<const std::byte> Need(size_t min_size) noexcept;
8182

8283
/**
8384
* Consume (delete, invalidate) a part of the buffer. The
@@ -96,5 +97,6 @@ public:
9697
* @param nbytes the number of bytes to skip
9798
* @return true on success, false on error
9899
*/
99-
bool Skip(size_t nbytes);
100+
[[nodiscard]]
101+
bool Skip(size_t nbytes) noexcept;
100102
};

test/run_decoder.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ParseCommandLine(int argc, char **argv)
7272

7373
auto args = option_parser.GetRemaining();
7474
if (args.size() != 2)
75-
throw std::runtime_error("Usage: run_decoder [--verbose] [--config=FILE] [--seek=POS] ECODER URI");
75+
throw std::runtime_error("Usage: run_decoder [--verbose] [--config=FILE] [--seek=POS] DECODER URI");
7676

7777
c.decoder = args[0];
7878
c.uri = args[1];

test/time/TestFileTime.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ TEST(Time, FileTimeToChrono)
1919
struct stat st;
2020
ASSERT_EQ(stat(".", &st), 0);
2121

22-
ASSERT_EQ(std::chrono::system_clock::to_time_t(tp), st.st_mtime);
22+
EXPECT_NEAR(std::chrono::system_clock::to_time_t(tp), st.st_mtime, 1);
2323

2424
const auto ft2 = ChronoToFileTime(std::chrono::system_clock::from_time_t(st.st_mtime));
2525
const auto tp2 = FileTimeToChrono(ft2);
26-
ASSERT_EQ(std::chrono::system_clock::to_time_t(tp2), st.st_mtime);
26+
EXPECT_NEAR(std::chrono::system_clock::to_time_t(tp2), st.st_mtime, 1);
2727
}

0 commit comments

Comments
 (0)