$NetBSD: patch-ab,v 1.3 2020/08/09 22:14:36 rillig Exp $ Add return values for functions. --- tclexpat.c.orig 1998-08-22 07:35:44.000000000 +0000 +++ tclexpat.c @@ -19,7 +19,8 @@ */ #include -#include "xmlparse.h" +#include +#include /* * The structure below is used to refer to an expat parser object. @@ -814,12 +815,12 @@ TclExpatElementStartHandler(userData, na */ expat->continueCount++; - return; + return NULL; } if (expat->elementstartcommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -847,18 +848,18 @@ TclExpatElementStartHandler(userData, na * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -894,13 +895,13 @@ TclExpatElementEndHandler(userData, name if (!--(expat->continueCount)) { expat->status = TCL_OK; - return; + return NULL; } } if (expat->elementendcommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -917,18 +918,18 @@ TclExpatElementEndHandler(userData, name * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -959,7 +960,7 @@ TclExpatCharacterDataHandler(userData, s if (expat->datacommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -976,18 +977,18 @@ TclExpatCharacterDataHandler(userData, s * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -1018,7 +1019,7 @@ TclExpatProcessingInstructionHandler(use if (expat->picommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -1036,18 +1037,18 @@ TclExpatProcessingInstructionHandler(use * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -1078,7 +1079,7 @@ TclExpatDefaultHandler(userData, s, len) if (expat->defaultcommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -1095,18 +1096,18 @@ TclExpatDefaultHandler(userData, s, len) * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -1140,7 +1141,7 @@ TclExpatUnparsedDeclHandler(userData, en if (expat->unparsedcommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -1169,18 +1170,18 @@ TclExpatUnparsedDeclHandler(userData, en * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -1213,7 +1214,7 @@ TclExpatNotationDeclHandler(userData, no if (expat->notationcommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -1241,18 +1242,18 @@ TclExpatNotationDeclHandler(userData, no * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /* @@ -1287,7 +1288,7 @@ TclExpatUnknownEncodingHandler(encodingH if (expat->unknownencodingcommand == NULL || expat->status != TCL_OK) { - return; + return 0; } /* @@ -1306,18 +1307,18 @@ TclExpatUnknownEncodingHandler(encodingH * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return 0; } /* @@ -1350,7 +1351,7 @@ TclExpatExternalEntityRefHandler(parser, if (expat->externalentitycommand == NULL || expat->status != TCL_OK) { - return; + return NULL; } /* @@ -1370,18 +1371,18 @@ TclExpatExternalEntityRefHandler(parser, * It would be desirable to be able to terminate parsing * if the return result is TCL_ERROR or TCL_BREAK. */ -#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) +#if (TCL_MAJOR_VERSION == 8) result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); #else result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif /* if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION */ +#endif /* if TCL_MAJOR_VERSION == 8 */ Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) expat->interp); TclExpatHandlerResult(expat, result); - return; + return NULL; } /*