From 175bd2894f5b0ea74f991c86250f1e16e3006b90 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 10 Apr 2012 00:08:53 +0200 Subject: [PATCH] Added -ansi flag to compilation, and fixed C++ comments to ANSI C comments --- miniupnpc/Changelog.txt | 5 ++++- miniupnpc/Makefile | 6 +++--- miniupnpc/miniupnpc.c | 2 +- miniupnpc/upnpc.c | 4 ++-- miniupnpc/upnpcommands.c | 8 ++++---- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/miniupnpc/Changelog.txt b/miniupnpc/Changelog.txt index 0981173..53e7a06 100644 --- a/miniupnpc/Changelog.txt +++ b/miniupnpc/Changelog.txt @@ -1,6 +1,9 @@ -$Id: Changelog.txt,v 1.163 2012/03/15 01:02:02 nanard Exp $ +$Id: Changelog.txt,v 1.166 2012/04/09 12:49:26 nanard Exp $ miniUPnP client Changelog. +2012/04/09: + Added -ansi flag to compilation, and fixed C++ comments to ANSI C comments. + 2012/04/05: minor improvements to minihttptestserver.c diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index 28b0b77..525bbc8 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.91 2012/03/05 19:42:46 nanard Exp $ +# $Id: Makefile,v 1.93 2012/04/09 12:49:26 nanard Exp $ # MiniUPnP Project # http://miniupnp.free.fr/ # (c) 2005-2011 Thomas Bernard @@ -20,8 +20,8 @@ endif CC ?= gcc #AR = gar -#CFLAGS = -O -Wall -g -DDEBUG -CFLAGS ?= -O -Wall -DNDEBUG -DMINIUPNPC_SET_SOCKET_TIMEOUT -Wstrict-prototypes -D_BSD_SOURCE +#CFLAGS = -O -Wall -g -DDEBUG -ansi -Wstrict-prototypes +CFLAGS ?= -O -Wall -DNDEBUG -DMINIUPNPC_SET_SOCKET_TIMEOUT -ansi -Wstrict-prototypes -D_BSD_SOURCE # -DNO_GETADDRINFO INSTALL = install SH = /bin/sh diff --git a/miniupnpc/miniupnpc.c b/miniupnpc/miniupnpc.c index 8afc9d4..4506fc6 100644 --- a/miniupnpc/miniupnpc.c +++ b/miniupnpc/miniupnpc.c @@ -586,7 +586,7 @@ upnpDiscover(int delay, const char * multicastif, } #else /* #ifdef NO_GETADDRINFO */ memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; // AF_INET6 or AF_INET + hints.ai_family = AF_UNSPEC; /* AF_INET6 or AF_INET */ hints.ai_socktype = SOCK_DGRAM; /*hints.ai_flags = */ if ((rv = getaddrinfo(ipv6 diff --git a/miniupnpc/upnpc.c b/miniupnpc/upnpc.c index 7e943ec..5feecd9 100644 --- a/miniupnpc/upnpc.c +++ b/miniupnpc/upnpc.c @@ -1,4 +1,4 @@ -/* $Id: upnpc.c,v 1.91 2012/01/21 13:30:33 nanard Exp $ */ +/* $Id: upnpc.c,v 1.93 2012/04/09 12:49:26 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard * Copyright (c) 2005-2012 Thomas Bernard @@ -321,7 +321,7 @@ static void SetPinholeAndTest(struct UPNPUrls * urls, struct IGDdatas * data, const char * proto, const char * lease_time) { char uniqueID[8]; - //int isWorking = 0; + /*int isWorking = 0;*/ int r; if(!intaddr || !remoteaddr || !iport || !eport || !proto || !lease_time) diff --git a/miniupnpc/upnpcommands.c b/miniupnpc/upnpcommands.c index 5ca0203..47745ff 100644 --- a/miniupnpc/upnpcommands.c +++ b/miniupnpc/upnpcommands.c @@ -1,4 +1,4 @@ -/* $Id: upnpcommands.c,v 1.37 2011/06/04 15:56:23 nanard Exp $ */ +/* $Id: upnpcommands.c,v 1.39 2012/04/09 12:49:27 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard * Copyright (c) 2005-2011 Thomas Bernard @@ -741,7 +741,7 @@ UPNP_GetListOfPortMappings(const char * controlURL, } ClearNameValueList(&pdata); - //printf("%.*s", bufsize, buffer); + /*printf("%.*s", bufsize, buffer);*/ return ret; } @@ -868,7 +868,7 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype, return UPNPCOMMAND_INVALID_ARGS; AddPinholeArgs = calloc(7, sizeof(struct UPNParg)); - // RemoteHost can be wilcarded + /* RemoteHost can be wilcarded */ if(strncmp(remoteHost, "empty", 5)==0) { AddPinholeArgs[0].elt = "RemoteHost"; @@ -912,7 +912,7 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype, resVal = GetValueFromNameValueList(&pdata, "errorCode"); if(resVal) { - //printf("AddPortMapping errorCode = '%s'\n", resVal); + /*printf("AddPortMapping errorCode = '%s'\n", resVal);*/ ret = UPNPCOMMAND_UNKNOWN_ERROR; sscanf(resVal, "%d", &ret); }