Use DOH String instead of static char buffers.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9339 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2006-09-23 23:10:49 +00:00
commit 551738fe8c
5 changed files with 49 additions and 52 deletions

View file

@ -681,7 +681,7 @@ public:
ParmList *l = Getattr(n,"parms");
Parm *p;
String *proc_name = 0;
char source[256], target[256];
char source[256];
Wrapper *f = NewWrapper();;
String *cleanup = NewString("");
String *outarg = NewString("");
@ -769,7 +769,6 @@ public:
}
SwigType *pt = Getattr(p,"type");
String *ln = Getattr(p,"lname");
int opt_p = (i >= numreq);
// Produce names of source and target
@ -777,8 +776,8 @@ public:
sprintf(source, "argv[%d]", i);
else
sprintf(source,"s_%d",i);
sprintf(target,"%s", Char(ln));
String *target = Getattr(p,"lname");
if (!args_passed_as_array) {
if (i!=0) Printf(f->def,", ");
Printf(f->def,"SCM s_%d", i);

View file

@ -510,7 +510,7 @@ public:
Parm *p;
int i;
Wrapper *f;
char source[256],target[256],temp[256];
char source[256],temp[256];
String *tm;
String *cleanup, *outarg;
int num_saved = 0;
@ -567,11 +567,10 @@ public:
}
SwigType *pt = Getattr(p,"type");
String *ln = Getattr(p,"lname");
/* Produce string representation of source and target arguments */
sprintf(source,"ST(%d)",i);
sprintf(target,"%s", Char(ln));
String *target = Getattr(p,"lname");
if (i >= num_required) {
Printf(f->code," if (items > %d) {\n", i);

View file

@ -170,8 +170,8 @@ public:
/* If shadow classing is enabled, we're going to change the module name to "_module" */
if (itcl) {
char filen[256];
sprintf(filen,"%s%s.itcl", Swig_file_dirname(outfile), Char(module));
String *filen;
filen = NewStringf("%s%s.itcl", Swig_file_dirname(outfile), module);
Insert( module,0,"_" );
@ -190,8 +190,9 @@ public:
NIL);
Printv(f_shadow,"\npackage require Itcl\n\n", NIL);
};
Delete(filen);
}
/* Generate some macros used throughout code generation */
Printf(f_header,"#define SWIG_init %s\n", init_name);