From: Guus Sliepen Date: Fri, 22 Mar 2002 13:31:18 +0000 (+0000) Subject: Fix compiler warnings, strictly use long int and %lx for options. X-Git-Tag: release-1.0pre6~27 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=3c5655f59e85d312d11fa04489123e604920f95b;p=tinc Fix compiler warnings, strictly use long int and %lx for options. --- diff --git a/src/connection.c b/src/connection.c index 8620e4af..391982a6 100644 --- a/src/connection.c +++ b/src/connection.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: connection.c,v 1.1.2.28 2002/02/18 16:25:16 guus Exp $ + $Id: connection.c,v 1.1.2.29 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -116,7 +116,7 @@ cp for(node = connection_tree->head; node; node = node->next) { c = (connection_t *)node->data; - syslog(LOG_DEBUG, _(" %s at %s options %ld socket %d status %04x"), + syslog(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x"), c->name, c->hostname, c->options, c->socket, c->status); } diff --git a/src/edge.c b/src/edge.c index f0337e1e..da1cdb45 100644 --- a/src/edge.c +++ b/src/edge.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: edge.c,v 1.1.2.8 2002/03/22 11:43:46 guus Exp $ + $Id: edge.c,v 1.1.2.9 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -201,7 +201,7 @@ cp from_udp = sockaddr2hostname(&e->from.udpaddress); // to_tcp = sockaddr2hostname(&e->to.tcpaddress); to_udp = sockaddr2hostname(&e->to.udpaddress); - syslog(LOG_DEBUG, _(" %s at %s - %s at %s options %ld weight %d"), + syslog(LOG_DEBUG, _(" %s at %s - %s at %s options %lx weight %d"), e->from.node->name, from_udp, e->to.node->name, to_udp, e->options, e->weight); diff --git a/src/node.c b/src/node.c index 6e3b0f9b..e4581cc5 100644 --- a/src/node.c +++ b/src/node.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: node.c,v 1.1.2.10 2002/02/18 16:25:16 guus Exp $ + $Id: node.c,v 1.1.2.11 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -163,7 +163,7 @@ cp for(node = node_tree->head; node; node = node->next) { n = (node_t *)node->data; - syslog(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %ld status %04x nexthop %s via %s"), + syslog(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s"), n->name, n->hostname, n->cipher?n->cipher->nid:0, n->digest?n->digest->type:0, n->maclength, n->compression, n->options, n->status, n->nexthop?n->nexthop->name:"-", n->via?n->via->name:"-"); } diff --git a/src/protocol.c b/src/protocol.c index 9125cf6e..9f8be7e0 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol.c,v 1.28.4.125 2002/03/22 11:43:48 guus Exp $ + $Id: protocol.c,v 1.28.4.126 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -74,7 +74,7 @@ cp if(len < 0 || len > MAXBUFSIZE-1) { - syslog(LOG_ERR, _("Output buffer overflow while sending request to %s (%s)"), request_name[request], c->name, c->hostname); + syslog(LOG_ERR, _("Output buffer overflow while sending request to %s (%s)"), c->name, c->hostname); return -1; } diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 92e076a8..cbe0958d 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_auth.c,v 1.1.4.4 2002/03/22 11:43:48 guus Exp $ + $Id: protocol_auth.c,v 1.1.4.5 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -473,7 +473,7 @@ cp gettimeofday(&now, NULL); c->estimated_weight = (now.tv_sec - c->start.tv_sec) * 1000 + (now.tv_usec - c->start.tv_usec) / 1000; sockaddr2str(&c->address, &address, &port); - x = send_request(c, "%d %s %s %s %d %d", ACK, myport, address, port, c->estimated_weight, c->options); + x = send_request(c, "%d %s %s %s %d %lx", ACK, myport, address, port, c->estimated_weight, c->options); free(address); free(port); cp @@ -519,12 +519,12 @@ int ack_h(connection_t *c) char hisport[MAX_STRING_SIZE]; char *hisaddress, *dummy; int weight; - int options; + long int options; node_t *n; connection_t *other; avl_node_t *node; cp - if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" %d %d", hisport, myaddress, &weight, &options) != 4) + if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" %d %lx", hisport, myaddress, &weight, &options) != 4) { syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ACK", c->name, c->hostname); return -1; diff --git a/src/protocol_edge.c b/src/protocol_edge.c index d6b55b01..7760eea9 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_edge.c,v 1.1.4.5 2002/03/22 12:41:54 guus Exp $ + $Id: protocol_edge.c,v 1.1.4.6 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -90,7 +90,7 @@ int add_edge_h(connection_t *c) int weight; avl_node_t *node; cp - if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d", + if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d", from_name, from_address, from_udpport, to_name, to_address, to_udpport, &options, &weight) != 8) @@ -226,7 +226,7 @@ int del_edge_h(connection_t *c) connection_t *other; avl_node_t *node; cp - if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING"", from_name, to_name) != 2) + if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING"", from_name, to_name) != 2) { syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_EDGE", c->name, c->hostname); diff --git a/src/protocol_key.c b/src/protocol_key.c index dc44b537..016fbff7 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_key.c,v 1.1.4.5 2002/03/21 23:11:53 guus Exp $ + $Id: protocol_key.c,v 1.1.4.6 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -75,7 +75,7 @@ int key_changed_h(connection_t *c) connection_t *other; node_t *n; cp - if(sscanf(c->buffer, "%*d %*lx "MAX_STRING, name) != 1) + if(sscanf(c->buffer, "%*d %*x "MAX_STRING, name) != 1) { syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED", c->name, c->hostname); diff --git a/src/protocol_subnet.c b/src/protocol_subnet.c index 3cea347b..7f6cfc17 100644 --- a/src/protocol_subnet.c +++ b/src/protocol_subnet.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_subnet.c,v 1.1.4.2 2002/03/21 23:11:53 guus Exp $ + $Id: protocol_subnet.c,v 1.1.4.3 2002/03/22 13:31:18 guus Exp $ */ #include "config.h" @@ -66,7 +66,7 @@ int add_subnet_h(connection_t *c) subnet_t *s; avl_node_t *node; cp - if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING, name, subnetstr) != 2) + if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, name, subnetstr) != 2) { syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_SUBNET", c->name, c->hostname); return -1; @@ -158,7 +158,7 @@ int del_subnet_h(connection_t *c) subnet_t *s, *find; avl_node_t *node; cp - if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING, name, subnetstr) != 2) + if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, name, subnetstr) != 2) { syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_SUBNET", c->name, c->hostname); return -1;