1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * This file is used to analyze overloaded functions and methods.
8 * It looks at signatures and tries to gather information for
9 * building a dispatch function.
10 * ----------------------------------------------------------------------------- */
12 char cvsroot_overload_cxx[] = "$Id: overload.cxx 11455 2009-07-26 21:29:55Z wsfulton $";
16 #define MAX_OVERLOAD 4096
18 /* Overload "argc" and "argv" */
19 String *argv_template_string;
20 String *argc_template_string;
24 int argc; /* Argument count */
25 ParmList *parms; /* Parameters used for overload check */
26 int error; /* Ambiguity error */
29 static int fast_dispatch_mode = 0;
30 static int cast_dispatch_mode = 0;
32 /* Set fast_dispatch_mode */
33 void Wrapper_fast_dispatch_mode_set(int flag) {
34 fast_dispatch_mode = flag;
37 void Wrapper_cast_dispatch_mode_set(int flag) {
38 cast_dispatch_mode = flag;
41 /* -----------------------------------------------------------------------------
42 * Swig_overload_rank()
44 * This function takes an overloaded declaration and creates a list that ranks
45 * all overloaded methods in an order that can be used to generate a dispatch
47 * Slight difference in the way this function is used by scripting languages and
48 * statically typed languages. The script languages call this method via
49 * Swig_overload_dispatch() - where wrappers for all overloaded methods are generated,
50 * however sometimes the code can never be executed. The non-scripting languages
51 * call this method via Swig_overload_check() for each overloaded method in order
52 * to determine whether or not the method should be wrapped. Note the slight
53 * difference when overloading methods that differ by const only. The
54 * scripting languages will ignore the const method, whereas the non-scripting
55 * languages ignore the first method parsed.
56 * ----------------------------------------------------------------------------- */
58 static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
59 Overloaded nodes[MAX_OVERLOAD];
61 Node *o = Getattr(n, "sym:overloaded");
69 if (Getattr(c, "error")) {
70 c = Getattr(c, "sym:nextSibling");
73 /* if (SmartPointer && Getattr(c,"cplus:staticbase")) {
74 c = Getattr(c,"sym:nextSibling");
78 /* Make a list of all the declarations (methods) that are overloaded with
79 * this one particular method name */
80 if (Getattr(c, "wrap:name")) {
81 assert(nnodes < MAX_OVERLOAD);
83 nodes[nnodes].parms = Getattr(c, "wrap:parms");
84 nodes[nnodes].argc = emit_num_required(nodes[nnodes].parms);
85 nodes[nnodes].error = 0;
88 c = Getattr(c, "sym:nextSibling");
91 /* Sort the declarations by required argument count */
94 for (i = 0; i < nnodes; i++) {
95 for (j = i + 1; j < nnodes; j++) {
96 if (nodes[i].argc > nodes[j].argc) {
97 Overloaded t = nodes[i];
105 /* Sort the declarations by argument types */
108 for (i = 0; i < nnodes - 1; i++) {
109 if (nodes[i].argc == nodes[i + 1].argc) {
110 for (j = i + 1; (j < nnodes) && (nodes[j].argc == nodes[i].argc); j++) {
111 Parm *p1 = nodes[i].parms;
112 Parm *p2 = nodes[j].parms;
115 while (p1 && p2 && (num_checked < nodes[i].argc)) {
116 // Printf(stdout,"p1 = '%s', p2 = '%s'\n", Getattr(p1,"type"), Getattr(p2,"type"));
117 if (checkAttribute(p1, "tmap:in:numinputs", "0")) {
118 p1 = Getattr(p1, "tmap:in:next");
121 if (checkAttribute(p2, "tmap:in:numinputs", "0")) {
122 p2 = Getattr(p2, "tmap:in:next");
125 String *t1 = Getattr(p1, "tmap:typecheck:precedence");
126 String *t2 = Getattr(p2, "tmap:typecheck:precedence");
127 if ((!t1) && (!nodes[i].error)) {
128 Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n),
129 "Overloaded method %s not supported (no type checking rule for '%s').\n",
130 Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0));
132 } else if ((!t2) && (!nodes[j].error)) {
133 Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n),
134 "Overloaded method %s not supported (no type checking rule for '%s').\n",
135 Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0));
140 t1v = atoi(Char(t1));
141 t2v = atoi(Char(t2));
143 } else if (!t1 && t2)
151 Overloaded t = nodes[i];
155 } else if ((differ == 0) && (Strcmp(t1, "0") == 0)) {
156 t1 = Getattr(p1, "ltype");
158 t1 = SwigType_ltype(Getattr(p1, "type"));
159 if (Getattr(p1, "tmap:typecheck:SWIGTYPE")) {
160 SwigType_add_pointer(t1);
162 Setattr(p1, "ltype", t1);
164 t2 = Getattr(p2, "ltype");
166 t2 = SwigType_ltype(Getattr(p2, "type"));
167 if (Getattr(p2, "tmap:typecheck:SWIGTYPE")) {
168 SwigType_add_pointer(t2);
170 Setattr(p2, "ltype", t2);
173 /* Need subtype check here. If t2 is a subtype of t1, then we need to change the
176 if (SwigType_issubtype(t2, t1)) {
177 Overloaded t = nodes[i];
182 if (Strcmp(t1, t2) != 0) {
189 if (Getattr(p1, "tmap:in:next")) {
190 p1 = Getattr(p1, "tmap:in:next");
192 p1 = nextSibling(p1);
194 if (Getattr(p2, "tmap:in:next")) {
195 p2 = Getattr(p2, "tmap:in:next");
197 p2 = nextSibling(p2);
201 /* See if declarations differ by const only */
202 String *d1 = Getattr(nodes[i].n, "decl");
203 String *d2 = Getattr(nodes[j].n, "decl");
205 String *dq1 = Copy(d1);
206 String *dq2 = Copy(d2);
207 if (SwigType_isconst(d1)) {
208 Delete(SwigType_pop(dq1));
210 if (SwigType_isconst(d2)) {
211 Delete(SwigType_pop(dq2));
213 if (Strcmp(dq1, dq2) == 0) {
215 if (SwigType_isconst(d1) && !SwigType_isconst(d2)) {
216 if (script_lang_wrapping) {
217 // Swap nodes so that the const method gets ignored (shadowed by the non-const method)
218 Overloaded t = nodes[i];
223 if (!nodes[j].error) {
224 if (script_lang_wrapping) {
225 Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
226 "Overloaded method %s ignored. Non-const method %s at %s:%d used.\n",
227 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n), Getfile(nodes[i].n), Getline(nodes[i].n));
229 if (!Getattr(nodes[j].n, "overload:ignore"))
230 Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
231 "Overloaded method %s ignored. Method %s at %s:%d used.\n",
232 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n), Getfile(nodes[i].n), Getline(nodes[i].n));
236 } else if (!SwigType_isconst(d1) && SwigType_isconst(d2)) {
238 if (!nodes[j].error) {
239 if (script_lang_wrapping) {
240 Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
241 "Overloaded method %s ignored. Non-const method %s at %s:%d used.\n",
242 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n), Getfile(nodes[i].n), Getline(nodes[i].n));
244 if (!Getattr(nodes[j].n, "overload:ignore"))
245 Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
246 "Overloaded method %s ignored. Method %s at %s:%d used.\n",
247 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n), Getfile(nodes[i].n), Getline(nodes[i].n));
258 if (!nodes[j].error) {
259 if (script_lang_wrapping) {
260 Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
261 "Overloaded method %s is shadowed by %s at %s:%d.\n",
262 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n),
263 Getfile(nodes[i].n), Getline(nodes[i].n));
265 if (!Getattr(nodes[j].n, "overload:ignore"))
266 Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
267 "Overloaded method %s ignored. Method %s at %s:%d used.\n",
268 Swig_name_decl(nodes[j].n), Swig_name_decl(nodes[i].n),
269 Getfile(nodes[i].n), Getline(nodes[i].n));
278 List *result = NewList();
281 for (i = 0; i < nnodes; i++) {
283 Setattr(nodes[i].n, "overload:ignore", "1");
284 Append(result, nodes[i].n);
285 // Printf(stdout,"[ %d ] %s\n", i, ParmList_errorstr(nodes[i].parms));
286 // Swig_print_node(nodes[i].n);
292 // /* -----------------------------------------------------------------------------
293 // * print_typecheck()
294 // * ----------------------------------------------------------------------------- */
296 static bool print_typecheck(String *f, int j, Parm *pj) {
298 sprintf(tmp, Char(argv_template_string), j);
299 String *tm = Getattr(pj, "tmap:typecheck");
301 Replaceid(tm, Getattr(pj, "lname"), "_v");
302 String *conv = Getattr(pj, "implicitconv");
304 Replaceall(tm, "$implicitconv", conv);
306 Replaceall(tm, "$implicitconv", "0");
308 Replaceall(tm, "$input", tmp);
309 Printv(f, tm, "\n", NIL);
315 /* -----------------------------------------------------------------------------
317 * ----------------------------------------------------------------------------- */
319 static String *ReplaceFormat(const_String_or_char_ptr fmt, int j) {
320 String *lfmt = NewString(fmt);
322 sprintf(buf, "%d", j);
323 Replaceall(lfmt, "$numargs", buf);
325 String *commaargs = NewString("");
326 for (i = 0; i < j; i++) {
327 Printv(commaargs, ", ", NIL);
328 Printf(commaargs, Char(argv_template_string), i);
330 Replaceall(lfmt, "$commaargs", commaargs);
334 /* -----------------------------------------------------------------------------
335 * Swig_overload_dispatch()
337 * Generate a dispatch function. argc is assumed to hold the argument count.
338 * argv is the argument vector.
340 * Note that for C++ class member functions, Swig_overload_dispatch() assumes
341 * that argc includes the "self" argument and that the first element of argv[]
342 * is the "self" argument. So for a member function:
344 * Foo::bar(int x, int y, int z);
346 * the argc should be 4 (not 3!) and the first element of argv[] would be
347 * the appropriate scripting language reference to "self". For regular
348 * functions (and static class functions) the argc and argv only include
349 * the regular function arguments.
350 * ----------------------------------------------------------------------------- */
353 Cast dispatch mechanism.
355 String *Swig_overload_dispatch_cast(Node *n, const_String_or_char_ptr fmt, int *maxargs) {
360 String *f = NewString("");
361 String *sw = NewString("");
363 Printf(f, "unsigned long _index = 0;\n");
364 Printf(f, "SWIG_TypeRank _rank = 0; \n");
366 /* Get a list of methods ranked by precedence values and argument count */
367 List *dispatch = Swig_overload_rank(n, true);
368 int nfunc = Len(dispatch);
370 /* Loop over the functions */
373 for (i = 0; i < nfunc; i++) {
375 Node *ni = Getitem(dispatch, i);
376 Parm *pi = Getattr(ni, "wrap:parms");
377 int num_required = emit_num_required(pi);
378 int num_arguments = emit_num_arguments(pi);
379 if (num_arguments > *maxargs)
380 *maxargs = num_arguments;
381 int varargs = emit_isvarargs(pi);
384 if (num_required == num_arguments) {
385 Printf(f, "if (%s == %d) {\n", argc_template_string, num_required);
387 Printf(f, "if ((%s >= %d) && (%s <= %d)) {\n", argc_template_string, num_required, argc_template_string, num_arguments);
390 Printf(f, "if (%s >= %d) {\n", argc_template_string, num_required);
392 Printf(f, "SWIG_TypeRank _ranki = 0;\n");
393 Printf(f, "SWIG_TypeRank _rankm = 0;\n");
395 Printf(f, "SWIG_TypeRank _pi = 1;\n");
397 /* create a list with the wrappers that collide with the
398 current one based on argument number */
399 List *coll = NewList();
400 for (int k = i + 1; k < nfunc; k++) {
401 Node *nk = Getitem(dispatch, k);
402 Parm *pk = Getattr(nk, "wrap:parms");
403 int nrk = emit_num_required(pk);
404 int nak = emit_num_arguments(pk);
405 if ((nrk >= num_required && nrk <= num_arguments) || (nak >= num_required && nak <= num_arguments) || (nrk <= num_required && nak >= num_arguments))
409 // printf("overload: %s coll=%d\n", Char(Getattr(n, "sym:name")), Len(coll));
412 bool test = (num_arguments > 0);
418 if (checkAttribute(pj, "tmap:in:numinputs", "0")) {
419 pj = Getattr(pj, "tmap:in:next");
423 String *tm = Getattr(pj, "tmap:typecheck");
425 /* normalise for comparison later */
426 Replaceid(tm, Getattr(pj, "lname"), "_v");
428 /* if all the wrappers have the same type check on this
429 argument we can optimize it out */
430 for (int k = 0; k < Len(coll) && !emitcheck; k++) {
431 Node *nk = Getitem(coll, k);
432 Parm *pk = Getattr(nk, "wrap:parms");
433 int nak = emit_num_arguments(pk);
438 /* finds arg j on the collider wrapper */
439 while (pl && l <= j) {
440 if (checkAttribute(pl, "tmap:in:numinputs", "0")) {
441 pl = Getattr(pl, "tmap:in:next");
445 /* we are at arg j, so we compare the tmaps now */
446 String *tml = Getattr(pl, "tmap:typecheck");
447 /* normalise it before comparing */
449 Replaceid(tml, Getattr(pl, "lname"), "_v");
450 if (!tml || Cmp(tm, tml))
452 //printf("tmap: %s[%d] (%d) => %s\n\n",
453 // Char(Getattr(nk, "sym:name")),
454 // l, emitcheck, tml?Char(tml):0);
456 Parm *pl1 = Getattr(pl, "tmap:in:next");
460 pl = nextSibling(pl);
467 Printf(f, "int _v = 0;\n");
470 if (j >= num_required) {
471 Printf(f, "if (%s > %d) {\n", argc_template_string, j);
474 String *tmp = NewStringf(argv_template_string, j);
476 String *conv = Getattr(pj, "implicitconv");
478 Replaceall(tm, "$implicitconv", conv);
480 Replaceall(tm, "$implicitconv", "0");
482 Replaceall(tm, "$input", tmp);
483 Printv(f, "{\n", tm, "}\n", NIL);
485 Printf(f, "if (!_v) goto check_%d;\n", fn);
486 Printf(f, "_ranki += _v*_pi;\n");
487 Printf(f, "_rankm += _pi;\n");
488 Printf(f, "_pi *= SWIG_MAXCASTRANK;\n");
491 if (!Getattr(pj, "tmap:in:SWIGTYPE") && Getattr(pj, "tmap:typecheck:SWIGTYPE")) {
492 /* we emit a warning if the argument defines the 'in' typemap, but not the 'typecheck' one */
493 Swig_warning(WARN_TYPEMAP_TYPECHECK_UNDEF, Getfile(ni), Getline(ni),
494 "Overloaded method %s with no explicit typecheck typemap for arg %d of type '%s'\n",
495 Swig_name_decl(n), j, SwigType_str(Getattr(pj, "type"), 0));
497 Parm *pj1 = Getattr(pj, "tmap:in:next");
501 pj = nextSibling(pj);
507 for ( /* empty */ ; num_braces > 0; num_braces--)
510 Printf(f, "if (!_index || (_ranki < _rank)) {\n");
511 Printf(f, " _rank = _ranki; _index = %d;\n", i + 1);
512 Printf(f, " if (_rank == _rankm) goto dispatch;\n");
514 String *lfmt = ReplaceFormat(fmt, num_arguments);
515 Printf(sw, "case %d:\n", i + 1);
516 Printf(sw, Char(lfmt), Getattr(ni, "wrap:name"));
519 Printf(f, "}\n"); /* braces closes "if" for this method */
521 Printf(f, "check_%d:\n\n", fn);
527 Printf(f, "dispatch:\n");
528 Printf(f, "switch(_index) {\n");
537 Fast dispatch mechanism, provided by Salvador Fandi~no Garc'ia (#930586).
539 String *Swig_overload_dispatch_fast(Node *n, const_String_or_char_ptr fmt, int *maxargs) {
544 String *f = NewString("");
546 /* Get a list of methods ranked by precedence values and argument count */
547 List *dispatch = Swig_overload_rank(n, true);
548 int nfunc = Len(dispatch);
550 /* Loop over the functions */
552 for (i = 0; i < nfunc; i++) {
554 Node *ni = Getitem(dispatch, i);
555 Parm *pi = Getattr(ni, "wrap:parms");
556 int num_required = emit_num_required(pi);
557 int num_arguments = emit_num_arguments(pi);
558 if (num_arguments > *maxargs)
559 *maxargs = num_arguments;
560 int varargs = emit_isvarargs(pi);
563 if (num_required == num_arguments) {
564 Printf(f, "if (%s == %d) {\n", argc_template_string, num_required);
566 Printf(f, "if ((%s >= %d) && (%s <= %d)) {\n", argc_template_string, num_required, argc_template_string, num_arguments);
569 Printf(f, "if (%s >= %d) {\n", argc_template_string, num_required);
572 /* create a list with the wrappers that collide with the
573 current one based on argument number */
574 List *coll = NewList();
575 for (int k = i + 1; k < nfunc; k++) {
576 Node *nk = Getitem(dispatch, k);
577 Parm *pk = Getattr(nk, "wrap:parms");
578 int nrk = emit_num_required(pk);
579 int nak = emit_num_arguments(pk);
580 if ((nrk >= num_required && nrk <= num_arguments) || (nak >= num_required && nak <= num_arguments) || (nrk <= num_required && nak >= num_arguments))
584 // printf("overload: %s coll=%d\n", Char(Getattr(n, "sym:name")), Len(coll));
587 bool test = (Len(coll) > 0 && num_arguments);
593 if (checkAttribute(pj, "tmap:in:numinputs", "0")) {
594 pj = Getattr(pj, "tmap:in:next");
598 String *tm = Getattr(pj, "tmap:typecheck");
600 /* normalise for comparison later */
601 Replaceid(tm, Getattr(pj, "lname"), "_v");
603 /* if all the wrappers have the same type check on this
604 argument we can optimize it out */
606 for (int k = 0; k < Len(coll) && !emitcheck; k++) {
607 Node *nk = Getitem(coll, k);
608 Parm *pk = Getattr(nk, "wrap:parms");
609 int nak = emit_num_arguments(pk);
614 /* finds arg j on the collider wrapper */
615 while (pl && l <= j) {
616 if (checkAttribute(pl, "tmap:in:numinputs", "0")) {
617 pl = Getattr(pl, "tmap:in:next");
621 /* we are at arg j, so we compare the tmaps now */
622 String *tml = Getattr(pl, "tmap:typecheck");
623 /* normalise it before comparing */
625 Replaceid(tml, Getattr(pl, "lname"), "_v");
626 if (!tml || Cmp(tm, tml))
628 //printf("tmap: %s[%d] (%d) => %s\n\n",
629 // Char(Getattr(nk, "sym:name")),
630 // l, emitcheck, tml?Char(tml):0);
632 Parm *pl1 = Getattr(pl, "tmap:in:next");
636 pl = nextSibling(pl);
643 Printf(f, "int _v = 0;\n");
646 if (j >= num_required) {
647 Printf(f, "if (%s > %d) {\n", argc_template_string, j);
650 String *tmp = NewStringf(argv_template_string, j);
652 String *conv = Getattr(pj, "implicitconv");
654 Replaceall(tm, "$implicitconv", conv);
656 Replaceall(tm, "$implicitconv", "0");
658 Replaceall(tm, "$input", tmp);
659 Printv(f, "{\n", tm, "}\n", NIL);
661 Printf(f, "if (!_v) goto check_%d;\n", fn);
664 if (!Getattr(pj, "tmap:in:SWIGTYPE") && Getattr(pj, "tmap:typecheck:SWIGTYPE")) {
665 /* we emit a warning if the argument defines the 'in' typemap, but not the 'typecheck' one */
666 Swig_warning(WARN_TYPEMAP_TYPECHECK_UNDEF, Getfile(ni), Getline(ni),
667 "Overloaded method %s with no explicit typecheck typemap for arg %d of type '%s'\n",
668 Swig_name_decl(n), j, SwigType_str(Getattr(pj, "type"), 0));
670 Parm *pj1 = Getattr(pj, "tmap:in:next");
674 pj = nextSibling(pj);
680 for ( /* empty */ ; num_braces > 0; num_braces--)
684 String *lfmt = ReplaceFormat(fmt, num_arguments);
685 Printf(f, Char(lfmt), Getattr(ni, "wrap:name"));
687 Printf(f, "}\n"); /* braces closes "if" for this method */
689 Printf(f, "check_%d:\n\n", fn);
698 String *Swig_overload_dispatch(Node *n, const_String_or_char_ptr fmt, int *maxargs) {
700 if (fast_dispatch_mode || GetFlag(n, "feature:fastdispatch")) {
701 return Swig_overload_dispatch_fast(n, fmt, maxargs);
708 String *f = NewString("");
710 /* Get a list of methods ranked by precedence values and argument count */
711 List *dispatch = Swig_overload_rank(n, true);
712 int nfunc = Len(dispatch);
714 /* Loop over the functions */
716 for (i = 0; i < nfunc; i++) {
717 Node *ni = Getitem(dispatch, i);
718 Parm *pi = Getattr(ni, "wrap:parms");
719 int num_required = emit_num_required(pi);
720 int num_arguments = emit_num_arguments(pi);
721 if (GetFlag(n, "wrap:this")) {
725 if (num_arguments > *maxargs)
726 *maxargs = num_arguments;
727 int varargs = emit_isvarargs(pi);
730 if (num_required == num_arguments) {
731 Printf(f, "if (%s == %d) {\n", argc_template_string, num_required);
733 Printf(f, "if ((%s >= %d) && (%s <= %d)) {\n", argc_template_string, num_required, argc_template_string, num_arguments);
736 Printf(f, "if (%s >= %d) {\n", argc_template_string, num_required);
740 Printf(f, "int _v;\n");
747 if (checkAttribute(pj, "tmap:in:numinputs", "0")) {
748 pj = Getattr(pj, "tmap:in:next");
751 if (j >= num_required) {
752 String *lfmt = ReplaceFormat(fmt, num_arguments);
753 Printf(f, "if (%s <= %d) {\n", argc_template_string, j);
754 Printf(f, Char(lfmt), Getattr(ni, "wrap:name"));
758 if (print_typecheck(f, (GetFlag(n, "wrap:this") ? j + 1 : j), pj)) {
759 Printf(f, "if (_v) {\n");
762 if (!Getattr(pj, "tmap:in:SWIGTYPE") && Getattr(pj, "tmap:typecheck:SWIGTYPE")) {
763 /* we emit a warning if the argument defines the 'in' typemap, but not the 'typecheck' one */
764 Swig_warning(WARN_TYPEMAP_TYPECHECK_UNDEF, Getfile(ni), Getline(ni),
765 "Overloaded method %s with no explicit typecheck typemap for arg %d of type '%s'\n",
766 Swig_name_decl(n), j, SwigType_str(Getattr(pj, "type"), 0));
768 Parm *pk = Getattr(pj, "tmap:in:next");
772 pj = nextSibling(pj);
775 String *lfmt = ReplaceFormat(fmt, num_arguments);
776 Printf(f, Char(lfmt), Getattr(ni, "wrap:name"));
779 for ( /* empty */ ; num_braces > 0; num_braces--)
781 Printf(f, "}\n"); /* braces closes "if" for this method */
787 /* -----------------------------------------------------------------------------
788 * Swig_overload_check()
789 * ----------------------------------------------------------------------------- */
790 void Swig_overload_check(Node *n) {
791 Swig_overload_rank(n, false);