Merge branch 'master' into doxygen

Merge 3.0.12 release changes from master.
This commit is contained in:
Vadim Zeitlin 2017-02-01 02:21:35 +01:00
commit 294ab27b90
254 changed files with 4158 additions and 2457 deletions

View file

@ -197,15 +197,17 @@ class Allocate:public Dispatcher {
// Found a polymorphic method.
// Mark the polymorphic method, in case the virtual keyword was not used.
Setattr(n, "storage", "virtual");
if (both_have_public_access || both_have_protected_access) {
if (!is_non_public_base(inclass, b))
Setattr(n, "override", base); // Note C# definition of override, ie access must be the same
} else if (!both_have_private_access) {
// Different access
if (this_wrapping_protected_members || base_wrapping_protected_members)
if (!Getattr(b, "feature:interface")) { // interface implementation neither hides nor overrides
if (both_have_public_access || both_have_protected_access) {
if (!is_non_public_base(inclass, b))
Setattr(n, "hides", base); // Note C# definition of hiding, ie hidden if access is different
Setattr(n, "override", base); // Note C# definition of override, ie access must be the same
}
else if (!both_have_private_access) {
// Different access
if (this_wrapping_protected_members || base_wrapping_protected_members)
if (!is_non_public_base(inclass, b))
Setattr(n, "hides", base); // Note C# definition of hiding, ie hidden if access is different
}
}
// Try and find the most base's covariant return type
SwigType *most_base_covariant_type = Getattr(base, "covariant");

View file

@ -683,7 +683,7 @@ public:
String *filen = NewStringf("%s%s.cs", dir, name);
File *f = NewFile(filen, "w", SWIG_output_files());
if (!f) {
FileErrorDisplay(f);
FileErrorDisplay(filen);
SWIG_exit(EXIT_FAILURE);
}
Append(filenames_list, Copy(filen));
@ -1584,11 +1584,23 @@ public:
* ----------------------------------------------------------------------------- */
virtual int insertDirective(Node *n) {
int ret = SWIG_OK;
String *code = Getattr(n, "code");
String *section = Getattr(n, "section");
Replaceall(code, "$module", module_class_name);
Replaceall(code, "$imclassname", imclass_name);
Replaceall(code, "$dllimport", dllimport);
return Language::insertDirective(n);
if (!ImportMode && (Cmp(section, "proxycode") == 0)) {
if (proxy_class_code) {
Swig_typemap_replace_embedded_typemap(code, n);
int offset = Len(code) > 0 && *Char(code) == '\n' ? 1 : 0;
Printv(proxy_class_code, Char(code) + offset, "\n", NIL);
}
} else {
ret = Language::insertDirective(n);
}
return ret;
}
/* -----------------------------------------------------------------------------
@ -2044,34 +2056,6 @@ public:
}
}
/* ----------------------------------------------------------------------
* calculateDirectBase()
* ---------------------------------------------------------------------- */
void calculateDirectBase(Node* n) {
Node* direct_base = 0;
// C++ inheritance
Node *attributes = NewHash();
SwigType *typemap_lookup_type = Getattr(n, "classtypeobj");
const String *pure_baseclass = typemapLookup(n, "csbase", typemap_lookup_type, WARN_NONE, attributes);
bool purebase_replace = GetFlag(attributes, "tmap:csbase:replace") ? true : false;
bool purebase_notderived = GetFlag(attributes, "tmap:csbase:notderived") ? true : false;
Delete(attributes);
if (!purebase_replace) {
if (List *baselist = Getattr(n, "bases")) {
Iterator base = First(baselist);
while (base.item && (GetFlag(base.item, "feature:ignore") || Getattr(base.item, "feature:interface")))
base = Next(base);
direct_base = base.item;
}
if (!direct_base && purebase_notderived)
direct_base = symbolLookup(const_cast<String*>(pure_baseclass));
} else {
direct_base = symbolLookup(const_cast<String*>(pure_baseclass));
}
Setattr(n, "direct_base", direct_base);
}
/* ----------------------------------------------------------------------
* classHandler()
* ---------------------------------------------------------------------- */
@ -2157,7 +2141,6 @@ public:
emitInterfaceDeclaration(n, interface_name, interface_class_code);
Delete(output_directory);
}
calculateDirectBase(n);
}
Language::classHandler(n);
@ -2426,21 +2409,8 @@ public:
Printf(function_code, " %s ", methodmods);
if (!is_smart_pointer()) {
// Smart pointer classes do not mirror the inheritance hierarchy of the underlying pointer type, so no virtual/override/new required.
if (Node *base_ovr = Getattr(n, "override")) {
if (GetFlag(n, "isextendmember"))
if (Getattr(n, "override"))
Printf(function_code, "override ");
else {
Node* base = parentNode(base_ovr);
bool ovr = false;
for (Node* direct_base = Getattr(parentNode(n), "direct_base"); direct_base; direct_base = Getattr(direct_base, "direct_base")) {
if (direct_base == base) { // "override" only applies if the base was not discarded (e.g. in case of multiple inheritance or via "ignore")
ovr = true;
break;
}
}
Printf(function_code, ovr ? "override " : "virtual ");
}
}
else if (checkAttribute(n, "storage", "virtual"))
Printf(function_code, "virtual ");
if (Getattr(n, "hides"))
@ -3917,8 +3887,12 @@ public:
}
Printf(callback_def, " private %s SwigDirector%s(", tm, overloaded_name);
if (!ignored_method)
Printf(director_delegate_definitions, " public delegate %s", tm);
if (!ignored_method) {
const String *csdirectordelegatemodifiers = Getattr(n, "feature:csdirectordelegatemodifiers");
String *modifiers = (csdirectordelegatemodifiers ? NewStringf("%s%s", csdirectordelegatemodifiers, Len(csdirectordelegatemodifiers) > 0 ? " " : "") : NewStringf("public "));
Printf(director_delegate_definitions, " %sdelegate %s", modifiers, tm);
Delete(modifiers);
}
} else {
Swig_warning(WARN_CSHARP_TYPEMAP_CSTYPE_UNDEF, input_file, line_number, "No imtype typemap defined for %s\n", SwigType_str(returntype, 0));
}

