Skip to content

Commit

Permalink
More SMOLRTSP_PRIV_MUST_USE
Browse files Browse the repository at this point in the history
  • Loading branch information
hirrolot committed Mar 30, 2022
1 parent 750d23d commit 3ca2885
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 7 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## unreleased

### Fixed

- Mark the following functions with `__attribute__((warn_unused_result))` (when available):
- `SmolRTSP_ParseError_print`.
- `SmolRTSP_MessageBody_empty`.
- `SmolRTSP_Request_uninit`.
- `SmolRTSP_Response_uninit`.
- `SmolRTSP_NalTransportConfig_default`.
- `smolrtsp_determine_start_code`.
- `smolrtsp_dgram_socket`.

## 0.1.0 - 2022-03-30

### Added
Expand Down
3 changes: 2 additions & 1 deletion include/smolrtsp/nal.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ typedef size_t (*SmolRTSP_NalStartCodeTester)(U8Slice99 data);
* file to #smolrtsp_determine_start_code and invoke the returned tester
* multiple times afterwards.
*/
SmolRTSP_NalStartCodeTester smolrtsp_determine_start_code(U8Slice99 data);
SmolRTSP_NalStartCodeTester
smolrtsp_determine_start_code(U8Slice99 data) SMOLRTSP_PRIV_MUST_USE;

/**
* The 3-byte start code tester (`0x000001`).
Expand Down
3 changes: 2 additions & 1 deletion include/smolrtsp/nal_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ typedef struct {
* - `max_h264_nalu_size` is #SMOLRTSP_MAX_H264_NALU_SIZE.
* - `max_h265_nalu_size` is #SMOLRTSP_MAX_H265_NALU_SIZE.
*/
SmolRTSP_NalTransportConfig SmolRTSP_NalTransportConfig_default(void);
SmolRTSP_NalTransportConfig
SmolRTSP_NalTransportConfig_default(void) SMOLRTSP_PRIV_MUST_USE;

/**
* An RTP/NAL data transport.
Expand Down
3 changes: 2 additions & 1 deletion include/smolrtsp/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ SmolRTSP_Transport smolrtsp_transport_udp(int fd) SMOLRTSP_PRIV_MUST_USE;
* @return A valid file descriptor or -1 on error (and sets `errno`
* appropriately).
*/
int smolrtsp_dgram_socket(int af, const void *restrict addr, uint16_t port);
int smolrtsp_dgram_socket(int af, const void *restrict addr, uint16_t port)
SMOLRTSP_PRIV_MUST_USE;

/**
* Returns a pointer to the IP address of @p addr.
Expand Down
3 changes: 2 additions & 1 deletion include/smolrtsp/types/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ datatype99(
*
* @pre `w.self && w.vptr`
*/
int SmolRTSP_ParseError_print(SmolRTSP_ParseError self, SmolRTSP_Writer w);
int SmolRTSP_ParseError_print(SmolRTSP_ParseError self, SmolRTSP_Writer w)
SMOLRTSP_PRIV_MUST_USE;

/**
* A status of successful parsing.
Expand Down
2 changes: 1 addition & 1 deletion include/smolrtsp/types/message_body.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SmolRTSP_ParseResult SmolRTSP_MessageBody_parse(
/**
* Returns an empty message body.
*/
SmolRTSP_MessageBody SmolRTSP_MessageBody_empty(void);
SmolRTSP_MessageBody SmolRTSP_MessageBody_empty(void) SMOLRTSP_PRIV_MUST_USE;

/**
* Tests @p lhs and @p rhs for equality.
Expand Down
2 changes: 1 addition & 1 deletion include/smolrtsp/types/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct {
/**
* Returns an RTSP request suitable for being parsed.
*/
SmolRTSP_Request SmolRTSP_Request_uninit(void);
SmolRTSP_Request SmolRTSP_Request_uninit(void) SMOLRTSP_PRIV_MUST_USE;

/**
* Serialises @p self into @p w.
Expand Down
2 changes: 1 addition & 1 deletion include/smolrtsp/types/response.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct {
/**
* Returns an RTSP response suitable for being parsed.
*/
SmolRTSP_Response SmolRTSP_Response_uninit(void);
SmolRTSP_Response SmolRTSP_Response_uninit(void) SMOLRTSP_PRIV_MUST_USE;

/**
* Serialises @p self into @p w.
Expand Down

0 comments on commit 3ca2885

Please sign in to comment.