]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence warnings
authorMark Andrews <marka@isc.org>
Sat, 26 Apr 2014 13:42:37 +0000 (23:42 +1000)
committerMark Andrews <marka@isc.org>
Sat, 26 Apr 2014 13:42:37 +0000 (23:42 +1000)
bin/tests/sock_test.c
bin/tests/task_test.c
bin/tests/timer_test.c

index 02406b18acb8cae04bdc133e40a762adbd88f095..57c390697a465dbe3545c11291bd97c102511212 100644 (file)
@@ -247,6 +247,11 @@ timeout(isc_task_t *task, isc_event_t *event) {
        isc_event_free(&event);
 }
 
+static char one[] = "1";
+static char two[] = "2";
+static char xso1[] = "so1";
+static char xso2[] = "so2";
+
 int
 main(int argc, char *argv[]) {
        isc_task_t *t1, *t2;
@@ -301,9 +306,9 @@ main(int argc, char *argv[]) {
        RUNTIME_CHECK(isc_task_create(manager, 0, &t1) == ISC_R_SUCCESS);
        t2 = NULL;
        RUNTIME_CHECK(isc_task_create(manager, 0, &t2) == ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, "1") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, one) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, "2") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, two) ==
                      ISC_R_SUCCESS);
 
        printf("task 1 = %p\n", t1);
@@ -333,7 +338,7 @@ main(int argc, char *argv[]) {
        /*
         * Queue up the first accept event.
         */
-       RUNTIME_CHECK(isc_socket_accept(so1, t1, my_listen, "so1")
+       RUNTIME_CHECK(isc_socket_accept(so1, t1, my_listen, xso1)
                      == ISC_R_SUCCESS);
        isc_time_settoepoch(&expires);
        isc_interval_set(&interval, 10, 0);
@@ -357,7 +362,7 @@ main(int argc, char *argv[]) {
                                        &so2) == ISC_R_SUCCESS);
 
        RUNTIME_CHECK(isc_socket_connect(so2, &sockaddr, t2,
-                                        my_connect, "so2") == ISC_R_SUCCESS);
+                                        my_connect, xso2) == ISC_R_SUCCESS);
 
        /*
         * Detaching these is safe, since the socket will attach to the
index 49ccd9de36918b907c5272f51b125914d9df1280..24c06caa250b1636ac36591b3a8a820bc6024039 100644 (file)
@@ -58,6 +58,13 @@ my_tick(isc_task_t *task, isc_event_t *event) {
        isc_event_free(&event);
 }
 
+static char one[] = "1";
+static char two[] = "2";
+static char three[] = "3";
+static char four[] = "4";
+static char foo[] = "foo";
+static char bar[] = "bar";
+
 int
 main(int argc, char *argv[]) {
        isc_taskmgr_t *manager = NULL;
@@ -89,13 +96,13 @@ main(int argc, char *argv[]) {
        RUNTIME_CHECK(isc_task_create(manager, 0, &t3) == ISC_R_SUCCESS);
        RUNTIME_CHECK(isc_task_create(manager, 0, &t4) == ISC_R_SUCCESS);
 
-       RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, "1") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t1, my_shutdown, one) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, "2") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t2, my_shutdown, two) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t3, my_shutdown, "3") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t3, my_shutdown, three) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t4, my_shutdown, "4") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t4, my_shutdown, four) ==
                      ISC_R_SUCCESS);
 
        timgr = NULL;
@@ -104,13 +111,13 @@ main(int argc, char *argv[]) {
 
        isc_interval_set(&interval, 1, 0);
        RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
-                                      &interval, t1, my_tick, "foo", &ti1) ==
+                                      &interval, t1, my_tick, foo, &ti1) ==
                      ISC_R_SUCCESS);
 
        ti2 = NULL;
        isc_interval_set(&interval, 1, 0);
        RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
-                                      &interval, t2, my_tick, "bar", &ti2) ==
+                                      &interval, t2, my_tick, bar, &ti2) ==
                      ISC_R_SUCCESS);
 
        printf("task 1 = %p\n", t1);
@@ -129,49 +136,49 @@ main(int argc, char *argv[]) {
         * structure (socket, timer, task, etc) but this is just a test
         * program.
         */
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "1",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, one,
                                   sizeof(*event));
        isc_task_send(t1, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "2",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, two,
                                   sizeof(*event));
        isc_task_send(t2, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "3",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, three,
                                   sizeof(*event));
        isc_task_send(t3, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "4",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, four,
                                   sizeof(*event));
        isc_task_send(t4, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "2",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, two,
                                   sizeof(*event));
        isc_task_send(t2, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "3",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, three,
                                   sizeof(*event));
        isc_task_send(t3, &event);
-       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, "4",
+       event = isc_event_allocate(mctx, (void *)1, 1, my_callback, four,
                                   sizeof(*event));
        isc_task_send(t4, &event);
        isc_task_purgerange(t3,
index c0269236bc9800a3a1b82b832af146aa6ce09f8a..1d2a42bf744d72099d776395a63aa5bf6c4cb93e 100644 (file)
@@ -94,6 +94,10 @@ timeout(isc_task_t *task, isc_event_t *event) {
        isc_task_shutdown(task);
 }
 
+static char one[] = "1";
+static char two[] = "2";
+static char three[] = "3";
+
 int
 main(int argc, char *argv[]) {
        isc_taskmgr_t *manager = NULL;
@@ -123,11 +127,11 @@ main(int argc, char *argv[]) {
                      ISC_R_SUCCESS);
        RUNTIME_CHECK(isc_task_create(manager, 0, &t3) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t1, shutdown_task, "1") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t1, shutdown_task, one) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t2, shutdown_task, "2") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t2, shutdown_task, two) ==
                      ISC_R_SUCCESS);
-       RUNTIME_CHECK(isc_task_onshutdown(t3, shutdown_task, "3") ==
+       RUNTIME_CHECK(isc_task_onshutdown(t3, shutdown_task, three) ==
                      ISC_R_SUCCESS);
 
        printf("task 1: %p\n", t1);
@@ -138,12 +142,12 @@ main(int argc, char *argv[]) {
 
        isc_interval_set(&interval, 2, 0);
        RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_once, NULL,
-                                      &interval, t2, timeout, "2", &ti2) ==
+                                      &interval, t2, timeout, two, &ti2) ==
                      ISC_R_SUCCESS);
 
        isc_interval_set(&interval, 1, 0);
        RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_ticker, NULL,
-                                      &interval, t1, tick, "1", &ti1) ==
+                                      &interval, t1, tick, one, &ti1) ==
                      ISC_R_SUCCESS);
 
        isc_interval_set(&interval, 10, 0);
@@ -151,7 +155,7 @@ main(int argc, char *argv[]) {
                      ISC_R_SUCCESS);
        isc_interval_set(&interval, 2, 0);
        RUNTIME_CHECK(isc_timer_create(timgr, isc_timertype_once, &expires,
-                                      &interval, t3, timeout, "3", &ti3) ==
+                                      &interval, t3, timeout, three, &ti3) ==
                      ISC_R_SUCCESS);
 
        isc_task_detach(&t1);