View file

@ -717,9 +717,20 @@ public:
* D::insertDirective()
* --------------------------------------------------------------------------- */
virtual int insertDirective(Node *n) {
int ret = SWIG_OK;
String *code = Getattr(n, "code");
String *section = Getattr(n, "section");
replaceModuleVariables(code);
return Language::insertDirective(n);
if (!ImportMode && (Cmp(section, "proxycode") == 0)) {
if (proxy_class_body_code) {
Swig_typemap_replace_embedded_typemap(code, n);
Printv(proxy_class_body_code, code, NIL);
}
} else {
ret = Language::insertDirective(n);
}
return ret;
}
/* ---------------------------------------------------------------------------

View file

@ -1708,10 +1708,22 @@ public:
* ----------------------------------------------------------------------------- */
virtual int insertDirective(Node *n) {
int ret = SWIG_OK;
String *code = Getattr(n, "code");
String *section = Getattr(n, "section");
Replaceall(code, "$module", module_class_name);
Replaceall(code, "$imclassname", imclass_name);
return Language::insertDirective(n);
if (!ImportMode && (Cmp(section, "proxycode") == 0)) {
if (proxy_class_code) {
Swig_typemap_replace_embedded_typemap(code, n);
int offset = Len(code) > 0 && *Char(code) == '\n' ? 1 : 0;
Printv(proxy_class_code, Char(code) + offset, "\n", NIL);
}
} else {
ret = Language::insertDirective(n);
}
return ret;
}
/* -----------------------------------------------------------------------------
@ -4522,7 +4534,7 @@ public:
for (p = l; p;) {
if ((tm = Getattr(p, "tmap:directorargout"))) {
addThrows(n, "tmap:directorargout", p);
Replaceall(tm, "$result", "jresult");
Replaceall(tm, "$result", makeParameterName(n, p, i, false));
Replaceall(tm, "$input", Getattr(p, "emit:directorinput"));
Printv(w->code, tm, "\n", NIL);
p = Getattr(p, "tmap:directorargout:next");

View file

@ -1148,7 +1148,9 @@ int Language::globalfunctionHandler(Node *n) {
Delete(cbname);
}
Setattr(n, "parms", nonvoid_parms(parms));
String *call = Swig_cfunction_call(name, parms);
String *extendname = Getattr(n, "extendname");
String *call = Swig_cfunction_call(extendname ? extendname : name, parms);
String *cres = Swig_cresult(type, Swig_cresult_name(), call);
Setattr(n, "wrap:action", cres);
Delete(cres);
@ -1270,8 +1272,9 @@ int Language::memberfunctionHandler(Node *n) {
if (GetFlag(n, "explicitcall"))
DirectorExtraCall = CWRAP_DIRECTOR_ONE_CALL;
Swig_MethodToFunction(n, NSpace, ClassType, Getattr(n, "template") ? SmartPointer : Extend | SmartPointer | DirectorExtraCall, director_type,
is_member_director(CurrentClass, n));
int extendmember = GetFlag(n, "isextendmember") ? Extend : 0;
int flags = Getattr(n, "template") ? extendmember | SmartPointer : Extend | SmartPointer | DirectorExtraCall;
Swig_MethodToFunction(n, NSpace, ClassType, flags, director_type, is_member_director(CurrentClass, n));
Setattr(n, "sym:name", fname);
functionWrapper(n);
@ -1324,7 +1327,10 @@ int Language::staticmemberfunctionHandler(Node *n) {
if (!defaultargs && code) {
/* Hmmm. An added static member. We have to create a little wrapper for this */
Swig_add_extension_code(n, cname, parms, type, code, CPlusPlus, 0);
String *mangled_cname = Swig_name_mangle(cname);
Swig_add_extension_code(n, mangled_cname, parms, type, code, CPlusPlus, 0);
Setattr(n, "extendname", mangled_cname);
Delete(mangled_cname);
}
}
@ -2788,7 +2794,9 @@ int Language::constructorHandler(Node *n) {
Setattr(n, "handled_as_constructor", "1");
}
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend, DirectorClassName);
int extendmember = GetFlag(n, "isextendmember") ? Extend : 0;
int flags = Getattr(n, "template") ? extendmember : Extend;
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, flags, DirectorClassName);
Setattr(n, "sym:name", mrename);
functionWrapper(n);
Delete(mrename);

