fix unused 'fail:' label warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8716 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
27acb50747
commit
403e9ebc9e
6 changed files with 55 additions and 22 deletions
|
|
@ -574,6 +574,7 @@ public:
|
|||
if (!addSymbol(iname,n)) return SWIG_ERROR;
|
||||
|
||||
/* Create a function for getting a variable */
|
||||
int addfail = 0;
|
||||
getf = NewWrapper();
|
||||
getname = Swig_name_get(iname);
|
||||
Printv(getf->def,"SWIGINTERN char *",getname,"(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, char *name1, char *name2, int flags) {",NIL);
|
||||
|
|
@ -583,14 +584,16 @@ public:
|
|||
Replaceall(tm,"$target","value");
|
||||
Replaceall(tm,"$result", "value");
|
||||
/* Printf(getf->code, "%s\n",tm); */
|
||||
emit_action_code(n, getf, tm);
|
||||
addfail = emit_action_code(n, getf, tm);
|
||||
Printf(getf->code, "if (value) {\n");
|
||||
Printf(getf->code, "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n");
|
||||
Printf(getf->code, "Tcl_DecrRefCount(value);\n");
|
||||
Printf(getf->code, "}\n");
|
||||
Printf(getf->code, "return NULL;\n");
|
||||
Append(getf->code,"fail:\n");
|
||||
Printf(getf->code,"return \"%s\";\n", iname);
|
||||
if (addfail) {
|
||||
Append(getf->code,"fail:\n");
|
||||
Printf(getf->code,"return \"%s\";\n", iname);
|
||||
}
|
||||
Printf(getf->code,"}\n");
|
||||
Wrapper_print(getf,f_wrappers);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue