Merge branch 'david-loffredo-portable-unused-param-fix' (#313)

This commit is contained in:
Sebastian Pipping 2019-08-17 18:20:49 +02:00
commit 80d2829fa8
11 changed files with 706 additions and 375 deletions

View file

@ -31,7 +31,7 @@ Release x.x.x xxx xxx xx xxxx
by using official API function rand_s (needs WinXP+)
#14 Drop an OpenVMS support leftover
#235 #268 ..
#270 #310 Address compiler warnings
#270 #310 #313 Address compiler warnings
#282 #283 ..
#284 #285 Address cppcheck warnings
#294 #295 Address Clang Static Analyzer warnings

View file

@ -102,11 +102,7 @@
#endif
#ifndef UNUSED_P
# if defined(__GNUC__) && (__GNUC__ >= 4)
# define UNUSED_P(p) UNUSED_##p __attribute__((__unused__))
# else
# define UNUSED_P(p) UNUSED_##p
# endif
# define UNUSED_P(p) (void)p
#endif
#ifdef __cplusplus

View file

@ -5257,8 +5257,11 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
}
static enum XML_Error PTRCALL
errorProcessor(XML_Parser parser, const char *UNUSED_P(s),
const char *UNUSED_P(end), const char **UNUSED_P(nextPtr)) {
errorProcessor(XML_Parser parser, const char *s, const char *end,
const char **nextPtr) {
UNUSED_P(s);
UNUSED_P(end);
UNUSED_P(nextPtr);
return parser->m_errorCode;
}

View file

@ -195,8 +195,11 @@ prolog1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
prolog2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
prolog2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@ -212,8 +215,11 @@ prolog2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
doctype0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
doctype0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@ -252,8 +258,11 @@ doctype1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
doctype2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
doctype2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@ -265,8 +274,11 @@ doctype2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
doctype3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
doctype3(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@ -278,8 +290,11 @@ doctype3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
doctype4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
doctype4(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@ -294,8 +309,11 @@ doctype4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
doctype5(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
doctype5(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@ -389,8 +407,11 @@ externalSubset1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
#endif /* XML_DTD */
static int PTRCALL
entity0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -405,8 +426,11 @@ entity0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
entity1(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -442,8 +466,11 @@ entity2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
entity3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity3(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -455,8 +482,11 @@ entity3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
entity4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity4(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -487,8 +517,11 @@ entity5(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
entity6(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity6(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -525,8 +558,11 @@ entity7(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
entity8(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity8(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -538,8 +574,11 @@ entity8(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
entity9(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity9(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -551,8 +590,11 @@ entity9(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
entity10(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
entity10(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@ -564,8 +606,11 @@ entity10(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
notation0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
notation0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@ -597,8 +642,11 @@ notation1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
notation2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
notation2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@ -610,8 +658,11 @@ notation2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
notation3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
notation3(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@ -624,8 +675,11 @@ notation3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
notation4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
notation4(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@ -641,8 +695,11 @@ notation4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -655,8 +712,11 @@ attlist0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist1(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -702,8 +762,11 @@ attlist2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
attlist3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist3(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -717,8 +780,11 @@ attlist3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist4(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -733,8 +799,11 @@ attlist4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist5(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist5(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -746,8 +815,11 @@ attlist5(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist6(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist6(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -759,8 +831,11 @@ attlist6(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
attlist7(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist7(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -806,8 +881,11 @@ attlist8(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
attlist9(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
attlist9(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@ -819,8 +897,11 @@ attlist9(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
element0(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -893,8 +974,11 @@ element2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
element3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element3(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -914,8 +998,11 @@ element3(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
element4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element4(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -928,8 +1015,11 @@ element4(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
element5(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element5(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -945,8 +1035,11 @@ element5(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
element6(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element6(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -971,8 +1064,11 @@ element6(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
element7(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
element7(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@ -1037,8 +1133,11 @@ condSect0(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
}
static int PTRCALL
condSect1(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
condSect1(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@ -1051,8 +1150,11 @@ condSect1(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
}
static int PTRCALL
condSect2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
condSect2(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@ -1066,8 +1168,11 @@ condSect2(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
#endif /* XML_DTD */
static int PTRCALL
declClose(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
const char *UNUSED_P(end), const ENCODING *UNUSED_P(enc)) {
declClose(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
switch (tok) {
case XML_TOK_PROLOG_S:
return state->role_none;
@ -1099,9 +1204,13 @@ declClose(PROLOG_STATE *state, int tok, const char *UNUSED_P(ptr),
* LCOV_EXCL_START
*/
static int PTRCALL
error(PROLOG_STATE *UNUSED_P(state), int UNUSED_P(tok),
const char *UNUSED_P(ptr), const char *UNUSED_P(end),
const ENCODING *UNUSED_P(enc)) {
error(PROLOG_STATE *state, int tok, const char *ptr, const char *end,
const ENCODING *enc) {
UNUSED_P(state);
UNUSED_P(tok);
UNUSED_P(ptr);
UNUSED_P(end);
UNUSED_P(enc);
return XML_ROLE_NONE;
}
/* LCOV_EXCL_STOP */

View file

@ -131,46 +131,55 @@
|| ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0)))
static int PTRFASTCALL
isNever(const ENCODING *UNUSED_P(enc), const char *UNUSED_P(p)) {
isNever(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
UNUSED_P(p);
return 0;
}
static int PTRFASTCALL
utf8_isName2(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isName2(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isName3(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isName3(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
}
#define utf8_isName4 isNever
static int PTRFASTCALL
utf8_isNmstrt2(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isNmstrt2(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isNmstrt3(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isNmstrt3(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
}
#define utf8_isNmstrt4 isNever
static int PTRFASTCALL
utf8_isInvalid2(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isInvalid2(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_INVALID2((const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isInvalid3(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isInvalid3(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_INVALID3((const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isInvalid4(const ENCODING *UNUSED_P(enc), const char *p) {
utf8_isInvalid4(const ENCODING *enc, const char *p) {
UNUSED_P(enc);
return UTF8_INVALID4((const unsigned char *)p);
}
@ -346,14 +355,15 @@ _INTERNAL_trim_to_complete_utf8_characters(const char *from,
}
static enum XML_Convert_Result PTRCALL
utf8_toUtf8(const ENCODING *UNUSED_P(enc), const char **fromP,
const char *fromLim, char **toP, const char *toLim) {
utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim,
char **toP, const char *toLim) {
bool input_incomplete = false;
bool output_exhausted = false;
/* Avoid copying partial characters (due to limited space). */
const ptrdiff_t bytesAvailable = fromLim - *fromP;
const ptrdiff_t bytesStorable = toLim - *toP;
UNUSED_P(enc);
if (bytesAvailable > bytesStorable) {
fromLim = *fromP + bytesStorable;
output_exhausted = true;
@ -482,8 +492,9 @@ static const struct normal_encoding internal_utf8_encoding
STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)};
static enum XML_Convert_Result PTRCALL
latin1_toUtf8(const ENCODING *UNUSED_P(enc), const char **fromP,
const char *fromLim, char **toP, const char *toLim) {
latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim,
char **toP, const char *toLim) {
UNUSED_P(enc);
for (;;) {
unsigned char c;
if (*fromP == fromLim)
@ -504,9 +515,9 @@ latin1_toUtf8(const ENCODING *UNUSED_P(enc), const char **fromP,
}
static enum XML_Convert_Result PTRCALL
latin1_toUtf16(const ENCODING *UNUSED_P(enc), const char **fromP,
const char *fromLim, unsigned short **toP,
const unsigned short *toLim) {
latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
unsigned short **toP, const unsigned short *toLim) {
UNUSED_P(enc);
while (*fromP < fromLim && *toP < toLim)
*(*toP)++ = (unsigned char)*(*fromP)++;
@ -539,8 +550,9 @@ static const struct normal_encoding latin1_encoding
STANDARD_VTABLE(sb_) NULL_VTABLE};
static enum XML_Convert_Result PTRCALL
ascii_toUtf8(const ENCODING *UNUSED_P(enc), const char **fromP,
const char *fromLim, char **toP, const char *toLim) {
ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim,
char **toP, const char *toLim) {
UNUSED_P(enc);
while (*fromP < fromLim && *toP < toLim)
*(*toP)++ = *(*fromP)++;
@ -598,9 +610,10 @@ unicode_byte_type(char hi, char lo) {
#define DEFINE_UTF16_TO_UTF8(E) \
static enum XML_Convert_Result PTRCALL E##toUtf8( \
const ENCODING *UNUSED_P(enc), const char **fromP, const char *fromLim, \
const ENCODING *enc, const char **fromP, const char *fromLim, \
char **toP, const char *toLim) { \
const char *from = *fromP; \
UNUSED_P(enc); \
fromLim = from + (((fromLim - from) >> 1) << 1); /* shrink to even */ \
for (; from < fromLim; from += 2) { \
int plane; \
@ -674,9 +687,10 @@ unicode_byte_type(char hi, char lo) {
#define DEFINE_UTF16_TO_UTF16(E) \
static enum XML_Convert_Result PTRCALL E##toUtf16( \
const ENCODING *UNUSED_P(enc), const char **fromP, const char *fromLim, \
const ENCODING *enc, const char **fromP, const char *fromLim, \
unsigned short **toP, const unsigned short *toLim) { \
enum XML_Convert_Result res = XML_CONVERT_COMPLETED; \
UNUSED_P(enc); \
fromLim = *fromP + (((fromLim - *fromP) >> 1) << 1); /* shrink to even */ \
/* Avoid copying first half only of surrogate */ \
if (fromLim - *fromP > ((toLim - *toP) << 1) \
@ -999,8 +1013,9 @@ streqci(const char *s1, const char *s2) {
}
static void PTRCALL
initUpdatePosition(const ENCODING *UNUSED_P(enc), const char *ptr,
const char *end, POSITION *pos) {
initUpdatePosition(const ENCODING *enc, const char *ptr, const char *end,
POSITION *pos) {
UNUSED_P(enc);
normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
}

View file

@ -218,9 +218,10 @@ PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
}
static int PTRCALL
PREFIX(checkPiTarget)(const ENCODING *UNUSED_P(enc), const char *ptr,
const char *end, int *tokPtr) {
PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end,
int *tokPtr) {
int upper = 0;
UNUSED_P(enc);
*tokPtr = XML_TOK_PI;
if (end - ptr != MINBPC(enc) * 3)
return 1;
@ -322,11 +323,12 @@ PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
}
static int PTRCALL
PREFIX(scanCdataSection)(const ENCODING *UNUSED_P(enc), const char *ptr,
const char *end, const char **nextTokPtr) {
PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr) {
static const char CDATA_LSQB[]
= {ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, ASCII_LSQB};
int i;
UNUSED_P(enc);
/* CDATA[ */
REQUIRE_CHARS(enc, ptr, end, 6);
for (i = 0; i < 6; i++, ptr += MINBPC(enc)) {
@ -1583,9 +1585,10 @@ PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
}
static int PTRFASTCALL
PREFIX(charRefNumber)(const ENCODING *UNUSED_P(enc), const char *ptr) {
PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) {
int result = 0;
/* skip &# */
UNUSED_P(enc);
ptr += 2 * MINBPC(enc);
if (CHAR_MATCHES(enc, ptr, ASCII_x)) {
for (ptr += MINBPC(enc); ! CHAR_MATCHES(enc, ptr, ASCII_SEMI);
@ -1640,8 +1643,9 @@ PREFIX(charRefNumber)(const ENCODING *UNUSED_P(enc), const char *ptr) {
}
static int PTRCALL
PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr,
PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr,
const char *end) {
UNUSED_P(enc);
switch ((end - ptr) / MINBPC(enc)) {
case 2:
if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) {
@ -1693,8 +1697,9 @@ PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr,
}
static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
const char *end1, const char *ptr2) {
UNUSED_P(enc);
for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
if (end1 - ptr1 < MINBPC(enc)) {
/* This line cannot be executed. The incoming data has already

View file

@ -197,12 +197,14 @@ srunner_run_all(SRunner *runner, int verbosity) {
}
void
_fail_unless(int UNUSED_P(condition), const char *UNUSED_P(file),
int UNUSED_P(line), const char *msg) {
_fail_unless(int condition, const char *file, int line, const char *msg) {
/* Always print the error message so it isn't lost. In this case,
we have a failure, so there's no reason to be quiet about what
it is.
*/
UNUSED_P(condition);
UNUSED_P(file);
UNUSED_P(line);
if (msg != NULL) {
const int has_newline = (msg[strlen(msg) - 1] == '\n');
fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n");

File diff suppressed because it is too large Load diff

View file

@ -83,12 +83,16 @@ codepageConvert(int cp, const char *p) {
#else /* not _WIN32 */
int
codepageMap(int UNUSED_P(cp), int *UNUSED_P(map)) {
codepageMap(int cp, int *map) {
UNUSED_P(cp);
UNUSED_P(map);
return 0;
}
int
codepageConvert(int UNUSED_P(cp), const char *UNUSED_P(p)) {
codepageConvert(int cp, const char *p) {
UNUSED_P(cp);
UNUSED_P(p);
return -1;
}

View file

@ -144,13 +144,14 @@ resolveSystemId(const XML_Char *base, const XML_Char *systemId,
static int
externalEntityRefFilemap(XML_Parser parser, const XML_Char *context,
const XML_Char *base, const XML_Char *systemId,
const XML_Char *UNUSED_P(publicId)) {
const XML_Char *publicId) {
int result;
XML_Char *s;
const XML_Char *filename;
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
int filemapRes;
PROCESS_ARGS args;
UNUSED_P(publicId);
args.retPtr = &result;
args.parser = entParser;
filename = resolveSystemId(base, systemId, &s);
@ -221,11 +222,12 @@ processStream(const XML_Char *filename, XML_Parser parser) {
static int
externalEntityRefStream(XML_Parser parser, const XML_Char *context,
const XML_Char *base, const XML_Char *systemId,
const XML_Char *UNUSED_P(publicId)) {
const XML_Char *publicId) {
XML_Char *s;
const XML_Char *filename;
int ret;
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
UNUSED_P(publicId);
filename = resolveSystemId(base, systemId, &s);
XML_SetBase(entParser, filename);
ret = processStream(filename, entParser);

View file

@ -298,10 +298,12 @@ xcsdup(const XML_Char *s) {
static void XMLCALL
startDoctypeDecl(void *userData, const XML_Char *doctypeName,
const XML_Char *UNUSED_P(sysid),
const XML_Char *UNUSED_P(publid),
int UNUSED_P(has_internal_subset)) {
const XML_Char *sysid, const XML_Char *publid,
int has_internal_subset) {
XmlwfUserData *data = (XmlwfUserData *)userData;
UNUSED_P(sysid);
UNUSED_P(publid);
UNUSED_P(has_internal_subset);
data->currentDoctypeName = xcsdup(doctypeName);
}
@ -413,13 +415,13 @@ endDoctypeDecl(void *userData) {
}
static void XMLCALL
notationDecl(void *userData, const XML_Char *notationName,
const XML_Char *UNUSED_P(base), const XML_Char *systemId,
const XML_Char *publicId) {
notationDecl(void *userData, const XML_Char *notationName, const XML_Char *base,
const XML_Char *systemId, const XML_Char *publicId) {
XmlwfUserData *data = (XmlwfUserData *)userData;
NotationList *entry = malloc(sizeof(NotationList));
const char *errorMessage = "Unable to store NOTATION for output\n";
UNUSED_P(base);
if (entry == NULL) {
fputs(errorMessage, stderr);
return; /* Nothing we can really do about this */
@ -461,46 +463,60 @@ notationDecl(void *userData, const XML_Char *notationName,
#endif /* not W3C14N */
static void XMLCALL
defaultCharacterData(void *userData, const XML_Char *UNUSED_P(s),
int UNUSED_P(len)) {
defaultCharacterData(void *userData, const XML_Char *s, int len) {
UNUSED_P(s);
UNUSED_P(len);
XML_DefaultCurrent((XML_Parser)userData);
}
static void XMLCALL
defaultStartElement(void *userData, const XML_Char *UNUSED_P(name),
const XML_Char **UNUSED_P(atts)) {
defaultStartElement(void *userData, const XML_Char *name,
const XML_Char **atts) {
UNUSED_P(name);
UNUSED_P(atts);
XML_DefaultCurrent((XML_Parser)userData);
}
static void XMLCALL
defaultEndElement(void *userData, const XML_Char *UNUSED_P(name)) {
defaultEndElement(void *userData, const XML_Char *name) {
UNUSED_P(name);
XML_DefaultCurrent((XML_Parser)userData);
}
static void XMLCALL
defaultProcessingInstruction(void *userData, const XML_Char *UNUSED_P(target),
const XML_Char *UNUSED_P(data)) {
defaultProcessingInstruction(void *userData, const XML_Char *target,
const XML_Char *data) {
UNUSED_P(target);
UNUSED_P(data);
XML_DefaultCurrent((XML_Parser)userData);
}
static void XMLCALL
nopCharacterData(void *UNUSED_P(userData), const XML_Char *UNUSED_P(s),
int UNUSED_P(len)) {
nopCharacterData(void *userData, const XML_Char *s, int len) {
UNUSED_P(userData);
UNUSED_P(s);
UNUSED_P(len);
}
static void XMLCALL
nopStartElement(void *UNUSED_P(userData), const XML_Char *UNUSED_P(name),
const XML_Char **UNUSED_P(atts)) {
nopStartElement(void *userData, const XML_Char *name, const XML_Char **atts) {
UNUSED_P(userData);
UNUSED_P(name);
UNUSED_P(atts);
}
static void XMLCALL
nopEndElement(void *UNUSED_P(userData), const XML_Char *UNUSED_P(name)) {
nopEndElement(void *userData, const XML_Char *name) {
UNUSED_P(userData);
UNUSED_P(name);
}
static void XMLCALL
nopProcessingInstruction(void *UNUSED_P(userData),
const XML_Char *UNUSED_P(target),
const XML_Char *UNUSED_P(data)) {
nopProcessingInstruction(void *userData, const XML_Char *target,
const XML_Char *data) {
UNUSED_P(userData);
UNUSED_P(target);
UNUSED_P(data);
}
static void XMLCALL
@ -639,12 +655,14 @@ metaCharacterData(void *userData, const XML_Char *s, int len) {
static void XMLCALL
metaStartDoctypeDecl(void *userData, const XML_Char *doctypeName,
const XML_Char *UNUSED_P(sysid),
const XML_Char *UNUSED_P(pubid),
int UNUSED_P(has_internal_subset)) {
const XML_Char *sysid, const XML_Char *pubid,
int has_internal_subset) {
XML_Parser parser = (XML_Parser)userData;
XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
FILE *fp = data->fp;
UNUSED_P(sysid);
UNUSED_P(pubid);
UNUSED_P(has_internal_subset);
ftprintf(fp, T("<startdoctype name=\"%s\""), doctypeName);
metaLocation(parser);
fputts(T("/>\n"), fp);
@ -662,11 +680,12 @@ metaEndDoctypeDecl(void *userData) {
static void XMLCALL
metaNotationDecl(void *userData, const XML_Char *notationName,
const XML_Char *UNUSED_P(base), const XML_Char *systemId,
const XML_Char *base, const XML_Char *systemId,
const XML_Char *publicId) {
XML_Parser parser = (XML_Parser)userData;
XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
FILE *fp = data->fp;
UNUSED_P(base);
ftprintf(fp, T("<notation name=\"%s\""), notationName);
if (publicId)
ftprintf(fp, T(" public=\"%s\""), publicId);
@ -680,14 +699,16 @@ metaNotationDecl(void *userData, const XML_Char *notationName,
}
static void XMLCALL
metaEntityDecl(void *userData, const XML_Char *entityName,
int UNUSED_P(is_param), const XML_Char *value, int value_length,
const XML_Char *UNUSED_P(base), const XML_Char *systemId,
const XML_Char *publicId, const XML_Char *notationName) {
metaEntityDecl(void *userData, const XML_Char *entityName, int is_param,
const XML_Char *value, int value_length, const XML_Char *base,
const XML_Char *systemId, const XML_Char *publicId,
const XML_Char *notationName) {
XML_Parser parser = (XML_Parser)userData;
XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
FILE *fp = data->fp;
UNUSED_P(is_param);
UNUSED_P(base);
if (value) {
ftprintf(fp, T("<entity name=\"%s\""), entityName);
metaLocation(parser);
@ -750,13 +771,13 @@ unknownEncodingConvert(void *data, const char *p) {
}
static int XMLCALL
unknownEncoding(void *UNUSED_P(userData), const XML_Char *name,
XML_Encoding *info) {
unknownEncoding(void *userData, const XML_Char *name, XML_Encoding *info) {
int cp;
static const XML_Char prefixL[] = T("windows-");
static const XML_Char prefixU[] = T("WINDOWS-");
int i;
UNUSED_P(userData);
for (i = 0; prefixU[i]; i++)
if (name[i] != prefixU[i] && name[i] != prefixL[i])
return 0;
@ -786,7 +807,8 @@ unknownEncoding(void *UNUSED_P(userData), const XML_Char *name,
}
static int XMLCALL
notStandalone(void *UNUSED_P(userData)) {
notStandalone(void *userData) {
UNUSED_P(userData);
return 0;
}