decoder/API: add noexcept

This commit is contained in:
Max Kellermann 2020-09-04 13:33:47 +02:00
parent cbcdc73f9a
commit 8830ea319f
2 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@
size_t size_t
decoder_read(DecoderClient *client, decoder_read(DecoderClient *client,
InputStream &is, InputStream &is,
void *buffer, size_t length) void *buffer, size_t length) noexcept
{ {
assert(buffer != nullptr); assert(buffer != nullptr);
@ -44,7 +44,7 @@ decoder_read(DecoderClient *client,
bool bool
decoder_read_full(DecoderClient *client, InputStream &is, decoder_read_full(DecoderClient *client, InputStream &is,
void *_buffer, size_t size) void *_buffer, size_t size) noexcept
{ {
uint8_t *buffer = (uint8_t *)_buffer; uint8_t *buffer = (uint8_t *)_buffer;
@ -61,7 +61,7 @@ decoder_read_full(DecoderClient *client, InputStream &is,
} }
bool bool
decoder_skip(DecoderClient *client, InputStream &is, size_t size) decoder_skip(DecoderClient *client, InputStream &is, size_t size) noexcept
{ {
while (size > 0) { while (size > 0) {
char buffer[1024]; char buffer[1024];

View File

@ -65,11 +65,11 @@ class StopDecoder {};
*/ */
size_t size_t
decoder_read(DecoderClient *decoder, InputStream &is, decoder_read(DecoderClient *decoder, InputStream &is,
void *buffer, size_t length); void *buffer, size_t length) noexcept;
static inline size_t static inline size_t
decoder_read(DecoderClient &decoder, InputStream &is, decoder_read(DecoderClient &decoder, InputStream &is,
void *buffer, size_t length) void *buffer, size_t length) noexcept
{ {
return decoder_read(&decoder, is, buffer, length); return decoder_read(&decoder, is, buffer, length);
} }
@ -83,7 +83,7 @@ decoder_read(DecoderClient &decoder, InputStream &is,
*/ */
bool bool
decoder_read_full(DecoderClient *decoder, InputStream &is, decoder_read_full(DecoderClient *decoder, InputStream &is,
void *buffer, size_t size); void *buffer, size_t size) noexcept;
/** /**
* Skip data on the #InputStream. * Skip data on the #InputStream.
@ -91,6 +91,6 @@ decoder_read_full(DecoderClient *decoder, InputStream &is,
* @return true on success, false on error or command * @return true on success, false on error or command
*/ */
bool bool
decoder_skip(DecoderClient *decoder, InputStream &is, size_t size); decoder_skip(DecoderClient *decoder, InputStream &is, size_t size) noexcept;
#endif #endif