Bug fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@729 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
730afd5dff
commit
23068fcf8f
2 changed files with 16 additions and 10 deletions
|
|
@ -529,12 +529,23 @@ TCL8::create_function(char *name, char *iname, SwigType *d, ParmList *l) {
|
|||
void
|
||||
TCL8::link_variable(char *name, char *iname, SwigType *t) {
|
||||
|
||||
String *new_name = 0;
|
||||
int isarray = 0;
|
||||
|
||||
/* See if there were any typemaps */
|
||||
if (Swig_typemap_search((char *)"varin",t,name) || (Swig_typemap_search((char*)"varout",t,name))) {
|
||||
Printf(stderr,"%s : Line %d. Warning. varin/varout typemap methods not supported.",
|
||||
input_file, line_number);
|
||||
}
|
||||
|
||||
isarray = SwigType_isarray(t);
|
||||
if (isarray) {
|
||||
Printf(stderr,"%s:%d: Array variable '%s' will be read-only.\n", input_file, line_number, name);
|
||||
new_name = NewStringf("_swig_%s",name);
|
||||
Printf(f_wrappers,"static %s = (%s) %s;\n", SwigType_lstr(t,new_name), SwigType_lstr(t,0), name);
|
||||
name = Char(new_name);
|
||||
}
|
||||
|
||||
/* Dump a collection of set/get functions suitable for variable tracing */
|
||||
if (!Getattr(setget,SwigType_lstr(t,0))) {
|
||||
Setattr(setget,SwigType_lstr(t,0),"1");
|
||||
|
|
@ -673,7 +684,7 @@ TCL8::link_variable(char *name, char *iname, SwigType *t) {
|
|||
}
|
||||
Printv(var_info, tab4,"{ SWIG_prefix \"", iname, "\", (void *) &", name, ", _swig_", SwigType_manglestr(t), "_get,", 0);
|
||||
|
||||
if (Status & STAT_READONLY) {
|
||||
if ((Status & STAT_READONLY) || (isarray)) {
|
||||
static int readonly = 0;
|
||||
if (!readonly) {
|
||||
Wrapper *ro = NewWrapper();
|
||||
|
|
@ -687,6 +698,7 @@ TCL8::link_variable(char *name, char *iname, SwigType *t) {
|
|||
} else {
|
||||
Printv(var_info, "_swig_", SwigType_manglestr(t), "_set},\n",0);
|
||||
}
|
||||
Delete(new_name);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -842,7 +842,6 @@ statement : INCLUDE STRING LBRACE {
|
|||
| HBLOCK {
|
||||
if (!WrapExtern) {
|
||||
$1[strlen($1) - 1] = 0;
|
||||
// Printf(f_header,"#line %d \"%s\"\n", start_line, input_file);
|
||||
Printf(f_header, "%s\n", $1);
|
||||
}
|
||||
}
|
||||
|
|
@ -858,7 +857,6 @@ statement : INCLUDE STRING LBRACE {
|
|||
|
||||
| WRAPPER HBLOCK {
|
||||
if (!WrapExtern) {
|
||||
init_language();
|
||||
$2[strlen($2) - 1] = 0;
|
||||
Printf(f_wrappers,"%s\n",$2);
|
||||
}
|
||||
|
|
@ -875,7 +873,6 @@ statement : INCLUDE STRING LBRACE {
|
|||
|
||||
| INIT HBLOCK {
|
||||
if (!WrapExtern) {
|
||||
init_language();
|
||||
$2[strlen($2) -1] = 0;
|
||||
Printf(f_init,"%s\n", $2);
|
||||
}
|
||||
|
|
@ -952,12 +949,9 @@ statement : INCLUDE STRING LBRACE {
|
|||
/* Module directive */
|
||||
|
||||
| MODULE ID initlist {
|
||||
if ($3.count)
|
||||
lang->set_module($2);
|
||||
else
|
||||
lang->set_module($2);
|
||||
module_init = 1;
|
||||
init_language();
|
||||
lang->set_module($2);
|
||||
module_init = 1;
|
||||
init_language();
|
||||
for (i = 0; i < $3.count; i++)
|
||||
if ($3.names[i]) free($3.names[i]);
|
||||
free($3.names);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue