Merge branch 'master' into doxygen

This commit is contained in:
Vadim Zeitlin 2018-03-19 21:54:46 +01:00
commit b7f78dd5a7
232 changed files with 5648 additions and 2419 deletions

View file

@ -19,9 +19,15 @@
#include <stdlib.h>
#include "../DoxygenTranslator/src/PyDocConverter.h"
#include <iostream>
#include <stdint.h>
#define PYSHADOW_MEMBER 0x2
#define WARN_PYTHON_MULTIPLE_INH 405
#define PYTHON_INT_MAX (2147483647)
#define PYTHON_INT_MIN (-2147483647-1)
static String *const_code = 0;
static String *module = 0;
static String *package = 0;
@ -516,7 +522,7 @@ public:
no_header_file = 1;
Swig_mark_arg(i);
} else if ((strcmp(argv[i], "-new_vwm") == 0) || (strcmp(argv[i], "-newvwm") == 0)) {
/* Turn on new value wrapper mpde */
/* Turn on new value wrapper mode */
Swig_value_wrapper_mode(1);
no_header_file = 1;
Swig_mark_arg(i);
@ -2123,9 +2129,11 @@ public:
String *result = NIL;
// Check if this is an integer number in any base.
errno = 0;
long value = strtol(s, &end, 0);
if (errno == ERANGE || end == s)
return NIL;
if (*end != '\0') {
// If there is a suffix after the number, we can safely ignore "l"
// and (provided the number is unsigned) "u", and also combinations of
@ -2148,6 +2156,14 @@ public:
// So now we are certain that we are indeed dealing with an integer
// that has a representation as long given by value.
// Restrict to guaranteed supported range in Python, see maxint docs: https://docs.python.org/2/library/sys.html#sys.maxint
// Don't do this pointless check when long is 32 bits or smaller as strtol will have already failed with ERANGE
#if LONG_MAX > PYTHON_INT_MAX || LONG_MIN < PYTHON_INT_MIN
if (value > PYTHON_INT_MAX || value < PYTHON_INT_MIN) {
return NIL;
}
#endif
if (Cmp(resolved_type, "bool") == 0)
// Allow integers as the default value for a bool parameter.
return NewString(value ? "True" : "False");
@ -2184,6 +2200,7 @@ public:
const char *const s = Char(v);
char *end;
errno = 0;
double value = strtod(s, &end);
(void) value;
if (errno != ERANGE && end != s) {
@ -3796,7 +3813,7 @@ public:
Wrapper *w = NewWrapper();
String *call;
String *basetype = Getattr(parent, "classtype");
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
String *target = Swig_method_decl(0, decl, classname, parms, 0);
call = Swig_csuperclass_call(0, basetype, superparms);
Printf(w->def, "%s::%s: %s, Swig::Director(self) { \n", classname, target, call);
Printf(w->def, " SWIG_DIRECTOR_RGTR((%s *)this, this); \n", basetype);
@ -3809,7 +3826,7 @@ public:
/* constructor header */
{
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
String *target = Swig_method_decl(0, decl, classname, parms, 1);
Printf(f_directors_h, " %s;\n", target);
Delete(target);
}
@ -5438,12 +5455,12 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
String *pclassname = NewStringf("SwigDirector_%s", classname);
String *qualified_name = NewStringf("%s::%s", pclassname, name);
SwigType *rtype = Getattr(n, "conversion_operator") ? 0 : Getattr(n, "classDirectorMethods:type");
target = Swig_method_decl(rtype, decl, qualified_name, l, 0, 0);
target = Swig_method_decl(rtype, decl, qualified_name, l, 0);
Printf(w->def, "%s", target);
Delete(qualified_name);
Delete(target);
/* header declaration */
target = Swig_method_decl(rtype, decl, name, l, 0, 1);
target = Swig_method_decl(rtype, decl, name, l, 1);
Printf(declaration, " virtual %s", target);
Delete(target);
@ -5527,7 +5544,7 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
/* remove the wrapper 'w' since it was producing spurious temps */
Swig_typemap_attach_parms("in", l, 0);
Swig_typemap_attach_parms("directorin", l, 0);
Swig_typemap_attach_parms("directorin", l, w);
Swig_typemap_attach_parms("directorargout", l, w);
Parm *p;