Skip to content

Commit

Permalink
Fix -Wuseless-cast compiler warnings in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Aug 16, 2024
1 parent 7a014d8 commit 88ac8b1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions include/aws/event-stream/event_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ struct aws_event_stream_message {
struct aws_byte_buf message_buffer;
};

#define AWS_EVENT_STREAM_PRELUDE_LENGTH (uint32_t)(sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t))

#define AWS_EVENT_STREAM_TRAILER_LENGTH (uint32_t)(sizeof(uint32_t))
#if SIZE_MAX == UINT32_MAX
# define AWS_EVENT_STREAM_PRELUDE_LENGTH (sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t))
# define AWS_EVENT_STREAM_TRAILER_LENGTH (sizeof(uint32_t))
#else /* cast to uint32_t */
# define AWS_EVENT_STREAM_PRELUDE_LENGTH (uint32_t)(sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t))
# define AWS_EVENT_STREAM_TRAILER_LENGTH (uint32_t)(sizeof(uint32_t))
#endif

enum aws_event_stream_header_value_type {
AWS_EVENT_STREAM_HEADER_BOOL_TRUE = 0,
Expand Down

0 comments on commit 88ac8b1

Please sign in to comment.