Eliminate unused Printf args

This commit is contained in:
Olly Betts 2021-04-12 15:54:36 +12:00 • committed by Olly Betts
commit 0bf846f56f
5 changed files with 10 additions and 9 deletions

View file

@ -2341,7 +2341,6 @@ done:
virtual int constructorHandler(Node *n) {
if (Swig_directorclass(n)) {
String *name = GetChar(Swig_methodclass(n), "name");
String *ctype = GetChar(Swig_methodclass(n), "classtype");
String *sname = GetChar(Swig_methodclass(n), "sym:name");
String *args = NewStringEmpty();
@ -2369,7 +2368,7 @@ done:
Printf(director_ctor_code, "if (Z_TYPE_P(arg0) == IS_NULL) { /* not subclassed */\n");
Printf(director_prot_ctor_code, "if (Z_TYPE_P(arg0) == IS_NULL) { /* not subclassed */\n");
Printf(director_ctor_code, " %s = (%s *)new %s(%s);\n", Swig_cresult_name(), ctype, ctype, args);
Printf(director_prot_ctor_code, " SWIG_PHP_Error(E_ERROR, \"accessing abstract class or protected constructor\");\n", name, name, args);
Printf(director_prot_ctor_code, " SWIG_PHP_Error(E_ERROR, \"accessing abstract class or protected constructor\");\n");
if (i) {
Insert(args, 0, ", ");
}
@ -2717,7 +2716,7 @@ done:
// typemap_directorout testcase requires that 0 can be assigned to the
// variable named after the result of Swig_cresult_name(), so that can't
// be a zval - make it a pointer to one instead.
Printf(w->code, "zval swig_zval_result, swig_funcname;\n", Swig_cresult_name());
Printf(w->code, "zval swig_zval_result, swig_funcname;\n");
Printf(w->code, "zval * SWIGUNUSED %s = &swig_zval_result;\n", Swig_cresult_name());
const char * funcname = GetChar(n, "sym:name");
Printf(w->code, "ZVAL_STRINGL(&swig_funcname, \"%s\", %d);\n", funcname, strlen(funcname));