avoid swig_types of length 0, and allow to iterate over the array, for Lua mainly

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7435 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-09-12 23:25:03 +00:00
commit d61a776308
2 changed files with 2 additions and 1 deletions

View file

@ -114,6 +114,7 @@ SWIG_InitializeModule(void *clientdata) {
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
}
swig_module.types[i] = 0;
}
/* This function will propagate the clientdata field of type to

View file

@ -1929,7 +1929,7 @@ SwigType_emit_type_table(File *f_forward, File *f_table) {
Printf(f_table,"%s\n", cast_init);
Printf(f_table,"\n/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */\n\n");
Printf(f_forward,"static swig_type_info *swig_types[%d];\n", i);
Printf(f_forward,"static swig_type_info *swig_types[%d];\n", i + 1);
Printf(f_forward,"static swig_module_info swig_module = {swig_types, %d, 0, 0, 0, 0};\n", i);
Printf(f_forward,"#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)\n");
Printf(f_forward,"#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)\n");