~ubuntu-branches/ubuntu/quantal/swig2.0/quantal

« back to all changes in this revision

Viewing changes to Source/Modules/directors.cxx

  • Committer: Package Import Robot
  • Author(s): Stefano Rivera
  • Date: 2012-06-01 17:05:17 UTC
  • mfrom: (1.1.6) (10.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120601170517-q0ik32ij61i4r6f0
Tags: 2.0.7-2ubuntu1
* Merge from Debian unstable (LP: #1006387). Remaining changes:
  - Drop libchicken-dev from the build-depends (in universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
  }
291
291
}
292
292
 
 
293
/* ------------------------------------------------------------
 
294
 * Swig_director_parms_fixup()
 
295
 *
 
296
 * For each parameter in the C++ member function, copy the parameter name
 
297
 * to its "lname"; this ensures that Swig_typemap_attach_parms() will do
 
298
 * the right thing when it sees strings like "$1" in "directorin" typemaps.
 
299
 * ------------------------------------------------------------ */
 
300
 
 
301
void Swig_director_parms_fixup(ParmList *parms) {
 
302
  Parm *p;
 
303
  int i;
 
304
  for (i = 0, p = parms; p; p = nextSibling(p), ++i) {
 
305
    String *arg = Getattr(p, "name");
 
306
    String *lname = 0;
 
307
 
 
308
    if (!arg && !Equal(Getattr(p, "type"), "void")) {
 
309
      lname = NewStringf("arg%d", i);
 
310
      Setattr(p, "name", lname);
 
311
    } else
 
312
      lname = Copy(arg);
 
313
 
 
314
    Setattr(p, "lname", lname);
 
315
    Delete(lname);
 
316
  }
 
317
}
 
318