You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2017/03/22 18:23:15 UTC

qpid-dispatch git commit: DISPATCH-613, DISPATCH-616 - Added -Wpedantic and fixed resulting compiler errors.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master d275d18c2 -> 8842c71fb


DISPATCH-613, DISPATCH-616 - Added -Wpedantic and fixed resulting compiler errors.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/8842c71f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/8842c71f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/8842c71f

Branch: refs/heads/master
Commit: 8842c71fb18597d25430c425fcac5d977a255294
Parents: d275d18
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Mar 22 14:22:05 2017 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Mar 22 14:22:05 2017 -0400

----------------------------------------------------------------------
 CMakeLists.txt                  | 1 +
 include/qpid/dispatch/message.h | 2 +-
 src/alloc_pool.c                | 6 +++---
 src/alloc_pool.h                | 7 ++++---
 src/http-libwebsockets.c        | 2 +-
 src/message.c                   | 4 ++--
 tests/alloc_test.c              | 1 +
 tests/buffer_test.c             | 1 +
 tests/compose_test.c            | 1 +
 tests/failoverlist_test.c       | 1 +
 tests/field_test.c              | 1 +
 tests/message_test.c            | 2 ++
 tests/parse_test.c              | 1 +
 tests/policy_test.c             | 1 +
 tests/test_case.h               | 2 +-
 tests/timer_test.c              | 1 +
 tests/tool_test.c               | 1 +
 17 files changed, 24 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1f45ae..eacb375 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,6 +127,7 @@ include_directories(
 if (NOT CMAKE_SYSTEM_NAME STREQUAL SunOS)
  add_compile_options(-Werror)
  add_compile_options(-Wall)
+ add_compile_options(-Wpedantic)
  add_compile_options(-std=gnu99)
  add_compile_options(-pthread)
 else (NOT CMAKE_SYSTEM_NAME STREQUAL SunOS)

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/include/qpid/dispatch/message.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/message.h b/include/qpid/dispatch/message.h
index b3a3201..523e150 100644
--- a/include/qpid/dispatch/message.h
+++ b/include/qpid/dispatch/message.h
@@ -238,7 +238,7 @@ qd_iterator_t *qd_message_field_iterator_typed(qd_message_t *msg, qd_message_fie
 qd_iterator_t *qd_message_field_iterator(qd_message_t *msg, qd_message_field_t field);
 
 ssize_t qd_message_field_length(qd_message_t *msg, qd_message_field_t field);
-ssize_t qd_message_field_copy(qd_message_t *msg, qd_message_field_t field, void *buffer, size_t *hdr_length);
+ssize_t qd_message_field_copy(qd_message_t *msg, qd_message_field_t field, char *buffer, size_t *hdr_length);
 
 //
 // Functions for composed messages

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/src/alloc_pool.c
----------------------------------------------------------------------
diff --git a/src/alloc_pool.c b/src/alloc_pool.c
index ce6fcb2..ff33c07 100644
--- a/src/alloc_pool.c
+++ b/src/alloc_pool.c
@@ -146,7 +146,7 @@ void *qd_alloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool)
 #ifdef QD_MEMORY_DEBUG
         item->desc   = desc;
         item->header = PATTERN_FRONT;
-        *((uint32_t*) ((void*) &item[1] + desc->total_size))= PATTERN_BACK;
+        *((uint32_t*) ((char*) &item[1] + desc->total_size))= PATTERN_BACK;
 #endif
         return &item[1];
     }
@@ -198,7 +198,7 @@ void *qd_alloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool)
 #ifdef QD_MEMORY_DEBUG
         item->desc = desc;
         item->header = PATTERN_FRONT;
-        *((uint32_t*) ((void*) &item[1] + desc->total_size))= PATTERN_BACK;
+        *((uint32_t*) ((char*) &item[1] + desc->total_size))= PATTERN_BACK;
 #endif
         return &item[1];
     }
@@ -208,7 +208,7 @@ void *qd_alloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool)
 
 
 /* coverity[+free : arg-2] */