View file

@ -262,14 +262,14 @@ public:
f_runtime = NewStringEmpty();
/* sections of the output file */
s_init = NewString("/* init section */\n");
r_init = NewString("/* rinit section */\n");
s_shutdown = NewString("/* shutdown section */\n");
r_shutdown = NewString("/* rshutdown section */\n");
s_init = NewStringEmpty();
r_init = NewStringEmpty();
s_shutdown = NewStringEmpty();
r_shutdown = NewStringEmpty();
s_header = NewString("/* header section */\n");
s_wrappers = NewString("/* wrapper section */\n");
/* subsections of the init section */
s_vinit = NewString("/* vinit subsection */\n");
s_vinit = NewStringEmpty();
s_vdecl = NewString("/* vdecl subsection */\n");
s_cinit = NewString("/* cinit subsection */\n");
s_oinit = NewString("/* oinit subsection */\n");
@ -362,7 +362,7 @@ public:
/* Initialize the rest of the module */
Printf(s_oinit, "ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, %s_destroy_globals);\n", module, module, module);
Printf(s_oinit, "ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, NULL);\n", module, module);
/* start the header section */
Printf(s_header, "ZEND_BEGIN_MODULE_GLOBALS(%s)\n", module);
@ -370,13 +370,8 @@ public:
Printf(s_header, "int error_code;\n");
Printf(s_header, "ZEND_END_MODULE_GLOBALS(%s)\n", module);
Printf(s_header, "ZEND_DECLARE_MODULE_GLOBALS(%s)\n", module);
Printf(s_header, "#ifdef ZTS\n");
Printf(s_header, "#define SWIG_ErrorMsg() TSRMG(%s_globals_id, zend_%s_globals *, error_msg )\n", module, module);
Printf(s_header, "#define SWIG_ErrorCode() TSRMG(%s_globals_id, zend_%s_globals *, error_code )\n", module, module);
Printf(s_header, "#else\n");
Printf(s_header, "#define SWIG_ErrorMsg() (%s_globals.error_msg)\n", module);
Printf(s_header, "#define SWIG_ErrorCode() (%s_globals.error_code)\n", module);
Printf(s_header, "#endif\n\n");
/* The following can't go in Lib/php/phprun.swg as it uses SWIG_ErrorMsg(), etc
* which has to be dynamically generated as it depends on the module name.
@ -397,9 +392,6 @@ public:
Printf(s_header, " globals->error_code = default_error_code;\n");
Printf(s_header, "}\n");
Printf(s_header, "static void %s_destroy_globals(zend_%s_globals * globals) { (void)globals; }\n", module, module);
Printf(s_header, "\n");
Printf(s_header, "static void SWIG_ResetError(void) {\n");
Printf(s_header, " SWIG_ErrorMsg() = default_error_msg;\n");
Printf(s_header, " SWIG_ErrorCode() = default_error_code;\n");
@ -474,14 +466,6 @@ public:
Printf(f_h, "#else\n");
Printf(f_h, "# define PHP_%s_API\n", cap_module);
Printf(f_h, "#endif\n\n");
Printf(f_h, "#ifdef ZTS\n");
Printf(f_h, "#include \"TSRM.h\"\n");
Printf(f_h, "#endif\n\n");
Printf(f_h, "PHP_MINIT_FUNCTION(%s);\n", module);
Printf(f_h, "PHP_MSHUTDOWN_FUNCTION(%s);\n", module);
Printf(f_h, "PHP_RINIT_FUNCTION(%s);\n", module);
Printf(f_h, "PHP_RSHUTDOWN_FUNCTION(%s);\n", module);
Printf(f_h, "PHP_MINFO_FUNCTION(%s);\n\n", module);
/* start the arginfo section */
s_arginfo = NewString("/* arginfo subsection */\n");
@ -497,45 +481,66 @@ public:
Printf(s_entry, "/* Every non-class user visible function must have an entry here */\n");
Printf(s_entry, "static zend_function_entry %s_functions[] = {\n", module);
/* start the init section */
Append(s_init, "#if ZEND_MODULE_API_NO <= 20090626\n");
Append(s_init, "#undef ZEND_MODULE_BUILD_ID\n");
Append(s_init, "#define ZEND_MODULE_BUILD_ID (char*)\"API\" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA\n");
Append(s_init, "#endif\n");
Printv(s_init, "zend_module_entry ", module, "_module_entry = {\n", NIL);
Printf(s_init, " STANDARD_MODULE_HEADER,\n");
Printf(s_init, " \"%s\",\n", module);
Printf(s_init, " %s_functions,\n", module);
Printf(s_init, " PHP_MINIT(%s),\n", module);
Printf(s_init, " PHP_MSHUTDOWN(%s),\n", module);
Printf(s_init, " PHP_RINIT(%s),\n", module);
Printf(s_init, " PHP_RSHUTDOWN(%s),\n", module);
Printf(s_init, " PHP_MINFO(%s),\n", module);
Printf(s_init, " NO_VERSION_YET,\n");
Printf(s_init, " STANDARD_MODULE_PROPERTIES\n");
Printf(s_init, "};\n");
Printf(s_init, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n", module);
/* Emit all of the code */
Language::top(n);
Printf(s_init, "#ifdef __cplusplus\n");
Printf(s_init, "extern \"C\" {\n");
Printf(s_init, "#endif\n");
// We want to write "SWIGEXPORT ZEND_GET_MODULE(%s)" but ZEND_GET_MODULE
// in PHP5 has "extern "C" { ... }" around it so we can't do that.
Printf(s_init, "SWIGEXPORT zend_module_entry *get_module(void) { return &%s_module_entry; }\n", module);
Printf(s_init, "#ifdef __cplusplus\n");
Printf(s_init, "}\n");
Printf(s_init, "#endif\n\n");
SwigPHP_emit_resource_registrations();
/* start the init section */
{
String * s_init_old = s_init;
s_init = NewString("/* init section */\n");
Printv(s_init, "zend_module_entry ", module, "_module_entry = {\n", NIL);
Printf(s_init, " STANDARD_MODULE_HEADER,\n");
Printf(s_init, " \"%s\",\n", module);
Printf(s_init, " %s_functions,\n", module);
Printf(s_init, " PHP_MINIT(%s),\n", module);
if (Len(s_shutdown) > 0) {
Printf(s_init, " PHP_MSHUTDOWN(%s),\n", module);
} else {
Printf(s_init, " NULL, /* No MSHUTDOWN code */\n");
}
if (Len(r_init) > 0 || Len(s_vinit) > 0) {
Printf(s_init, " PHP_RINIT(%s),\n", module);
} else {
Printf(s_init, " NULL, /* No RINIT code */\n");
}
if (Len(r_shutdown) > 0) {
Printf(s_init, " PHP_RSHUTDOWN(%s),\n", module);
} else {
Printf(s_init, " NULL, /* No RSHUTDOWN code */\n");
}
if (Len(pragma_phpinfo) > 0) {
Printf(s_init, " PHP_MINFO(%s),\n", module);
} else {
Printf(s_init, " NULL, /* No MINFO code */\n");
}
Printf(s_init, " NO_VERSION_YET,\n");
Printf(s_init, " STANDARD_MODULE_PROPERTIES\n");
Printf(s_init, "};\n");
Printf(s_init, "zend_module_entry* SWIG_module_entry = &%s_module_entry;\n\n", module);
Printf(s_init, "#ifdef __cplusplus\n");
Printf(s_init, "extern \"C\" {\n");
Printf(s_init, "#endif\n");
// We want to write "SWIGEXPORT ZEND_GET_MODULE(%s)" but ZEND_GET_MODULE
// in PHP5 has "extern "C" { ... }" around it so we can't do that.
Printf(s_init, "SWIGEXPORT zend_module_entry *get_module(void) { return &%s_module_entry; }\n", module);
Printf(s_init, "#ifdef __cplusplus\n");
Printf(s_init, "}\n");
Printf(s_init, "#endif\n\n");
Printf(s_init, "#define SWIG_php_minit PHP_MINIT_FUNCTION(%s)\n\n", module);
Printv(s_init, s_init_old, NIL);
Delete(s_init_old);
}
/* We have to register the constants before they are (possibly) used
* by the pointer typemaps. This all needs re-arranging really as
* things are being called in the wrong order
*/
Printf(s_init, "#define SWIG_php_minit PHP_MINIT_FUNCTION(%s)\n", module);
/* Emit all of the code */
Language::top(n);
SwigPHP_emit_resource_registrations();
// Printv(s_init,s_resourcetypes,NIL);
/* We need this after all classes written out by ::top */
Printf(s_oinit, "CG(active_class_entry) = NULL;\n");
@ -552,38 +557,66 @@ public:
Printf(s_init, "}\n\n");
// Now do REQUEST init which holds any user specified %rinit, and also vinit
Printf(s_init, "PHP_RINIT_FUNCTION(%s)\n{\n", module);
Printf(s_init, "%s\n", r_init);
if (Len(r_init) > 0 || Len(s_vinit) > 0) {
Printf(f_h, "PHP_RINIT_FUNCTION(%s);\n", module);
/* finish our init section which will have been used by class wrappers */
Printf(s_vinit, "/* end vinit subsection */\n");
Printf(s_init, "%s\n", s_vinit);
Clear(s_vinit);
Delete(s_vinit);
Printf(s_init, "PHP_RINIT_FUNCTION(%s)\n{\n", module);
if (Len(r_init) > 0) {
Printv(s_init,
"/* rinit section */\n",
r_init, "\n",
NIL);
}
Printf(s_init, " return SUCCESS;\n");
Printf(s_init, "}\n\n");
if (Len(s_vinit) > 0) {
/* finish our init section which will have been used by class wrappers */
Printv(s_init,
"/* vinit subsection */\n",
s_vinit, "\n"
"/* end vinit subsection */\n",
NIL);
Clear(s_vinit);
}
Delete(s_vinit);
Printv(s_init, "PHP_MSHUTDOWN_FUNCTION(", module, ")\n"
"{\n",
s_shutdown,
"#ifdef ZTS\n"
" ts_free_id(", module, "_globals_id);\n"
"#endif\n"
" return SUCCESS;\n"
"}\n\n", NIL);
Printf(s_init, " return SUCCESS;\n");
Printf(s_init, "}\n\n");
}
Printf(s_init, "PHP_RSHUTDOWN_FUNCTION(%s)\n{\n", module);
Printf(s_init, "%s\n", r_shutdown);
Printf(s_init, " return SUCCESS;\n");
Printf(s_init, "}\n\n");
Printf(f_h, "PHP_MINIT_FUNCTION(%s);\n", module);
if (Len(s_shutdown) > 0) {
Printf(f_h, "PHP_MSHUTDOWN_FUNCTION(%s);\n", module);
Printv(s_init, "PHP_MSHUTDOWN_FUNCTION(", module, ")\n"
"/* shutdown section */\n"
"{\n",
s_shutdown,
" return SUCCESS;\n"
"}\n\n", NIL);
}
if (Len(r_shutdown) > 0) {
Printf(f_h, "PHP_RSHUTDOWN_FUNCTION(%s);\n", module);
Printf(s_init, "PHP_RSHUTDOWN_FUNCTION(%s)\n{\n", module);
Printf(s_init, "/* rshutdown section */\n");
Printf(s_init, "%s\n", r_shutdown);
Printf(s_init, " return SUCCESS;\n");
Printf(s_init, "}\n\n");
}
if (Len(pragma_phpinfo) > 0) {
Printf(f_h, "PHP_MINFO_FUNCTION(%s);\n", module);
Printf(s_init, "PHP_MINFO_FUNCTION(%s)\n{\n", module);
Printf(s_init, "%s", pragma_phpinfo);
Printf(s_init, "}\n");
}
Printf(s_init, "PHP_MINFO_FUNCTION(%s)\n{\n", module);
Printf(s_init, "%s", pragma_phpinfo);
Printf(s_init, "}\n");
Printf(s_init, "/* end init section */\n");
Printf(f_h, "#endif /* PHP_%s_H */\n", cap_module);
Printf(f_h, "\n#endif /* PHP_%s_H */\n", cap_module);
Delete(f_h);
@ -1478,6 +1511,9 @@ public:
Replaceall(value, "$", "\\$");
}
Printf(args, "$%s=%s", arg_names[i], value);
} else if (constructor && i >= 1 && i < min_num_of_arguments) {
// We need to be able to call __construct($resource).
Printf(args, "$%s=null", arg_names[i]);
} else {
Printf(args, "$%s", arg_names[i]);
}
@ -1498,6 +1534,15 @@ public:
Printf(invoke_args, ",");
}
Printf(invoke_args, "%s", args);
if (constructor && min_num_of_arguments > 1) {
// We need to be able to call __construct($resource).
Clear(args);
Printf(args, "$%s", arg_names[0]);
for (i = 1; i < min_num_of_arguments; ++i) {
Printf(args, ",");
Printf(args, "$%s=null", arg_names[i]);
}
}
bool had_a_case = false;
int last_handled_i = i - 1;
for (; i < max_num_of_arguments; ++i) {
@ -2629,7 +2674,7 @@ done:
// variable named after the result of Swig_cresult_name(), so that can't
// be a zval - make it a pointer to one instead.
Printf(w->code, "zval swig_zval_result, swig_funcname;\n", Swig_cresult_name());
Printf(w->code, "zval *%s = &swig_zval_result;\n", Swig_cresult_name());
Printf(w->code, "zval * SWIGUNUSED %s = &swig_zval_result;\n", Swig_cresult_name());
const char * funcname = GetChar(n, "sym:name");
Printf(w->code, "ZVAL_STRINGL(&swig_funcname, \"%s\", %d);\n", funcname, strlen(funcname));

View file

@ -394,7 +394,7 @@ public:
/* Initialize the rest of the module */
Printf(s_oinit, "ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, %s_destroy_globals);\n", module, module, module);
Printf(s_oinit, "ZEND_INIT_MODULE_GLOBALS(%s, %s_init_globals, NULL);\n", module, module);
/* start the header section */
Printf(s_header, "ZEND_BEGIN_MODULE_GLOBALS(%s)\n", module);
@ -429,9 +429,6 @@ public:
Printf(s_header, " globals->error_code = default_error_code;\n");
Printf(s_header, "}\n");
Printf(s_header, "static void %s_destroy_globals(zend_%s_globals * globals) { (void)globals; }\n", module, module);
Printf(s_header, "\n");
Printf(s_header, "static void SWIG_ResetError(TSRMLS_D) {\n");
Printf(s_header, " SWIG_ErrorMsg() = default_error_msg;\n");
Printf(s_header, " SWIG_ErrorCode() = default_error_code;\n");

View file

@ -261,10 +261,9 @@ public:
rename = strip(name);
Printf(f_classInit, "ADD_FUNCTION(\"%s\", %s, tFunc(%s), 0);\n", rename, function, description);
break;
case CLASS_CONST:
assert(false); // shouldn't have gotten here for CLASS_CONST nodes
default:
assert(false); // what is this?
case CLASS_CONST: // shouldn't have gotten here for CLASS_CONST nodes
default: // what is this?
assert(false);
}
Delete(rename);
}

