summaryrefslogtreecommitdiff
path: root/Lib/swiginit.swg
diff options
context:
space:
mode:
authorMarcelo Matus <mmatus@acms.arizona.edu>2006-01-20 18:59:06 +0000
committerMarcelo Matus <mmatus@acms.arizona.edu>2006-01-20 18:59:06 +0000
commita6e348b846d88024a9b868cafd02a2e05b80ec9c (patch)
treeee91b5702466ecb2c29abb37453084eb610cdb99 /Lib/swiginit.swg
parent24542ed0cd439e4e370442b0c5e7f8a0b776eb29 (diff)
downloadswig-a6e348b846d88024a9b868cafd02a2e05b80ec9c.tar.gz
avoid cast list elements, add more debug info, add Rubin's multi-module 'mod'example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8493 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/swiginit.swg')
-rw-r--r--Lib/swiginit.swg39
1 files changed, 30 insertions, 9 deletions
diff --git a/Lib/swiginit.swg b/Lib/swiginit.swg
index d109d2a26..a9cb7d117 100644
--- a/Lib/swiginit.swg
+++ b/Lib/swiginit.swg
@@ -123,17 +123,23 @@ SWIG_InitializeModule(void *clientdata) {
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
}
- if (ret && type == swig_module.type_initial[i]) {
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
- if (ret) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
- cast->type = ret;
- ret = 0;
- } else {
- /* Fix PyICU and many others */
- ret = 0;
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
}
-
+
if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
@@ -146,11 +152,26 @@ SWIG_InitializeModule(void *clientdata) {
}
cast++;
}
-
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
}
swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
}
/* This function will propagate the clientdata field of type to