From c1fe3f81e99bf3095003469b45300cbf97a26fb0 Mon Sep 17 00:00:00 2001 From: Sam hartman Date: Wed, 17 Apr 2013 12:44:11 +0100 Subject: [PATCH] fixes for building on Centos; mostly -Werror clean at this point --- common/tr_msg.c | 2 +- include/trust_router/tid.h | 3 ++- tid/tidc.c | 2 +- tid/tids.c | 9 ++++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/common/tr_msg.c b/common/tr_msg.c index 8138cfc..204f9d6 100644 --- a/common/tr_msg.c +++ b/common/tr_msg.c @@ -245,7 +245,7 @@ static TID_SRVR_BLK *tr_msg_decode_servers(json_t *jservers) size_t i, num_servers; num_servers = json_array_size(jservers); - fprintf(stderr, "tr_msg_decode_servers(): Number of servers = %d.\n", num_servers); + fprintf(stderr, "tr_msg_decode_servers(): Number of servers = %u.\n", (unsigned) num_servers); if (0 == num_servers) { fprintf(stderr, "tr_msg_decode_servers(): Server array is empty.\n"); diff --git a/include/trust_router/tid.h b/include/trust_router/tid.h index 428eaca..3072180 100644 --- a/include/trust_router/tid.h +++ b/include/trust_router/tid.h @@ -40,10 +40,11 @@ #include #include +#include #define TID_PORT 12309 -typedef struct gss_ctx_id_struct *gss_ctx_id_t; + typedef enum tid_rc { TID_SUCCESS = 0, diff --git a/tid/tidc.c b/tid/tidc.c index 764990f..de40102 100644 --- a/tid/tidc.c +++ b/tid/tidc.c @@ -147,7 +147,7 @@ int tidc_send_request (TIDC_INSTANCE *tidc, return -1; } - fprintf(stdout, "Response Received (%d bytes).\n", resp_buflen); + fprintf(stdout, "Response Received (%u bytes).\n", (unsigned) resp_buflen); fprintf(stdout, "%s\n", resp_buf); if (NULL == (resp_msg = tr_msg_decode(resp_buf, resp_buflen))) { diff --git a/tid/tids.c b/tid/tids.c index d3447cb..c7a125f 100644 --- a/tid/tids.c +++ b/tid/tids.c @@ -49,8 +49,11 @@ static int tids_listen (TIDS_INSTANCE *tids, int port) { int rc = 0; int conn = -1; - struct sockaddr_storage addr; - struct sockaddr_in *saddr = (struct sockaddr_in *) &addr; + union { + struct sockaddr_storage storage; + struct sockaddr_in in4; + } addr; + struct sockaddr_in *saddr = (struct sockaddr_in *) &addr.in4; saddr->sin_port = htons (port); saddr->sin_family = AF_INET; @@ -105,7 +108,7 @@ static int tids_read_request (TIDS_INSTANCE *tids, int conn, gss_ctx_id_t *gssct return -1; } - fprintf(stdout, "tids_read_request():Request Received, %d bytes.\n", buflen); + fprintf(stdout, "tids_read_request():Request Received, %u bytes.\n", (unsigned) buflen); /* Parse request */ if (NULL == ((*mreq) = tr_msg_decode(buf, buflen))) { -- 2.1.4