-void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, void *p)
+void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p)
 {
     if (!p) return;
     qd_alloc_item_t *item = ((qd_alloc_item_t*) p) - 1;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/src/alloc_pool.h
----------------------------------------------------------------------
diff --git a/src/alloc_pool.h b/src/alloc_pool.h
index fcddede..1d5decc 100644
--- a/src/alloc_pool.h
+++ b/src/alloc_pool.h
@@ -72,7 +72,7 @@ typedef struct {
 /** Allocate in a thread pool. Use via ALLOC_DECLARE */
 void *qd_alloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool);
 /** De-allocate from a thread pool. Use via ALLOC_DECLARE */
-void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, void *p);
+void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p);
 
 /**
  * Declare functions new_T and alloc_T
@@ -90,8 +90,9 @@ void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, void *p);
     qd_alloc_type_desc_t __desc_##T  __attribute__((aligned(64))) = {0, #T, S, A, 0, C, 0, 0, 0, {0,0}, 0}; \
     __thread qd_alloc_pool_t *__local_pool_##T = 0;                     \
     T *new_##T(void) { return (T*) qd_alloc(&__desc_##T, &__local_pool_##T); }  \
-    void free_##T(T *p) { qd_dealloc(&__desc_##T, &__local_pool_##T, (void*) p); } \
-    qd_alloc_stats_t *alloc_stats_##T(void) { return __desc_##T.stats; }
+    void free_##T(T *p) { qd_dealloc(&__desc_##T, &__local_pool_##T, (char*) p); } \
+    qd_alloc_stats_t *alloc_stats_##T(void) { return __desc_##T.stats; } \
+    void *unused##T
 
 /**
  * Define functions new_T and alloc_T

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/src/http-libwebsockets.c
----------------------------------------------------------------------
diff --git a/src/http-libwebsockets.c b/src/http-libwebsockets.c
index 9ceaa49..745b090 100644
--- a/src/http-libwebsockets.c
+++ b/src/http-libwebsockets.c
@@ -169,7 +169,7 @@ static int callback_http(struct lws *wsi, enum lws_callback_reasons reason,
 }
 
 /* Buffer to allocate extra header space required by LWS.  */
