From f678d6e1d6f1a5dffc4bc0a167ead33936d8924c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 18 Oct 2024 18:51:17 +0900 Subject: [PATCH] Remove extra semicolons --- .clang-format | 5 ++++ configure.ac | 2 ++ lib/nghttp3_conn.c | 2 +- lib/nghttp3_conn.h | 2 +- lib/nghttp3_ksl.c | 2 +- lib/nghttp3_ksl.h | 2 +- lib/nghttp3_macro.h | 36 ++++++++++++------------- lib/nghttp3_stream.c | 2 +- lib/nghttp3_stream.h | 2 +- tests/nghttp3_conn_test.h | 54 +++++++++++++++++++------------------- tests/nghttp3_http_test.h | 4 +-- tests/nghttp3_qpack_test.h | 22 ++++++++-------- tests/nghttp3_tnode_test.h | 2 +- 13 files changed, 72 insertions(+), 65 deletions(-) diff --git a/.clang-format b/.clang-format index 0604933..0f5eb6b 100644 --- a/.clang-format +++ b/.clang-format @@ -232,6 +232,11 @@ StatementAttributeLikeMacros: StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION + - munit_void_test_decl + - nghttp3_max_def + - nghttp3_min_def + - nghttp3_objalloc_decl + - nghttp3_objalloc_def TabWidth: 8 UseTab: Never VerilogBreakBetweenInstancePorts: true diff --git a/configure.ac b/configure.ac index 4e1c647..8f39c15 100644 --- a/configure.ac +++ b/configure.ac @@ -216,6 +216,7 @@ if test "x$werror" != "xno"; then # Only work with Clang for the moment AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"]) AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CFLAGS="$CFLAGS -Wsometimes-uninitialized"]) + AX_CHECK_COMPILE_FLAG([-Wextra-semi], [CFLAGS="$CFLAGS -Wextra-semi"]) # Only work with gcc7 for the moment AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CFLAGS="$CFLAGS -Wduplicated-branches"]) @@ -230,6 +231,7 @@ if test "x$werror" != "xno"; then #AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"]) AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"]) AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CXXFLAGS="$CXXFLAGS -Wsometimes-uninitialized"]) + AX_CHECK_COMPILE_FLAG([-Wextra-semi], [CXXFLAGS="$CXXFLAGS -Wextra-semi"]) # Disable noexcept-type warning of g++-7. This is not harmful as # long as all source files are compiled with the same compiler. AX_CHECK_COMPILE_FLAG([-Wno-noexcept-type], [CXXFLAGS="$CXXFLAGS -Wno-noexcept-type"]) diff --git a/lib/nghttp3_conn.c b/lib/nghttp3_conn.c index f70b4f5..0cf9f7e 100644 --- a/lib/nghttp3_conn.c +++ b/lib/nghttp3_conn.c @@ -39,7 +39,7 @@ dynamic table capacity that QPACK encoder is willing to use. */ #define NGHTTP3_QPACK_ENCODER_MAX_DTABLE_CAPACITY 4096 -nghttp3_objalloc_def(chunk, nghttp3_chunk, oplent); +nghttp3_objalloc_def(chunk, nghttp3_chunk, oplent) /* * conn_remote_stream_uni returns nonzero if |stream_id| is remote diff --git a/lib/nghttp3_conn.h b/lib/nghttp3_conn.h index 1218ba5..3ab6d34 100644 --- a/lib/nghttp3_conn.h +++ b/lib/nghttp3_conn.h @@ -76,7 +76,7 @@ typedef struct nghttp3_chunk { nghttp3_opl_entry oplent; } nghttp3_chunk; -nghttp3_objalloc_decl(chunk, nghttp3_chunk, oplent); +nghttp3_objalloc_decl(chunk, nghttp3_chunk, oplent) struct nghttp3_conn { nghttp3_objalloc out_chunk_objalloc; diff --git a/lib/nghttp3_ksl.c b/lib/nghttp3_ksl.c index a3b5fbc..b17d27c 100644 --- a/lib/nghttp3_ksl.c +++ b/lib/nghttp3_ksl.c @@ -36,7 +36,7 @@ static nghttp3_ksl_blk null_blk = {{{NULL, NULL, 0, 0, {0}}}}; -nghttp3_objalloc_def(ksl_blk, nghttp3_ksl_blk, oplent); +nghttp3_objalloc_def(ksl_blk, nghttp3_ksl_blk, oplent) static size_t ksl_nodelen(size_t keylen) { assert(keylen >= sizeof(uint64_t)); diff --git a/lib/nghttp3_ksl.h b/lib/nghttp3_ksl.h index e15e227..49e27c3 100644 --- a/lib/nghttp3_ksl.h +++ b/lib/nghttp3_ksl.h @@ -104,7 +104,7 @@ struct nghttp3_ksl_blk { }; }; -nghttp3_objalloc_decl(ksl_blk, nghttp3_ksl_blk, oplent); +nghttp3_objalloc_decl(ksl_blk, nghttp3_ksl_blk, oplent) /* * nghttp3_ksl_compar is a function type which returns nonzero if key diff --git a/lib/nghttp3_macro.h b/lib/nghttp3_macro.h index a4e1dfe..ffe0ea7 100644 --- a/lib/nghttp3_macro.h +++ b/lib/nghttp3_macro.h @@ -48,27 +48,27 @@ #define nghttp3_max_def(SUFFIX, T) \ static inline T nghttp3_max_##SUFFIX(T a, T b) { return a < b ? b : a; } -nghttp3_max_def(int8, int8_t); -nghttp3_max_def(int16, int16_t); -nghttp3_max_def(int32, int32_t); -nghttp3_max_def(int64, int64_t); -nghttp3_max_def(uint8, uint8_t); -nghttp3_max_def(uint16, uint16_t); -nghttp3_max_def(uint32, uint32_t); -nghttp3_max_def(uint64, uint64_t); -nghttp3_max_def(size, size_t); +nghttp3_max_def(int8, int8_t) +nghttp3_max_def(int16, int16_t) +nghttp3_max_def(int32, int32_t) +nghttp3_max_def(int64, int64_t) +nghttp3_max_def(uint8, uint8_t) +nghttp3_max_def(uint16, uint16_t) +nghttp3_max_def(uint32, uint32_t) +nghttp3_max_def(uint64, uint64_t) +nghttp3_max_def(size, size_t) #define nghttp3_min_def(SUFFIX, T) \ static inline T nghttp3_min_##SUFFIX(T a, T b) { return a < b ? a : b; } -nghttp3_min_def(int8, int8_t); -nghttp3_min_def(int16, int16_t); -nghttp3_min_def(int32, int32_t); -nghttp3_min_def(int64, int64_t); -nghttp3_min_def(uint8, uint8_t); -nghttp3_min_def(uint16, uint16_t); -nghttp3_min_def(uint32, uint32_t); -nghttp3_min_def(uint64, uint64_t); -nghttp3_min_def(size, size_t); +nghttp3_min_def(int8, int8_t) +nghttp3_min_def(int16, int16_t) +nghttp3_min_def(int32, int32_t) +nghttp3_min_def(int64, int64_t) +nghttp3_min_def(uint8, uint8_t) +nghttp3_min_def(uint16, uint16_t) +nghttp3_min_def(uint32, uint32_t) +nghttp3_min_def(uint64, uint64_t) +nghttp3_min_def(size, size_t) #endif /* !defined(NGHTTP3_MACRO_H) */ diff --git a/lib/nghttp3_stream.c b/lib/nghttp3_stream.c index 328cddd..4967f93 100644 --- a/lib/nghttp3_stream.c +++ b/lib/nghttp3_stream.c @@ -44,7 +44,7 @@ /* NGHTTP3_MIN_RBLEN is the minimum length of nghttp3_ringbuf */ #define NGHTTP3_MIN_RBLEN 4 -nghttp3_objalloc_def(stream, nghttp3_stream, oplent); +nghttp3_objalloc_def(stream, nghttp3_stream, oplent) int nghttp3_stream_new(nghttp3_stream **pstream, int64_t stream_id, const nghttp3_stream_callbacks *callbacks, diff --git a/lib/nghttp3_stream.h b/lib/nghttp3_stream.h index 7d296fe..9c0a18c 100644 --- a/lib/nghttp3_stream.h +++ b/lib/nghttp3_stream.h @@ -255,7 +255,7 @@ struct nghttp3_stream { }; }; -nghttp3_objalloc_decl(stream, nghttp3_stream, oplent); +nghttp3_objalloc_decl(stream, nghttp3_stream, oplent) typedef struct nghttp3_frame_entry { nghttp3_frame fr; diff --git a/tests/nghttp3_conn_test.h b/tests/nghttp3_conn_test.h index d28d20f..9db6e78 100644 --- a/tests/nghttp3_conn_test.h +++ b/tests/nghttp3_conn_test.h @@ -35,32 +35,32 @@ extern const MunitSuite conn_suite; -munit_void_test_decl(test_nghttp3_conn_read_control); -munit_void_test_decl(test_nghttp3_conn_write_control); -munit_void_test_decl(test_nghttp3_conn_submit_request); -munit_void_test_decl(test_nghttp3_conn_http_request); -munit_void_test_decl(test_nghttp3_conn_http_resp_header); -munit_void_test_decl(test_nghttp3_conn_http_req_header); -munit_void_test_decl(test_nghttp3_conn_http_content_length); -munit_void_test_decl(test_nghttp3_conn_http_content_length_mismatch); -munit_void_test_decl(test_nghttp3_conn_http_non_final_response); -munit_void_test_decl(test_nghttp3_conn_http_trailers); -munit_void_test_decl(test_nghttp3_conn_http_ignore_content_length); -munit_void_test_decl(test_nghttp3_conn_http_record_request_method); -munit_void_test_decl(test_nghttp3_conn_http_error); -munit_void_test_decl(test_nghttp3_conn_qpack_blocked_stream); -munit_void_test_decl(test_nghttp3_conn_just_fin); -munit_void_test_decl(test_nghttp3_conn_submit_response_read_blocked); -munit_void_test_decl(test_nghttp3_conn_recv_uni); -munit_void_test_decl(test_nghttp3_conn_recv_goaway); -munit_void_test_decl(test_nghttp3_conn_shutdown_server); -munit_void_test_decl(test_nghttp3_conn_shutdown_client); -munit_void_test_decl(test_nghttp3_conn_priority_update); -munit_void_test_decl(test_nghttp3_conn_request_priority); -munit_void_test_decl(test_nghttp3_conn_set_stream_priority); -munit_void_test_decl(test_nghttp3_conn_shutdown_stream_read); -munit_void_test_decl(test_nghttp3_conn_stream_data_overflow); -munit_void_test_decl(test_nghttp3_conn_get_frame_payload_left); -munit_void_test_decl(test_nghttp3_conn_update_ack_offset); +munit_void_test_decl(test_nghttp3_conn_read_control) +munit_void_test_decl(test_nghttp3_conn_write_control) +munit_void_test_decl(test_nghttp3_conn_submit_request) +munit_void_test_decl(test_nghttp3_conn_http_request) +munit_void_test_decl(test_nghttp3_conn_http_resp_header) +munit_void_test_decl(test_nghttp3_conn_http_req_header) +munit_void_test_decl(test_nghttp3_conn_http_content_length) +munit_void_test_decl(test_nghttp3_conn_http_content_length_mismatch) +munit_void_test_decl(test_nghttp3_conn_http_non_final_response) +munit_void_test_decl(test_nghttp3_conn_http_trailers) +munit_void_test_decl(test_nghttp3_conn_http_ignore_content_length) +munit_void_test_decl(test_nghttp3_conn_http_record_request_method) +munit_void_test_decl(test_nghttp3_conn_http_error) +munit_void_test_decl(test_nghttp3_conn_qpack_blocked_stream) +munit_void_test_decl(test_nghttp3_conn_just_fin) +munit_void_test_decl(test_nghttp3_conn_submit_response_read_blocked) +munit_void_test_decl(test_nghttp3_conn_recv_uni) +munit_void_test_decl(test_nghttp3_conn_recv_goaway) +munit_void_test_decl(test_nghttp3_conn_shutdown_server) +munit_void_test_decl(test_nghttp3_conn_shutdown_client) +munit_void_test_decl(test_nghttp3_conn_priority_update) +munit_void_test_decl(test_nghttp3_conn_request_priority) +munit_void_test_decl(test_nghttp3_conn_set_stream_priority) +munit_void_test_decl(test_nghttp3_conn_shutdown_stream_read) +munit_void_test_decl(test_nghttp3_conn_stream_data_overflow) +munit_void_test_decl(test_nghttp3_conn_get_frame_payload_left) +munit_void_test_decl(test_nghttp3_conn_update_ack_offset) #endif /* !defined(NGHTTP3_CONN_TEST_H) */ diff --git a/tests/nghttp3_http_test.h b/tests/nghttp3_http_test.h index b44dfbf..2e4f326 100644 --- a/tests/nghttp3_http_test.h +++ b/tests/nghttp3_http_test.h @@ -35,7 +35,7 @@ extern const MunitSuite http_suite; -munit_void_test_decl(test_nghttp3_http_parse_priority); -munit_void_test_decl(test_nghttp3_check_header_value); +munit_void_test_decl(test_nghttp3_http_parse_priority) +munit_void_test_decl(test_nghttp3_check_header_value) #endif /* !defined(NGHTTP3_HTTP_TEST_H) */ diff --git a/tests/nghttp3_qpack_test.h b/tests/nghttp3_qpack_test.h index c4e094b..e94856d 100644 --- a/tests/nghttp3_qpack_test.h +++ b/tests/nghttp3_qpack_test.h @@ -35,16 +35,16 @@ extern const MunitSuite qpack_suite; -munit_void_test_decl(test_nghttp3_qpack_encoder_encode); -munit_void_test_decl(test_nghttp3_qpack_encoder_encode_try_encode); -munit_void_test_decl(test_nghttp3_qpack_encoder_still_blocked); -munit_void_test_decl(test_nghttp3_qpack_encoder_set_dtable_cap); -munit_void_test_decl(test_nghttp3_qpack_decoder_feedback); -munit_void_test_decl(test_nghttp3_qpack_decoder_stream_overflow); -munit_void_test_decl(test_nghttp3_qpack_huffman); -munit_void_test_decl(test_nghttp3_qpack_huffman_decode_failure_state); -munit_void_test_decl(test_nghttp3_qpack_decoder_reconstruct_ricnt); -munit_void_test_decl(test_nghttp3_qpack_decoder_read_encoder); -munit_void_test_decl(test_nghttp3_qpack_encoder_read_decoder); +munit_void_test_decl(test_nghttp3_qpack_encoder_encode) +munit_void_test_decl(test_nghttp3_qpack_encoder_encode_try_encode) +munit_void_test_decl(test_nghttp3_qpack_encoder_still_blocked) +munit_void_test_decl(test_nghttp3_qpack_encoder_set_dtable_cap) +munit_void_test_decl(test_nghttp3_qpack_decoder_feedback) +munit_void_test_decl(test_nghttp3_qpack_decoder_stream_overflow) +munit_void_test_decl(test_nghttp3_qpack_huffman) +munit_void_test_decl(test_nghttp3_qpack_huffman_decode_failure_state) +munit_void_test_decl(test_nghttp3_qpack_decoder_reconstruct_ricnt) +munit_void_test_decl(test_nghttp3_qpack_decoder_read_encoder) +munit_void_test_decl(test_nghttp3_qpack_encoder_read_decoder) #endif /* !defined(NGHTTP3_QPACK_TEST_H) */ diff --git a/tests/nghttp3_tnode_test.h b/tests/nghttp3_tnode_test.h index 01ba678..7a88119 100644 --- a/tests/nghttp3_tnode_test.h +++ b/tests/nghttp3_tnode_test.h @@ -35,6 +35,6 @@ extern const MunitSuite tnode_suite; -munit_void_test_decl(test_nghttp3_tnode_schedule); +munit_void_test_decl(test_nghttp3_tnode_schedule) #endif /* !defined(NGHTTP3_TNODE_TEST_H) */