miniupnpd: fix warnings when compiling with IGD_V2 disabled

fixes #617

./upnpdescgen.c:946:1: warning: unused label 'unstack' [-Wunused-label]
unstack:
^~~~~~~~
./upnpdescgen.c:891:12: warning: unused parameter 'force_igd1' [-Wunused-parameter]
       int force_igd1)
           ^
./upnpdescgen.c:1035:61: warning: unused parameter 'force_igd1' [-Wunused-parameter]
genServiceDesc(int * len, const struct serviceDesc * s, int force_igd1)
                                                            ^
3 warnings generated.
This commit is contained in:
Thomas Bernard 2022-10-15 13:09:36 +02:00
parent df04310d39
commit 3a2b15af4c
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 10 additions and 0 deletions

View File

@ -900,6 +900,10 @@ genXML(char * str, int * len, int * tmplen,
unsigned short j; unsigned short j;
const char * eltname; const char * eltname;
} pile[GENXML_STACK_SIZE]; /* stack */ } pile[GENXML_STACK_SIZE]; /* stack */
#if !defined(IGD_V2)
UNUSED(force_igd1);
#endif
top = -1; top = -1;
i = 0; /* current node */ i = 0; /* current node */
j = 1; /* i + number of nodes*/ j = 1; /* i + number of nodes*/
@ -943,7 +947,9 @@ genXML(char * str, int * len, int * tmplen,
str = strcat_str(str, len, tmplen, eltname); str = strcat_str(str, len, tmplen, eltname);
str = strcat_char(str, len, tmplen, '>'); str = strcat_char(str, len, tmplen, '>');
} }
#ifdef IGD_V2
unstack: unstack:
#endif
for(;;) for(;;)
{ {
if(top < 0) if(top < 0)
@ -1040,6 +1046,10 @@ genServiceDesc(int * len, const struct serviceDesc * s, int force_igd1)
const struct argument * args; const struct argument * args;
char * str; char * str;
int tmplen; int tmplen;
#if !defined(IGD_V2)
UNUSED(force_igd1);
#endif
tmplen = 2048; tmplen = 2048;
str = (char *)malloc(tmplen); str = (char *)malloc(tmplen);
if(str == NULL) if(str == NULL)