-typedef struct buffer_t { void *start; size_t size; size_t cap; } buffer_t;
+typedef struct buffer_t { char *start; size_t size; size_t cap; } buffer_t;
 
 /* Callbacks for promoted AMQP over WS connections.
  * Called with http lock held.

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/src/message.c
----------------------------------------------------------------------
diff --git a/src/message.c b/src/message.c
index 965944f..e7ff208 100644
--- a/src/message.c
+++ b/src/message.c
@@ -63,7 +63,7 @@ static const unsigned char * const TAGS_ANY                     = (unsigned char
     "\xa1\xb1\xa3\xb3\xe0\xf0"
     "\x40\x56\x41\x42\x50\x60\x70\x52\x43\x80\x53\x44\x51\x61\x71\x54\x81\x55\x72\x82\x74\x84\x94\x73\x83\x98";
 
-PN_HANDLE(PN_DELIVERY_CTX);
+PN_HANDLE(PN_DELIVERY_CTX)
 
 ALLOC_DEFINE_CONFIG(qd_message_t, sizeof(qd_message_pvt_t), 0, 0);
 ALLOC_DEFINE(qd_message_content_t);
@@ -1418,7 +1418,7 @@ ssize_t qd_message_field_length(qd_message_t *msg, qd_message_field_t field)
 }
 
 
-ssize_t qd_message_field_copy(qd_message_t *msg, qd_message_field_t field, void *buffer, size_t *hdr_length)
+ssize_t qd_message_field_copy(qd_message_t *msg, qd_message_field_t field, char *buffer, size_t *hdr_length)
 {
     qd_field_location_t *loc = qd_message_field_location(msg, field);
     if (!loc)

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/alloc_test.c
----------------------------------------------------------------------
diff --git a/tests/alloc_test.c b/tests/alloc_test.c
index 3e664a2..46e5af6 100644
--- a/tests/alloc_test.c
+++ b/tests/alloc_test.c
@@ -75,6 +75,7 @@ static char* test_alloc_basic(void *context)
 int alloc_tests(void)
 {
     int result = 0;
+    char *test_group = "alloc_tests";
 
     TEST_CASE(test_alloc_basic, 0);
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/buffer_test.c
----------------------------------------------------------------------
diff --git a/tests/buffer_test.c b/tests/buffer_test.c
index 48e78c9..0dedad5 100644
--- a/tests/buffer_test.c
+++ b/tests/buffer_test.c
@@ -88,6 +88,7 @@ static char *test_buffer_list_clone(void *context)
 int buffer_tests()
 {
     int result = 0;
+    char *test_group = "buffer_tests";
 
     TEST_CASE(test_buffer_list_clone, 0);
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/compose_test.c
----------------------------------------------------------------------
diff --git a/tests/compose_test.c b/tests/compose_test.c
index 700ec0b..3986769 100644
--- a/tests/compose_test.c
+++ b/tests/compose_test.c
@@ -342,6 +342,7 @@ static char *test_compose_subfields(void *context)
 int compose_tests()
 {
     int result = 0;
+    char *test_group = "compose_tests";
 
     TEST_CASE(test_compose_list_of_maps, 0);
     TEST_CASE(test_compose_nested_composites, 0);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/failoverlist_test.c
----------------------------------------------------------------------
diff --git a/tests/failoverlist_test.c b/tests/failoverlist_test.c
index 8f4c256..62544c1 100644
--- a/tests/failoverlist_test.c
+++ b/tests/failoverlist_test.c
@@ -161,6 +161,7 @@ static char *test_failover_list_multiple(void *unused)
 int failoverlist_tests()
 {
     int result = 0;
+    char *test_group = "failover_tests";
 
     TEST_CASE(test_failover_list_empty, 0);
     TEST_CASE(test_failover_list_single, 0);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/field_test.c
----------------------------------------------------------------------
diff --git a/tests/field_test.c b/tests/field_test.c
index c1e1f55..fab8951 100644
--- a/tests/field_test.c
+++ b/tests/field_test.c
@@ -965,6 +965,7 @@ static char *test_prefix_hash_with_space(void *context)
 int field_tests(void)
 {
     int result = 0;
+    char *test_group = "field_tests";
 
     qd_iterator_set_address("my-area", "my-router");
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/message_test.c
----------------------------------------------------------------------
diff --git a/tests/message_test.c b/tests/message_test.c
index cd6c640..0d62f31 100644
--- a/tests/message_test.c
+++ b/tests/message_test.c
@@ -305,6 +305,8 @@ static char* test_send_message_annotations(void *context)
 int message_tests(void)
 {
     int result = 0;
+    char *test_group = "message_tests";
+
     TEST_CASE(test_send_to_messenger, 0);
     TEST_CASE(test_receive_from_messenger, 0);
     TEST_CASE(test_message_properties, 0);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/parse_test.c
----------------------------------------------------------------------
diff --git a/tests/parse_test.c b/tests/parse_test.c
index 9e250cd..897cece 100644
--- a/tests/parse_test.c
+++ b/tests/parse_test.c
@@ -338,6 +338,7 @@ static char *test_tracemask(void *context)
 int parse_tests()
 {
     int result = 0;
+    char *test_group = "parse_tests";
 
     TEST_CASE(test_parser_fixed_scalars, 0);
     TEST_CASE(test_map, 0);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/policy_test.c
----------------------------------------------------------------------
diff --git a/tests/policy_test.c b/tests/policy_test.c
index 0061169..9409c3d 100644
--- a/tests/policy_test.c
+++ b/tests/policy_test.c
@@ -81,6 +81,7 @@ static char *test_link_name_lookup(void *context)
 int policy_tests(void)
 {
     int result = 0;
+    char *test_group = "policy_tests";
 
     TEST_CASE(test_link_name_lookup, 0);
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/test_case.h
----------------------------------------------------------------------
diff --git a/tests/test_case.h b/tests/test_case.h
index 6e36b44..ce3a3fa 100644
--- a/tests/test_case.h
+++ b/tests/test_case.h
@@ -23,7 +23,7 @@ typedef char* (*testcase_t)(void *context);
 
 #define TEST_CASE(T,C) do {                        \
     char *r = T(C);                                \
-    printf("Test Case %s.%s: ", __FUNCTION__, #T); \
+    printf("Test Case %s.%s: ", test_group, #T); \
     if (r) {                                       \
         printf("FAIL: %s\n", r);                   \
         result++;                                  \

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/timer_test.c
----------------------------------------------------------------------
diff --git a/tests/timer_test.c b/tests/timer_test.c
index 9fab15a..510ac95 100644
--- a/tests/timer_test.c
+++ b/tests/timer_test.c
@@ -367,6 +367,7 @@ static char* test_big(void *context)
 int timer_tests(void)
 {
     int result = 0;
+    char *test_group = "timer_tests";
 
     fire_mask = 0;
     DEQ_INIT(pending_timers);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8842c71f/tests/tool_test.c
----------------------------------------------------------------------
diff --git a/tests/tool_test.c b/tests/tool_test.c
index 4b68edc..9eac41d 100644
--- a/tests/tool_test.c
+++ b/tests/tool_test.c
@@ -309,6 +309,7 @@ static char* test_bitmask(void *context)
 int tool_tests(void)
 {
     int result = 0;
+    char *test_group = "tool_tests";
 
     TEST_CASE(test_deq_basic, 0);
     TEST_CASE(test_deq_basic2, 0);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org