View file

@ -974,7 +974,9 @@ int R::OutputClassMemberTable(Hash *tb, File *out) {
String *key;
int i, n = Len(keys);
/* Loop over all the <Class>_set and <Class>_get entries in the table. */
/* This function checks for names ending in _set - perhaps it should */
/* use attributes of some other form, as it potentially clashes with */
/* methods ending in _set */
if(n && outputNamespaceInfo) {
Printf(s_namespace, "exportClasses(");
}
@ -984,9 +986,13 @@ int R::OutputClassMemberTable(Hash *tb, File *out) {
String *className = Getitem(el, 0);
char *ptr = Char(key);
ptr = &ptr[Len(key) - 3];
int isSet = strcmp(ptr, "set") == 0;
int klen = Len(key);
int isSet = 0;
if (klen > 4) {
ptr = &ptr[klen - 4];
isSet = strcmp(ptr, "_set") == 0;
}
// OutputArrayMethod(className, el, out);
OutputMemberReferenceMethod(className, isSet, el, out);
@ -1273,7 +1279,9 @@ void R::addAccessor(String *memberName, Wrapper *wrapper, String *name,
if(isSet < 0) {
int n = Len(name);
char *ptr = Char(name);
isSet = Strcmp(NewString(&ptr[n-3]), "set") == 0;
if (n>4) {
isSet = Strcmp(NewString(&ptr[n-4]), "_set") == 0;
}
}
List *l = isSet ? class_member_set_functions : class_member_functions;
@ -1753,7 +1761,8 @@ int R::functionWrapper(Node *n) {
int n = Len(iname);
char *ptr = Char(iname);
bool isSet(Strcmp(NewString(&ptr[n-3]), "set") == 0);
bool isSet(0);
if (n > 4) isSet = Strcmp(NewString(&ptr[n-4]), "_set") == 0;
String *tmp = NewString("");

View file

@ -1419,9 +1419,8 @@ public:
case DESTRUCTOR:
case CLASS_CONST:
case STATIC_VAR:
assert(false); // Should not have gotten here for these types
default:
assert(false);
assert(false); // Should not have gotten here for these types
}
defineAliases(n, iname);
@ -3288,7 +3287,7 @@ public:
}
/* declare Ruby return value */
String *value_result = NewStringf("VALUE %s", Swig_cresult_name());
String *value_result = NewStringf("VALUE SWIGUNUSED %s", Swig_cresult_name());
Wrapper_add_local(w, Swig_cresult_name(), value_result);
Delete(value_result);