[Tcl] Fix variable declarations in middle of blocks which isn't

permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663).
Reported by Paul Obermeier in SF#3288586.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2011-06-18 04:24:19 +00:00
commit 88d540683e
3 changed files with 9 additions and 4 deletions

View file

@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.5 (in progress)
===========================
2011-06-18: olly
[Tcl] Fix variable declarations in middle of blocks which isn't
permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663).
Reported by Paul Obermeier in SF#3288586.
2011-06-17: wsfulton
[Java] SF #3312505 - slightly easier to wrap char[] or char[ANY] with a Java byte[]
using arrays_java.i.

View file

@ -77,13 +77,12 @@ SWIG_Tcl_InstallMethodLookupTables(void) {
swig_type_info *type = swig_module.type_initial[i];
if (type->clientdata) {
swig_class* klass = (swig_class*) type->clientdata;
swig_method* meth;
Tcl_InitHashTable(&(klass->hashtable), TCL_STRING_KEYS);
swig_method* meth = klass->methods;
while (meth && meth->name) {
for (meth = klass->methods; meth && meth->name; ++meth) {
int newEntry;
Tcl_HashEntry* hashentry = Tcl_CreateHashEntry(&(klass->hashtable), meth->name, &newEntry);
Tcl_SetHashValue(hashentry, (ClientData)meth->method);
++meth;
}
}
}

View file

@ -340,6 +340,7 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_
cls_stack_bi[cls_stack_top] = -1;
cls = inst->classptr;
while (1) {
Tcl_HashEntry* hashentry;
bi = cls_stack_bi[cls_stack_top];
cls = cls_stack[cls_stack_top];
if (bi != -1) {
@ -364,7 +365,7 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_
}
cls_stack_bi[cls_stack_top]++;
Tcl_HashEntry* hashentry = Tcl_FindHashEntry(&(cls->hashtable), method);
hashentry = Tcl_FindHashEntry(&(cls->hashtable), method);
if (hashentry) {
ClientData cd = Tcl_GetHashValue(hashentry);
swig_wrapper method_wrapper = (swig_wrapper)cd;