aboutsummaryrefslogtreecommitdiff
path: root/src/social
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-05-06 17:45:30 +0000
committerGabor X Toth <*@tg-x.net>2016-05-06 17:45:30 +0000
commitb402cb83245e4c62b1bb62c2915c67bf7d2465f2 (patch)
tree49e33a0a2c78f7d723b9d64e6a9bf5723818aadd /src/social
parent9881c55b0178823d86cb28b3f5aaf9cc31744dc0 (diff)
downloadgnunet-b402cb83245e4c62b1bb62c2915c67bf7d2465f2.tar.gz
gnunet-b402cb83245e4c62b1bb62c2915c67bf7d2465f2.zip
social: fix compiler warnings
Diffstat (limited to 'src/social')
-rw-r--r--src/social/gnunet-service-social.c18
-rw-r--r--src/social/test_social.c33
2 files changed, 27 insertions, 24 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index e2d6544c1..ede1b0104 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -1308,7 +1308,7 @@ app_place_remove (const char *app_id,
1308 { 1308 {
1309 GNUNET_break (0); 1309 GNUNET_break (0);
1310 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1310 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1311 "Error removing app place file: %s: %s\n", 1311 "Error removing app place file: %s: %s (%d)\n",
1312 app_place_filename, strerror (errno), errno); 1312 app_place_filename, strerror (errno), errno);
1313 ret = GNUNET_SYSERR; 1313 ret = GNUNET_SYSERR;
1314 } 1314 }
@@ -1641,7 +1641,7 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst)
1641 if (0 != remaining) 1641 if (0 != remaining)
1642 { 1642 {
1643 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1643 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1644 "%u + %u + %u != %u\n", 1644 "%zu + %u + %u != %u\n",
1645 sizeof (*greq), relay_size, join_msg_size, greq_size); 1645 sizeof (*greq), relay_size, join_msg_size, greq_size);
1646 GNUNET_break (0); 1646 GNUNET_break (0);
1647 GNUNET_free (gst); 1647 GNUNET_free (gst);
@@ -2656,9 +2656,9 @@ psyc_transmit_queue_next_method (struct Place *plc)
2656 { 2656 {
2657 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2657 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2658 "%p psyc_transmit_queue_next_method: invalid method name.\n", 2658 "%p psyc_transmit_queue_next_method: invalid method name.\n",
2659 plc, ntohs (pmsg->type)); 2659 plc);
2660 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2660 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2661 "%u <= %u || NUL != %u\n", 2661 "%zu <= %u || NUL != %u\n",
2662 sizeof (*pmeth), psize, *((char *) pmeth + psize - 1)); 2662 sizeof (*pmeth), psize, *((char *) pmeth + psize - 1));
2663 GNUNET_break (0); 2663 GNUNET_break (0);
2664 GNUNET_free (pmeth); 2664 GNUNET_free (pmeth);
@@ -2924,7 +2924,8 @@ psyc_recv_history_result (void *cls, int64_t result,
2924 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2924 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2925 "%p History replay #%" PRIu64 ": " 2925 "%p History replay #%" PRIu64 ": "
2926 "PSYCstore returned %" PRId64 " (%.*s)\n", 2926 "PSYCstore returned %" PRId64 " (%.*s)\n",
2927 opcls->plc, GNUNET_ntohll (opcls->op_id), result, err_msg_size, err_msg); 2927 opcls->plc, GNUNET_ntohll (opcls->op_id), result,
2928 err_msg_size, (const char *) err_msg);
2928 2929
2929 // FIXME: place might have been destroyed 2930 // FIXME: place might have been destroyed
2930 client_send_result (opcls->client, opcls->op_id, result, err_msg, err_msg_size); 2931 client_send_result (opcls->client, opcls->op_id, result, err_msg, err_msg_size);
@@ -2953,7 +2954,7 @@ client_recv_history_replay (void *cls, struct GNUNET_SERVER_Client *client,
2953 { 2954 {
2954 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2955 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2955 "%p History replay #%" PRIu64 ": " 2956 "%p History replay #%" PRIu64 ": "
2956 "invalid method prefix. size: %u < %u?\n", 2957 "invalid method prefix. size: %u < %zu?\n",
2957 plc, GNUNET_ntohll (req->op_id), size, sizeof (*req) + 1); 2958 plc, GNUNET_ntohll (req->op_id), size, sizeof (*req) + 1);
2958 GNUNET_break (0); 2959 GNUNET_break (0);
2959 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 2960 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -3029,7 +3030,8 @@ psyc_recv_state_result (void *cls, int64_t result,
3029 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3030 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3030 "%p State get #%" PRIu64 ": " 3031 "%p State get #%" PRIu64 ": "
3031 "PSYCstore returned %" PRId64 " (%.*s)\n", 3032 "PSYCstore returned %" PRId64 " (%.*s)\n",
3032 opcls->plc, GNUNET_ntohll (opcls->op_id), result, err_msg_size, err_msg); 3033 opcls->plc, GNUNET_ntohll (opcls->op_id), result,
3034 err_msg_size, (const char *) err_msg);
3033 3035
3034 // FIXME: place might have been destroyed 3036 // FIXME: place might have been destroyed
3035 client_send_result (opcls->client, opcls->op_id, result, err_msg, err_msg_size); 3037 client_send_result (opcls->client, opcls->op_id, result, err_msg, err_msg_size);
@@ -3062,7 +3064,7 @@ client_recv_state_get (void *cls, struct GNUNET_SERVER_Client *client,
3062 { 3064 {
3063 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 3065 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
3064 "%p State get #%" PRIu64 ": " 3066 "%p State get #%" PRIu64 ": "
3065 "invalid name. size: %u < %u?\n", 3067 "invalid name. size: %u < %zu?\n",
3066 plc, GNUNET_ntohll (req->op_id), size, sizeof (*req) + 1); 3068 plc, GNUNET_ntohll (req->op_id), size, sizeof (*req) + 1);
3067 GNUNET_break (0); 3069 GNUNET_break (0);
3068 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 3070 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
diff --git a/src/social/test_social.c b/src/social/test_social.c
index 9c07a7be6..6acb15aab 100644
--- a/src/social/test_social.c
+++ b/src/social/test_social.c
@@ -510,8 +510,8 @@ host_recv_zone_add_place_result (void *cls, int64_t result,
510 const void *data, uint16_t data_size) 510 const void *data, uint16_t data_size)
511{ 511{
512 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 512 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
513 "Test #%u: Zone add place result: %d (%.*s).\n", 513 "Test #%u: Zone add place result: %" PRId64 " (%.*s).\n",
514 test, result, data_size, data); 514 test, result, data_size, (const char *) data);
515 GNUNET_assert (GNUNET_YES == result); 515 GNUNET_assert (GNUNET_YES == result);
516 516
517 GNUNET_assert (GNUNET_YES == is_guest_nym_added); 517 GNUNET_assert (GNUNET_YES == is_guest_nym_added);
@@ -600,7 +600,7 @@ guest_look_for_result (void *cls,
600{ 600{
601 struct ResultClosure *rcls = cls; 601 struct ResultClosure *rcls = cls;
602 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 602 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
603 "guest_look_for_result: %d\n", result_code); 603 "guest_look_for_result: %" PRId64 "\n", result_code);
604 GNUNET_assert (GNUNET_OK == result_code); 604 GNUNET_assert (GNUNET_OK == result_code);
605 GNUNET_assert (3 == rcls->n); 605 GNUNET_assert (3 == rcls->n);
606 GNUNET_free (rcls); 606 GNUNET_free (rcls);
@@ -620,7 +620,7 @@ guest_look_for_var (void *cls,
620 rcls->n++; 620 rcls->n++;
621 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 621 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
622 "guest_look_for_var: %s\n%.*s\n", 622 "guest_look_for_var: %s\n%.*s\n",
623 name, value_size, value); 623 name, value_size, (const char *) value);
624} 624}
625 625
626 626
@@ -640,7 +640,7 @@ guest_look_at_result (void *cls, int64_t result_code,
640 struct ResultClosure *rcls = cls; 640 struct ResultClosure *rcls = cls;
641 641
642 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 642 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
643 "guest_look_at_result: %d\n", result_code); 643 "guest_look_at_result: %" PRId64 "\n", result_code);
644 GNUNET_assert (GNUNET_OK == result_code); 644 GNUNET_assert (GNUNET_OK == result_code);
645 GNUNET_assert (1 == rcls->n); 645 GNUNET_assert (1 == rcls->n);
646 GNUNET_free (rcls); 646 GNUNET_free (rcls);
@@ -661,7 +661,7 @@ guest_look_at_var (void *cls,
661 661
662 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 662 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
663 "guest_look_at_var: %s\n%.*s\n", 663 "guest_look_at_var: %s\n%.*s\n",
664 name, value_size, value); 664 name, value_size, (const char *) value);
665} 665}
666 666
667 667
@@ -680,9 +680,9 @@ guest_recv_history_replay_latest_result (void *cls, int64_t result,
680{ 680{
681 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 681 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
682 "Test #%u: Guest received latest history replay result " 682 "Test #%u: Guest received latest history replay result "
683 "(%lu messages, %" PRId64 " fragments):\n" 683 "(%" PRIu32 " messages, %" PRId64 " fragments):\n"
684 "%.*s\n", 684 "%.*s\n",
685 test, counter, result, data_size, data); 685 test, counter, result, data_size, (const char *) data);
686 //GNUNET_assert (2 == counter); /* message count */ 686 //GNUNET_assert (2 == counter); /* message count */
687 //GNUNET_assert (7 == result); /* fragment count */ 687 //GNUNET_assert (7 == result); /* fragment count */
688 688
@@ -710,7 +710,7 @@ guest_recv_history_replay_result (void *cls, int64_t result,
710 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 710 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
711 "Test #%u: Guest received history replay result: %" PRId64 "\n" 711 "Test #%u: Guest received history replay result: %" PRId64 "\n"
712 "%.*s\n", 712 "%.*s\n",
713 test, result, data_size, data); 713 test, result, data_size, (const char *) data);
714// GNUNET_assert (2 == counter); /* message count */ 714// GNUNET_assert (2 == counter); /* message count */
715// GNUNET_assert (7 == result); /* fragment count */ 715// GNUNET_assert (7 == result); /* fragment count */
716 716
@@ -760,7 +760,7 @@ guest_recv_modifier (void *cls,
760 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 760 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
761 "Test #%u: Guest received modifier for message ID %" PRIu64 ":\n" 761 "Test #%u: Guest received modifier for message ID %" PRIu64 ":\n"
762 "%c%s: %.*s (size: %u)\n", 762 "%c%s: %.*s (size: %u)\n",
763 test, message_id, oper, name, value_size, value, value_size); 763 test, message_id, oper, name, value_size, (const char *) value, value_size);
764 /** @todo FIXME: check modifier */ 764 /** @todo FIXME: check modifier */
765} 765}
766 766
@@ -778,7 +778,7 @@ guest_recv_mod_foo_bar (void *cls,
778 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 778 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
779 "Test #%u: Guest received modifier matching _foo_bar for message ID %" PRIu64 ":\n" 779 "Test #%u: Guest received modifier matching _foo_bar for message ID %" PRIu64 ":\n"
780 "%c%s: %.*s (size: %u)\n", 780 "%c%s: %.*s (size: %u)\n",
781 test, message_id, oper, name, value_size, value, value_size); 781 test, message_id, oper, name, value_size, (const char *) value, value_size);
782 struct ResultClosure *rc = cls; 782 struct ResultClosure *rc = cls;
783 rc->n++; 783 rc->n++;
784 /** @todo FIXME: check modifier */ 784 /** @todo FIXME: check modifier */
@@ -796,7 +796,7 @@ guest_recv_data (void *cls,
796 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 796 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
797 "Test #%u: Guest received data for message ID %" PRIu64 ":\n" 797 "Test #%u: Guest received data for message ID %" PRIu64 ":\n"
798 "%.*s\n", 798 "%.*s\n",
799 test, message_id, data_size, data); 799 test, message_id, data_size, (const char *) data);
800 /** @todo FIXME: check data */ 800 /** @todo FIXME: check data */
801} 801}
802 802
@@ -872,7 +872,7 @@ host_recv_modifier (void *cls,
872 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 872 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
873 "Test #%u: Host received modifier for message ID %" PRIu64 ":\n" 873 "Test #%u: Host received modifier for message ID %" PRIu64 ":\n"
874 "%c%s: %.*s\n", 874 "%c%s: %.*s\n",
875 test, message_id, oper, name, value_size, value); 875 test, message_id, oper, name, value_size, (const char *) value);
876} 876}
877 877
878 878
@@ -887,7 +887,7 @@ host_recv_data (void *cls,
887 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 887 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
888 "Test #%u: Host received data for message ID %" PRIu64 ":\n" 888 "Test #%u: Host received data for message ID %" PRIu64 ":\n"
889 "%.*s\n", 889 "%.*s\n",
890 test, message_id, data_size, data); 890 test, message_id, data_size, (const char *) data);
891} 891}
892 892
893 893
@@ -1042,7 +1042,7 @@ guest_recv_entry_decision (void *cls,
1042 1042
1043 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1043 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1044 "%s\n%.*s\n", 1044 "%s\n%.*s\n",
1045 method_name, data_size, data); 1045 method_name, data_size, (const char *) data);
1046 /** @todo FIXME: check response message */ 1046 /** @todo FIXME: check response message */
1047 } 1047 }
1048 1048
@@ -1084,7 +1084,7 @@ host_answer_door (void *cls,
1084 test, join_req_count); 1084 test, join_req_count);
1085 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1085 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1086 "%s\n%.*s\n", 1086 "%s\n%.*s\n",
1087 method_name, data_size, data); 1087 method_name, data_size, (const char *) data);
1088 1088
1089 switch (test) 1089 switch (test)
1090 { 1090 {
@@ -1285,6 +1285,7 @@ id_host_created (void *cls, const char *emsg)
1285 app_recv_ego, 1285 app_recv_ego,
1286 app_recv_host, 1286 app_recv_host,
1287 app_recv_guest, 1287 app_recv_guest,
1288 app_connected,
1288 NULL); 1289 NULL);
1289} 1290}
1290 1291