Revert rev 10606 "Merged revisions 10498-10499,10503-10504,10506,10508,10511,10515-10516,10518-10519,10527,10530-10531,10536-10537,10539-10552,10558-10568,10574-10580,10582,10584,10588-10589,10594 via svnmerge from "
This reverts commit 379b9bcdf44dcd87c5eca7eb9a773aea793e7caf. From: William S Fulton <wsf@fultondesigns.co.uk> git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13034 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d6b81eb831
commit
1acc0167d1
111 changed files with 482 additions and 757 deletions
|
|
@ -423,7 +423,7 @@ int yylook(void) {
|
|||
{
|
||||
String *cmt = Scanner_text(scan);
|
||||
char *loc = Char(cmt);
|
||||
if ((strncmp(loc,"/*@SWIG",7) == 0) && (loc[Len(cmt)-3] == '@')) {
|
||||
if ((strncmp(loc,"/*@SWIG@",6) == 0) && (loc[Len(cmt)-3] == '@')) {
|
||||
scanner_locator(cmt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,9 +331,7 @@ static void add_symbols(Node *n) {
|
|||
Delete(prefix);
|
||||
}
|
||||
|
||||
/*
|
||||
if (!Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]);
|
||||
*/
|
||||
if (0 && !Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]);
|
||||
Setattr(n,"ismember","1");
|
||||
}
|
||||
}
|
||||
|
|
@ -4111,11 +4109,10 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
|
|||
/* Check for template names. If the class is a template
|
||||
and the constructor is missing the template part, we
|
||||
add it */
|
||||
if (Classprefix) {
|
||||
c = strchr(Char(Classprefix),'<');
|
||||
if (c && !Strchr($3,'<')) {
|
||||
$3 = NewStringf("%s%s",$3,c);
|
||||
}
|
||||
if (Classprefix && (c = strchr(Char(Classprefix),'<'))) {
|
||||
if (!Strchr($3,'<')) {
|
||||
$3 = NewStringf("%s%s",$3,c);
|
||||
}
|
||||
}
|
||||
Setattr($$,"storage","virtual");
|
||||
name = NewStringf("%s",$3);
|
||||
|
|
@ -4431,8 +4428,12 @@ parms : rawparms {
|
|||
;
|
||||
|
||||
rawparms : parm ptail {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
if (1) {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
} else {
|
||||
$$ = $2;
|
||||
}
|
||||
}
|
||||
| empty { $$ = 0; }
|
||||
;
|
||||
|
|
@ -4485,8 +4486,12 @@ valparms : rawvalparms {
|
|||
;
|
||||
|
||||
rawvalparms : valparm valptail {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
if (1) {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
} else {
|
||||
$$ = $2;
|
||||
}
|
||||
}
|
||||
| empty { $$ = 0; }
|
||||
;
|
||||
|
|
|
|||
|
|
@ -281,13 +281,13 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
|
|||
Delete(ptargs);
|
||||
}
|
||||
|
||||
/*
|
||||
if (0) {
|
||||
Parm *p = tparms;
|
||||
while (p) {
|
||||
Printf(stdout, "tparm: '%s' '%s' '%s'\n", Getattr(p, "name"), Getattr(p, "type"), Getattr(p, "value"));
|
||||
p = nextSibling(p);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/* Printf(stdout,"targs = '%s'\n", templateargs);
|
||||
Printf(stdout,"rname = '%s'\n", rname);
|
||||
|
|
|
|||
|
|
@ -112,11 +112,12 @@ static void DelHash(DOH *ho) {
|
|||
int i;
|
||||
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
DohFree(h->hashtable);
|
||||
|
|
@ -137,11 +138,12 @@ static void Hash_clear(DOH *ho) {
|
|||
int i;
|
||||
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
}
|
||||
}
|
||||
h->hashtable[i] = 0;
|
||||
}
|
||||
|
|
@ -452,10 +454,11 @@ static DOH *CopyHash(DOH *ho) {
|
|||
|
||||
nho = DohObjMalloc(&DohHashType, nh);
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
Hash_setattr(nho, n->key, n->object);
|
||||
n = n->next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
Hash_setattr(nho, n->key, n->object);
|
||||
n = n->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nho;
|
||||
|
|
|
|||
|
|
@ -2271,7 +2271,7 @@ int ALLEGROCL::emit_dispatch_defun(Node *n) {
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
||||
int ALLEGROCL::emit_defun(Node *n, File *f_cl) {
|
||||
#ifdef ALLEGROCL_WRAP_DEBUG
|
||||
Printf(stderr, "emit_defun: ENTER... ");
|
||||
#endif
|
||||
|
|
@ -2307,27 +2307,27 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
if (Generate_Wrapper) {
|
||||
String *extra_parms = id_converter_arguments(n)->noname_str();
|
||||
if (Getattr(n, "sym:overloaded"))
|
||||
Printf(fcl, "(swig-defmethod (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Printf(f_cl, "(swig-defmethod (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
else
|
||||
Printf(fcl, "(swig-defun (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Printf(f_cl, "(swig-defun (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Delete(extra_parms);
|
||||
}
|
||||
// Just C
|
||||
else {
|
||||
Printf(fcl, "(swig-defun (\"%s\" \"%s\")\n", funcname, Generate_Wrapper ? mangled_name : funcname);
|
||||
Printf(f_cl, "(swig-defun (\"%s\" \"%s\")\n", funcname, Generate_Wrapper ? mangled_name : funcname);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Lisp foreign call parameter list //
|
||||
//////////////////////////////////////
|
||||
Printf(fcl, " (");
|
||||
Printf(f_cl, " (");
|
||||
|
||||
/* Special cases */
|
||||
|
||||
if (ParmList_len(pl) == 0) {
|
||||
Printf(fcl, ":void");
|
||||
Printf(f_cl, ":void");
|
||||
/* } else if (any_varargs(pl)) {
|
||||
Printf(fcl, "#| varargs |#");
|
||||
Printf(f_cl, "#| varargs |#");
|
||||
varargs=1; */
|
||||
} else {
|
||||
String *largs = NewString("");
|
||||
|
|
@ -2337,7 +2337,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
SwigType *argtype = Swig_cparse_type(Getattr(p, "tmap:ctype"));
|
||||
|
||||
if (!first) {
|
||||
Printf(fcl, "\n ");
|
||||
Printf(f_cl, "\n ");
|
||||
}
|
||||
|
||||
if (SwigType_isvarargs(argtype)) {
|
||||
|
|
@ -2393,7 +2393,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
// if this parameter has been removed from the C/++ wrapper
|
||||
// it shouldn't be in the lisp wrapper either.
|
||||
if (!checkAttribute(p, "tmap:in:numinputs", "0")) {
|
||||
Printf(fcl, "(%s %s %s %s %s)",
|
||||
Printf(f_cl, "(%s %s %s %s %s)",
|
||||
// parms in the ff wrapper, but not in the lisp wrapper.
|
||||
(checkAttribute(p, "tmap:lin:numinputs", "0") ? ":p-" : ":p+"), argname, dispatchtype, ffitype, lisptype);
|
||||
|
||||
|
|
@ -2479,12 +2479,12 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
Replaceall(wrap->code, "$ldestructor", ldestructor);
|
||||
Delete(ldestructor);
|
||||
|
||||
Printf(fcl, ")\n"); /* finish arg list */
|
||||
Printf(f_cl, ")\n"); /* finish arg list */
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Lisp foreign call return type and optimizations //
|
||||
/////////////////////////////////////////////////////
|
||||
Printf(fcl, " (:returning (%s %s)", compose_foreign_type(result_type), get_lisp_type(Getattr(n, "type"), "result"));
|
||||
Printf(f_cl, " (:returning (%s %s)", compose_foreign_type(result_type), get_lisp_type(Getattr(n, "type"), "result"));
|
||||
|
||||
for (Iterator option = First(n); option.item; option = Next(option)) {
|
||||
if (Strncmp("feature:ffargs:", option.key, 15))
|
||||
|
|
@ -2494,12 +2494,12 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
Replaceall(option_name, "_", "-");
|
||||
|
||||
// TODO: varargs vs call-direct ?
|
||||
Printf(fcl, "\n %s %s", option_name, option_val);
|
||||
Printf(f_cl, "\n %s %s", option_name, option_val);
|
||||
|
||||
Delete(option_name);
|
||||
}
|
||||
|
||||
Printf(fcl, ")\n %s)\n\n", wrap->code);
|
||||
Printf(f_cl, ")\n %s)\n\n", wrap->code);
|
||||
// Wrapper_print(wrap, stderr);
|
||||
|
||||
Delete(result_type);
|
||||
|
|
@ -2935,9 +2935,11 @@ int ALLEGROCL::classHandler(Node *n) {
|
|||
#endif
|
||||
|
||||
if (Generate_Wrapper)
|
||||
return cppClassHandler(n);
|
||||
return cppClassHandler(n);
|
||||
else
|
||||
return cClassHandler(n);
|
||||
return cClassHandler(n);
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
int ALLEGROCL::cClassHandler(Node *n) {
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
Parm *p;
|
||||
int i;
|
||||
String *wname;
|
||||
String *source;
|
||||
Wrapper *f;
|
||||
String *mangle = NewString("");
|
||||
String *get_pointers;
|
||||
|
|
@ -397,6 +398,8 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
SwigType *pt = Getattr(p, "type");
|
||||
String *ln = Getattr(p, "lname");
|
||||
|
||||
source = NewStringf("scm%d", i + 1);
|
||||
|
||||
Printf(f->def, ", C_word scm%d", i + 1);
|
||||
Printf(declfunc, ",C_word");
|
||||
|
||||
|
|
@ -404,7 +407,6 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
if ((tm = Getattr(p, "tmap:in"))) {
|
||||
String *parse = Getattr(p, "tmap:in:parse");
|
||||
if (!parse) {
|
||||
String *source = NewStringf("scm%d", i + 1);
|
||||
Replaceall(tm, "$source", source);
|
||||
Replaceall(tm, "$target", ln);
|
||||
Replaceall(tm, "$input", source);
|
||||
|
|
@ -443,15 +445,20 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
}
|
||||
}
|
||||
}
|
||||
Delete(source);
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
|
||||
p = Getattr(p, "tmap:in:next");
|
||||
continue;
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
Delete(source);
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
/* finish argument marshalling */
|
||||
|
|
@ -1503,7 +1510,7 @@ int CHICKEN::validIdentifier(String *s) {
|
|||
/* ------------------------------------------------------------
|
||||
* closNameMapping()
|
||||
* Maps the identifier from C++ to the CLOS based on command
|
||||
* line parameters and such.
|
||||
* line paramaters and such.
|
||||
* If class_name = "" that means the mapping is for a function or
|
||||
* variable not attached to any class.
|
||||
* ------------------------------------------------------------ */
|
||||
|
|
|
|||
|
|
@ -1073,9 +1073,7 @@ public:
|
|||
global_variable_flag = false;
|
||||
generate_property_declaration_flag = false;
|
||||
|
||||
if (proxy_flag) {
|
||||
Printf(module_class_code, "\n }\n\n");
|
||||
}
|
||||
Printf(module_class_code, "\n }\n\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1926,7 +1924,7 @@ public:
|
|||
Swig_warning(WARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF, input_file, line_number, "No cstype typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// Properties
|
||||
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) == 0);
|
||||
if (setter_flag)
|
||||
|
|
@ -2109,7 +2107,7 @@ public:
|
|||
Swig_warning(WARN_CSHARP_TYPEMAP_CSOUT_UNDEF, input_file, line_number, "No csout typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// Properties
|
||||
if (generate_property_declaration_flag) { // Ensure the declaration is generated just once should the property contain both a set and get
|
||||
// Get the C# variable type - obtained differently depending on whether a setter is required.
|
||||
|
|
@ -2543,7 +2541,6 @@ public:
|
|||
num_arguments = emit_num_arguments(l);
|
||||
num_required = emit_num_required(l);
|
||||
|
||||
bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag);
|
||||
int gencomma = 0;
|
||||
|
||||
/* Output each parameter */
|
||||
|
|
@ -2570,7 +2567,7 @@ public:
|
|||
if (gencomma)
|
||||
Printf(imcall, ", ");
|
||||
|
||||
String *arg = makeParameterName(n, p, i, global_or_member_variable);
|
||||
String *arg = makeParameterName(n, p, i, setter_flag);
|
||||
|
||||
// Use typemaps to transform type used in C# wrapper function (in proxy class) to type used in PInvoke function (in intermediary class)
|
||||
if ((tm = Getattr(p, "tmap:csin"))) {
|
||||
|
|
@ -2758,7 +2755,7 @@ public:
|
|||
value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex"));
|
||||
} else {
|
||||
// Get the enumvalue from a PINVOKE call
|
||||
if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) {
|
||||
if (!getCurrentClass() || !cparse_cplusplus) {
|
||||
// Strange hack to change the name
|
||||
Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */
|
||||
constantWrapper(n);
|
||||
|
|
@ -2880,7 +2877,7 @@ public:
|
|||
* n - Node
|
||||
* p - parameter node
|
||||
* arg_num - parameter argument number
|
||||
* setter - set this flag when wrapping variables
|
||||
* setter - set this flag when wrapping member variables
|
||||
* Return:
|
||||
* arg - a unique parameter name
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
@ -2889,22 +2886,20 @@ public:
|
|||
|
||||
String *arg = 0;
|
||||
String *pn = Getattr(p, "name");
|
||||
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
|
||||
if (setter && Cmp(arg, "self") != 0) {
|
||||
if (setter) {
|
||||
// Note that in C# properties, the input variable name is always called 'value'
|
||||
Delete(arg);
|
||||
arg = NewString("value");
|
||||
} else {
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
}
|
||||
|
||||
return arg;
|
||||
|
|
|
|||
|
|
@ -1649,7 +1649,7 @@ public:
|
|||
/* ------------------------------------------------------------
|
||||
* goopsNameMapping()
|
||||
* Maps the identifier from C++ to the GOOPS based * on command
|
||||
* line parameters and such.
|
||||
* line paramaters and such.
|
||||
* If class_name = "" that means the mapping is for a function or
|
||||
* variable not attached to any class.
|
||||
* ------------------------------------------------------------ */
|
||||
|
|
|
|||
|
|
@ -1932,7 +1932,7 @@ public:
|
|||
Swig_warning(WARN_JAVA_TYPEMAP_JSTYPE_UNDEF, input_file, line_number, "No jstype typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// For wrapping member variables (Javabean setter)
|
||||
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) == 0);
|
||||
}
|
||||
|
|
@ -2463,7 +2463,6 @@ public:
|
|||
num_arguments = emit_num_arguments(l);
|
||||
num_required = emit_num_required(l);
|
||||
|
||||
bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag);
|
||||
int gencomma = 0;
|
||||
|
||||
/* Output each parameter */
|
||||
|
|
@ -2488,7 +2487,7 @@ public:
|
|||
if (gencomma)
|
||||
Printf(imcall, ", ");
|
||||
|
||||
String *arg = makeParameterName(n, p, i, global_or_member_variable);
|
||||
String *arg = makeParameterName(n, p, i, setter_flag);
|
||||
|
||||
// Use typemaps to transform type used in Java wrapper function (in proxy class) to type used in JNI function (in intermediary class)
|
||||
if ((tm = Getattr(p, "tmap:javain"))) {
|
||||
|
|
@ -2633,7 +2632,7 @@ public:
|
|||
value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex"));
|
||||
} else {
|
||||
// Get the enumvalue from a JNI call
|
||||
if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) {
|
||||
if (!getCurrentClass() || !cparse_cplusplus) {
|
||||
// Strange hack to change the name
|
||||
Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */
|
||||
constantWrapper(n);
|
||||
|
|
@ -2760,7 +2759,7 @@ public:
|
|||
* n - Node
|
||||
* p - parameter node
|
||||
* arg_num - parameter argument number
|
||||
* setter - set this flag when wrapping variables
|
||||
* setter - set this flag when wrapping member variables
|
||||
* Return:
|
||||
* arg - a unique parameter name
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
@ -2769,23 +2768,21 @@ public:
|
|||
|
||||
String *arg = 0;
|
||||
String *pn = Getattr(p, "name");
|
||||
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
|
||||
if (setter && Cmp(arg, "self") != 0) {
|
||||
if (setter) {
|
||||
// Note that for setters the parameter name is always set but sometimes includes C++
|
||||
// scope resolution, so we need to strip off the scope resolution to make a valid name.
|
||||
Delete(arg);
|
||||
arg = NewString("value"); //Swig_scopename_last(pn);
|
||||
} else {
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
}
|
||||
|
||||
return arg;
|
||||
|
|
|
|||
|
|
@ -1097,33 +1097,38 @@ int Language::globalfunctionHandler(Node *n) {
|
|||
String *name = Getattr(n, "name");
|
||||
String *symname = Getattr(n, "sym:name");
|
||||
SwigType *type = Getattr(n, "type");
|
||||
String *storage = Getattr(n, "storage");
|
||||
ParmList *parms = Getattr(n, "parms");
|
||||
|
||||
/* Check for callback mode */
|
||||
String *cb = GetFlagAttr(n, "feature:callback");
|
||||
if (cb) {
|
||||
String *cbname = Getattr(n, "feature:callback:name");
|
||||
if (!cbname) {
|
||||
cbname = NewStringf(cb, symname);
|
||||
Setattr(n, "feature:callback:name", cbname);
|
||||
}
|
||||
if (0 && (Cmp(storage, "static") == 0)) {
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP; /* Can't wrap static functions */
|
||||
} else {
|
||||
/* Check for callback mode */
|
||||
String *cb = GetFlagAttr(n, "feature:callback");
|
||||
if (cb) {
|
||||
String *cbname = Getattr(n, "feature:callback:name");
|
||||
if (!cbname) {
|
||||
cbname = NewStringf(cb, symname);
|
||||
Setattr(n, "feature:callback:name", cbname);
|
||||
}
|
||||
|
||||
callbackfunctionHandler(n);
|
||||
if (Cmp(cbname, symname) == 0) {
|
||||
callbackfunctionHandler(n);
|
||||
if (Cmp(cbname, symname) == 0) {
|
||||
Delete(cbname);
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
Delete(cbname);
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
Delete(cbname);
|
||||
Setattr(n, "parms", nonvoid_parms(parms));
|
||||
String *call = Swig_cfunction_call(name, parms);
|
||||
String *cres = Swig_cresult(type, "result", call);
|
||||
Setattr(n, "wrap:action", cres);
|
||||
Delete(cres);
|
||||
Delete(call);
|
||||
functionWrapper(n);
|
||||
}
|
||||
Setattr(n, "parms", nonvoid_parms(parms));
|
||||
String *call = Swig_cfunction_call(name, parms);
|
||||
String *cres = Swig_cresult(type, "result", call);
|
||||
Setattr(n, "wrap:action", cres);
|
||||
Delete(cres);
|
||||
Delete(call);
|
||||
functionWrapper(n);
|
||||
|
||||
Swig_restore(n);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -1371,6 +1376,9 @@ int Language::variableHandler(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::globalvariableHandler(Node *n) {
|
||||
String *storage = Getattr(n, "storage");
|
||||
if (0 && (Cmp(storage, "static") == 0))
|
||||
return SWIG_NOWRAP;
|
||||
variableWrapper(n);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -2100,8 +2108,8 @@ int Language::classDirector(Node *n) {
|
|||
String *using_protected_members_code = NewString("");
|
||||
for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) {
|
||||
Node *nodeType = Getattr(ni, "nodeType");
|
||||
bool cdeclaration = (Cmp(nodeType, "cdecl") == 0);
|
||||
if (cdeclaration && !GetFlag(ni, "feature:ignore")) {
|
||||
bool cdecl = (Cmp(nodeType, "cdecl") == 0);
|
||||
if (cdecl && !GetFlag(ni, "feature:ignore")) {
|
||||
if (is_non_virtual_protected_access(ni)) {
|
||||
Node *overloaded = Getattr(ni, "sym:overloaded");
|
||||
// emit the using base::member statement (but only once if the method is overloaded)
|
||||
|
|
@ -3383,8 +3391,7 @@ int Language::is_assignable(Node *n) {
|
|||
SwigType *ftd = SwigType_typedef_resolve_all(type);
|
||||
SwigType *td = SwigType_strip_qualifiers(ftd);
|
||||
if (SwigType_type(td) == T_USER) {
|
||||
cn = Swig_symbol_clookup(td, 0);
|
||||
if (cn) {
|
||||
if ((cn = Swig_symbol_clookup(td, 0))) {
|
||||
if ((Strcmp(nodeType(cn), "class") == 0)) {
|
||||
if (Getattr(cn, "allocate:noassign")) {
|
||||
SetFlag(n, "feature:immutable");
|
||||
|
|
|
|||
|
|
@ -490,6 +490,8 @@ public:
|
|||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
// add all argcheck code
|
||||
|
|
@ -1099,6 +1101,7 @@ public:
|
|||
virtual int staticmemberfunctionHandler(Node *n) {
|
||||
current = STATIC_FUNC;
|
||||
return Language::staticmemberfunctionHandler(n);
|
||||
current = NO_CPP;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
|
|
@ -1120,6 +1123,7 @@ public:
|
|||
// REPORT("staticmembervariableHandler",n);
|
||||
current = STATIC_VAR;
|
||||
return Language::staticmembervariableHandler(n);
|
||||
current = NO_CPP;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ int GenerateDefault = 1; // Generate default constructors
|
|||
int Verbose = 0;
|
||||
int AddExtern = 0;
|
||||
int NoExcept = 0;
|
||||
int SwigRuntime = 0; // 0 = no option, 1 = -runtime, 2 = -noruntime
|
||||
int SwigRuntime = 0; // 0 = no option, 1 = -c or -runtime, 2 = -noruntime
|
||||
|
||||
/* Suppress warning messages for private inheritance, preprocessor evaluation etc...
|
||||
WARN_PP_EVALUATION 202
|
||||
|
|
@ -491,13 +491,13 @@ void SWIG_getoptions(int argc, char *argv[]) {
|
|||
Wrapper_compact_print_mode_set(1);
|
||||
Wrapper_virtual_elimination_mode_set(1);
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-runtime") == 0) { // Used to also accept -c. removed in swig-1.3.36
|
||||
} else if (strcmp(argv[i], "-runtime") == 0) {
|
||||
Swig_mark_arg(i);
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-c, -runtime, -noruntime command line options are deprecated.\n");
|
||||
SwigRuntime = 1;
|
||||
} else if (strcmp(argv[i], "-noruntime") == 0) {
|
||||
} else if ((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "-noruntime") == 0)) {
|
||||
Swig_mark_arg(i);
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-c, -runtime, -noruntime command line options are deprecated.\n");
|
||||
SwigRuntime = 2;
|
||||
} else if (strcmp(argv[i], "-external-runtime") == 0) {
|
||||
external_runtime = 1;
|
||||
|
|
|
|||
|
|
@ -472,9 +472,9 @@ MODULA3():
|
|||
cap = true;
|
||||
} else {
|
||||
if (cap) {
|
||||
m3sym[i] = (char)toupper(c);
|
||||
m3sym[i] = toupper(c);
|
||||
} else {
|
||||
m3sym[i] = (char)tolower(c);
|
||||
m3sym[i] = tolower(c);
|
||||
}
|
||||
cap = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,44 +150,45 @@ void SwigPHP_emit_resource_registrations() {
|
|||
ki = First(zend_types);
|
||||
if (ki.key)
|
||||
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
|
||||
while (ki.key) {
|
||||
DOH *key = ki.key;
|
||||
Node *class_node = ki.item;
|
||||
String *human_name = key;
|
||||
while (ki.key)
|
||||
if (1 /* is pointer type */ ) {
|
||||
DOH *key = ki.key;
|
||||
Node *class_node = ki.item;
|
||||
String *human_name = key;
|
||||
|
||||
// Write out destructor function header
|
||||
Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key);
|
||||
// Write out destructor function header
|
||||
Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key);
|
||||
|
||||
// write out body
|
||||
if ((class_node != NOTCLASS)) {
|
||||
String *destructor = Getattr(class_node, "destructor");
|
||||
human_name = Getattr(class_node, "sym:name");
|
||||
if (!human_name)
|
||||
human_name = Getattr(class_node, "name");
|
||||
// Do we have a known destructor for this type?
|
||||
if (destructor) {
|
||||
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
|
||||
// write out body
|
||||
if ((class_node != NOTCLASS)) {
|
||||
String *destructor = Getattr(class_node, "destructor");
|
||||
human_name = Getattr(class_node, "sym:name");
|
||||
if (!human_name)
|
||||
human_name = Getattr(class_node, "name");
|
||||
// Do we have a known destructor for this type?
|
||||
if (destructor) {
|
||||
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
|
||||
}
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
|
||||
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
|
||||
}
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
|
||||
|
||||
// close function
|
||||
Printf(s_wrappers, "}\n");
|
||||
|
||||
// declare le_swig_<mangled> to store php registration
|
||||
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
||||
|
||||
// register with php
|
||||
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
|
||||
|
||||
// store php type in class struct
|
||||
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
||||
|
||||
ki = Next(ki);
|
||||
}
|
||||
|
||||
// close function
|
||||
Printf(s_wrappers, "}\n");
|
||||
|
||||
// declare le_swig_<mangled> to store php registration
|
||||
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
||||
|
||||
// register with php
|
||||
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
|
||||
|
||||
// store php type in class struct
|
||||
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
||||
|
||||
ki = Next(ki);
|
||||
}
|
||||
}
|
||||
|
||||
class PHP:public Language {
|
||||
|
|
@ -1194,7 +1195,7 @@ public:
|
|||
if (native_constructor == NATIVE_CONSTRUCTOR) {
|
||||
Printf(f->code, "add_property_zval(this_ptr,\"" SWIG_PTR "\",_cPtr);\n");
|
||||
} else {
|
||||
String *shadowrettype = GetShadowReturnType(n);
|
||||
String *shadowrettype = SwigToPhpType(n, true);
|
||||
Printf(f->code, "object_init_ex(return_value,ptr_ce_swig_%s);\n", shadowrettype);
|
||||
Delete(shadowrettype);
|
||||
Printf(f->code, "add_property_zval(return_value,\"" SWIG_PTR "\",_cPtr);\n");
|
||||
|
|
@ -1439,10 +1440,6 @@ public:
|
|||
if (wrapperType == memberfn)
|
||||
p = nextSibling(p);
|
||||
while (p) {
|
||||
if (GetInt(p, "tmap:in:numinputs") == 0) {
|
||||
p = nextSibling(p);
|
||||
continue;
|
||||
}
|
||||
assert(0 <= argno && argno < max_num_of_arguments);
|
||||
String *&pname = arg_names[argno];
|
||||
const char *pname_cstr = GetChar(p, "name");
|
||||
|
|
@ -1753,8 +1750,7 @@ public:
|
|||
}
|
||||
|
||||
Printf(output, "\n");
|
||||
// If it's a member function or a class constructor...
|
||||
if (wrapperType == memberfn || (newobject && current_class)) {
|
||||
if (wrapperType == memberfn || newobject) {
|
||||
Printf(output, "\tfunction %s(%s) {\n", methodname, args);
|
||||
// We don't need this code if the wrapped class has a copy ctor
|
||||
// since the flat function new_CLASSNAME will handle it for us.
|
||||
|
|
@ -2559,9 +2555,20 @@ public:
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
String * GetShadowReturnType(Node *n) {
|
||||
|
||||
String * SwigToPhpType(Node *n, int shadow_flag) {
|
||||
String *ptype = 0;
|
||||
SwigType *t = Getattr(n, "type");
|
||||
|
||||
if (shadow_flag) {
|
||||
ptype = PhpTypeFromTypemap((char *) "pstype", n, (char *) "");
|
||||
}
|
||||
if (!ptype) {
|
||||
ptype = PhpTypeFromTypemap((char *) "ptype", n, (char *) "");
|
||||
}
|
||||
|
||||
if (ptype) return ptype;
|
||||
|
||||
/* Map type here */
|
||||
switch (SwigType_type(t)) {
|
||||
case T_CHAR:
|
||||
|
|
@ -2582,7 +2589,7 @@ public:
|
|||
case T_POINTER:
|
||||
case T_REFERENCE:
|
||||
case T_USER:
|
||||
if (is_shadow(t)) {
|
||||
if (shadow_flag && is_shadow(t)) {
|
||||
return NewString(Char(is_shadow(t)));
|
||||
}
|
||||
break;
|
||||
|
|
@ -2590,7 +2597,7 @@ public:
|
|||
/* TODO */
|
||||
break;
|
||||
default:
|
||||
Printf(stderr, "GetShadowReturnType: unhandled data type: %s\n", SwigType_str(t, 0));
|
||||
Printf(stderr, "SwigToPhpType: unhandled data type: %s\n", SwigType_str(t, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1773,6 +1773,7 @@ public:
|
|||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
/* finish argument marshalling */
|
||||
|
|
|
|||
|
|
@ -57,13 +57,11 @@ static String * getRTypeName(SwigType *t, int *outCount = NULL) {
|
|||
Insert(tmp, 0, retName);
|
||||
return tmp;
|
||||
|
||||
/*
|
||||
if(count)
|
||||
return(b);
|
||||
|
||||
Delete(b);
|
||||
return(NewString(""));
|
||||
*/
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
@ -106,7 +104,7 @@ static String * getRType(Node *n) {
|
|||
Now handles arrays, i.e. struct A[2]
|
||||
****************/
|
||||
|
||||
static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
||||
static String *getRClassName(String *retType, int addRef = 1, int upRef=0) {
|
||||
String *tmp = NewString("");
|
||||
SwigType *resolved = SwigType_typedef_resolve_all(retType);
|
||||
char *retName = Char(SwigType_manglestr(resolved));
|
||||
|
|
@ -117,7 +115,6 @@ static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
|||
}
|
||||
|
||||
return tmp;
|
||||
/*
|
||||
#if 1
|
||||
List *l = SwigType_split(retType);
|
||||
int n = Len(l);
|
||||
|
|
@ -163,7 +160,6 @@ static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
|||
#endif
|
||||
|
||||
return tmp;
|
||||
*/
|
||||
}
|
||||
|
||||
/*********************
|
||||
|
|
@ -1845,9 +1841,6 @@ int R::functionWrapper(Node *n) {
|
|||
String *name = Getattr(p,"name");
|
||||
String *lname = Getattr(p,"lname");
|
||||
|
||||
// R keyword renaming
|
||||
if (name && Swig_name_warning(p, 0, name, 0))
|
||||
name = 0;
|
||||
|
||||
/* If we have a :: in the parameter name because we are accessing a static member of a class, say, then
|
||||
we need to remove that prefix. */
|
||||
|
|
@ -2034,18 +2027,14 @@ int R::functionWrapper(Node *n) {
|
|||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(addCopyParam) {
|
||||
if(0 && addCopyParam) {
|
||||
Printf(f->code, "if(LOGICAL(s_swig_copy)[0]) {\n");
|
||||
Printf(f->code, "/* Deal with returning a reference. */\nr_ans = R_NilValue;\n");
|
||||
Printf(f->code, "}\n else {\n");
|
||||
}
|
||||
#endif
|
||||
Printf(f->code, "%s\n", tm);
|
||||
#if 0
|
||||
if(addCopyParam)
|
||||
if(0 && addCopyParam)
|
||||
Printf(f->code, "}\n"); /* end of if(s_swig_copy) ... else { ... } */
|
||||
#endif
|
||||
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number,
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ private:
|
|||
parent_name = Copy( Getattr(mod, "name") );
|
||||
if ( parent_name )
|
||||
{
|
||||
(Char(parent_name))[0] = (char)toupper((Char(parent_name))[0]);
|
||||
(Char(parent_name))[0] = toupper((Char(parent_name))[0]);
|
||||
}
|
||||
}
|
||||
if ( parent_name )
|
||||
|
|
@ -1194,7 +1194,7 @@ public:
|
|||
while (m.item) {
|
||||
if (Len(m.item) > 0) {
|
||||
String *cap = NewString(m.item);
|
||||
(Char(cap))[0] = (char)toupper((Char(cap))[0]);
|
||||
(Char(cap))[0] = toupper((Char(cap))[0]);
|
||||
if (last != 0) {
|
||||
Append(module, "::");
|
||||
}
|
||||
|
|
@ -1206,7 +1206,7 @@ public:
|
|||
if (feature == 0) {
|
||||
feature = Copy(last);
|
||||
}
|
||||
(Char(last))[0] = (char)toupper((Char(last))[0]);
|
||||
(Char(last))[0] = toupper((Char(last))[0]);
|
||||
modvar = NewStringf("m%s", last);
|
||||
Delete(modules);
|
||||
}
|
||||
|
|
@ -2219,7 +2219,7 @@ public:
|
|||
return name;
|
||||
|
||||
if (islower(name[0])) {
|
||||
name[0] = (char)toupper(name[0]);
|
||||
name[0] = toupper(name[0]);
|
||||
Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number, "Wrong %s name (corrected to `%s')\n", reason, name);
|
||||
return name;
|
||||
}
|
||||
|
|
@ -2545,7 +2545,7 @@ public:
|
|||
String *name = Copy(symname);
|
||||
char *cname = Char(name);
|
||||
if (cname)
|
||||
cname[0] = (char)toupper(cname[0]);
|
||||
cname[0] = toupper(cname[0]);
|
||||
Printv(director_prot_ctor_code,
|
||||
"if ( $comparison ) { /* subclassed */\n",
|
||||
" $director_new \n",
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ static int error_as_warning = 0; /* Understand the cpp #error directive as a spe
|
|||
/* Test a character to see if it valid in an identifier (after the first letter) */
|
||||
#define isidchar(c) ((isalnum(c)) || (c == '_') || (c == '$'))
|
||||
|
||||
DOH *Preprocessor_replace(DOH *);
|
||||
|
||||
/* Skip whitespace */
|
||||
static void skip_whitespace(String *s, String *out) {
|
||||
|
|
@ -699,6 +698,7 @@ static String *get_options(String *str) {
|
|||
static String *expand_macro(String *name, List *args) {
|
||||
String *ns;
|
||||
DOH *symbols, *macro, *margs, *mvalue, *temp, *tempa, *e;
|
||||
DOH *Preprocessor_replace(DOH *);
|
||||
int i, l;
|
||||
int isvarargs = 0;
|
||||
|
||||
|
|
@ -935,6 +935,7 @@ static String *expand_macro(String *name, List *args) {
|
|||
|
||||
List *evaluate_args(List *x) {
|
||||
Iterator i;
|
||||
String *Preprocessor_replace(String *);
|
||||
List *nl = NewList();
|
||||
|
||||
for (i = First(x); i.item; i = Next(i)) {
|
||||
|
|
@ -1794,7 +1795,7 @@ String *Preprocessor_parse(String *s) {
|
|||
for (i = 0; i < 6;) {
|
||||
c = Getc(s);
|
||||
Putc(c, value);
|
||||
statement[i++] = (char)c;
|
||||
statement[i++] = c;
|
||||
if (strncmp(statement, ed, i) && strncmp(statement, df, i))
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -513,8 +513,7 @@ String *Swig_cppconstructor_base_call(String_or_char *name, ParmList *parms, int
|
|||
pname = Swig_cparm_name(p, i);
|
||||
i++;
|
||||
} else {
|
||||
pname = Getattr(p, "value");
|
||||
if (pname)
|
||||
if ((pname = Getattr(p, "value")))
|
||||
pname = Copy(pname);
|
||||
else
|
||||
pname = Copy(Getattr(p, "name"));
|
||||
|
|
|
|||
|
|
@ -352,8 +352,7 @@ char *Swig_file_filename(const String_or_char *filename) {
|
|||
char *c;
|
||||
|
||||
strcpy(tmp, Char(filename));
|
||||
c = strrchr(tmp, *delim);
|
||||
if (c)
|
||||
if ((c = strrchr(tmp, *delim)))
|
||||
return c + 1;
|
||||
else
|
||||
return tmp;
|
||||
|
|
|
|||
|
|
@ -614,8 +614,7 @@ void Swig_scopename_split(String *s, String **rprefix, String **rlast) {
|
|||
*rlast = Copy(s);
|
||||
}
|
||||
|
||||
co = strstr(cc, "operator ");
|
||||
if (co) {
|
||||
if ((co = strstr(cc, "operator "))) {
|
||||
if (co == cc) {
|
||||
*rprefix = 0;
|
||||
*rlast = Copy(s);
|
||||
|
|
@ -665,9 +664,7 @@ String *Swig_scopename_prefix(String *s) {
|
|||
char *co = 0;
|
||||
if (!strstr(c, "::"))
|
||||
return 0;
|
||||
co = strstr(cc, "operator ");
|
||||
|
||||
if (co) {
|
||||
if ((co = strstr(cc, "operator "))) {
|
||||
if (co == cc) {
|
||||
return 0;
|
||||
} else {
|
||||
|
|
@ -718,8 +715,7 @@ String *Swig_scopename_last(String *s) {
|
|||
if (!strstr(c, "::"))
|
||||
return NewString(s);
|
||||
|
||||
co = strstr(cc, "operator ");
|
||||
if (co) {
|
||||
if ((co = strstr(cc, "operator "))) {
|
||||
return NewString(co);
|
||||
}
|
||||
|
||||
|
|
@ -760,9 +756,7 @@ String *Swig_scopename_first(String *s) {
|
|||
char *co = 0;
|
||||
if (!strstr(c, "::"))
|
||||
return 0;
|
||||
|
||||
co = strstr(c, "operator ");
|
||||
if (co) {
|
||||
if ((co = strstr(c, "operator "))) {
|
||||
if (co == c) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -810,9 +804,7 @@ String *Swig_scopename_suffix(String *s) {
|
|||
char *co = 0;
|
||||
if (!strstr(c, "::"))
|
||||
return 0;
|
||||
|
||||
co = strstr(c, "operator ");
|
||||
if (co) {
|
||||
if ((co = strstr(c, "operator "))) {
|
||||
if (co == c)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -850,9 +842,8 @@ String *Swig_scopename_suffix(String *s) {
|
|||
|
||||
int Swig_scopename_check(String *s) {
|
||||
char *c = Char(s);
|
||||
char *co = strstr(c, "operator ");
|
||||
|
||||
if (co) {
|
||||
char *co = 0;
|
||||
if ((co = strstr(c, "operator "))) {
|
||||
if (co == c)
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -482,8 +482,7 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType
|
|||
Delete(t_name);
|
||||
}
|
||||
/* A template-based class lookup */
|
||||
/*
|
||||
if (!rn && SwigType_istemplate(prefix)) {
|
||||
if (0 && !rn && SwigType_istemplate(prefix)) {
|
||||
String *t_prefix = SwigType_templateprefix(prefix);
|
||||
if (Strcmp(t_prefix, prefix) != 0) {
|
||||
String *t_name = SwigType_templateprefix(name);
|
||||
|
|
@ -492,7 +491,6 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType
|
|||
}
|
||||
Delete(t_prefix);
|
||||
}
|
||||
*/
|
||||
}
|
||||
/* A wildcard-based class lookup */
|
||||
if (!rn) {
|
||||
|
|
@ -1479,7 +1477,7 @@ String *Swig_name_make(Node *n, String *prefix, String_or_char *cname, SwigType
|
|||
}
|
||||
|
||||
|
||||
if (rename_hash || rename_list || namewarn_hash || namewarn_list) {
|
||||
if (rename_hash || rename_list) {
|
||||
Hash *rn = Swig_name_object_get(Swig_name_rename_hash(), prefix, name, decl);
|
||||
if (!rn || !Swig_name_match_nameobj(rn, n)) {
|
||||
rn = Swig_name_nameobj_lget(Swig_name_rename_list(), n, prefix, name, decl);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ static char nextchar(Scanner * s) {
|
|||
if ((nc == '\n') && (!s->freeze_line))
|
||||
s->line++;
|
||||
Putc(nc,s->text);
|
||||
return (char)nc;
|
||||
return nc;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -349,7 +349,7 @@ static void get_escape(Scanner *s) {
|
|||
} else {
|
||||
char tmp[3];
|
||||
tmp[0] = '\\';
|
||||
tmp[1] = (char)c;
|
||||
tmp[1] = c;
|
||||
tmp[2] = 0;
|
||||
Delitem(s->text, DOH_END);
|
||||
Append(s->text, tmp);
|
||||
|
|
|
|||
|
|
@ -937,8 +937,7 @@ String *SwigType_templateargs(const SwigType *t) {
|
|||
|
||||
int SwigType_istemplate(const SwigType *t) {
|
||||
char *ct = Char(t);
|
||||
ct = strstr(ct, "<(");
|
||||
if (ct && (strstr(ct + 2, ")>")))
|
||||
if ((ct = strstr(ct, "<(")) && (strstr(ct + 2, ")>")))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,8 +108,6 @@ static Hash *typedef_resolve_cache = 0;
|
|||
static Hash *typedef_all_cache = 0;
|
||||
static Hash *typedef_qualified_cache = 0;
|
||||
|
||||
static Typetab *SwigType_find_scope(Typetab *s, String *nameprefix);
|
||||
|
||||
/* common attribute keys, to avoid calling find_key all the times */
|
||||
|
||||
/*
|
||||
|
|
@ -164,6 +162,7 @@ void SwigType_typesystem_init() {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int SwigType_typedef(SwigType *type, String_or_char *name) {
|
||||
Typetab *SwigType_find_scope(Typetab *, String *s);
|
||||
if (Getattr(current_typetab, name))
|
||||
return -1; /* Already defined */
|
||||
if (Strcmp(type, name) == 0) { /* Can't typedef a name to itself */
|
||||
|
|
@ -410,7 +409,7 @@ void SwigType_print_scope(Typetab *t) {
|
|||
}
|
||||
}
|
||||
|
||||
static Typetab *SwigType_find_scope(Typetab *s, String *nameprefix) {
|
||||
Typetab *SwigType_find_scope(Typetab *s, String *nameprefix) {
|
||||
Typetab *ss;
|
||||
String *nnameprefix = 0;
|
||||
static int check_parent = 1;
|
||||
|
|
@ -1312,8 +1311,7 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
|
|||
SwigType *ftd = SwigType_typedef_resolve_all(t);
|
||||
td = SwigType_strip_qualifiers(ftd);
|
||||
Delete(ftd);
|
||||
n = Swig_symbol_clookup(td, 0);
|
||||
if (n) {
|
||||
if ((n = Swig_symbol_clookup(td, 0))) {
|
||||
if (GetFlag(n, "feature:valuewrapper")) {
|
||||
use_wrapper = 1;
|
||||
} else {
|
||||
|
|
@ -1336,8 +1334,7 @@ SwigType *SwigType_alttype(SwigType *t, int local_tmap) {
|
|||
Delete(ftd);
|
||||
if (SwigType_type(td) == T_USER) {
|
||||
use_wrapper = 1;
|
||||
n = Swig_symbol_clookup(td, 0);
|
||||
if (n) {
|
||||
if ((n = Swig_symbol_clookup(td, 0))) {
|
||||
if ((Checkattr(n, "nodeType", "class")
|
||||
&& !Getattr(n, "allocate:noassign")
|
||||
&& (Getattr(n, "allocate:default_constructor")))
|
||||
|
|
@ -1798,15 +1795,13 @@ void SwigType_inherit_equiv(File *out) {
|
|||
String *lprefix = SwigType_lstr(prefix, 0);
|
||||
Hash *subhash = Getattr(sub, bk.key);
|
||||
String *convcode = Getattr(subhash, "convcode");
|
||||
Printf(out, "static void *%s(void *x, int *newmemory) {", convname);
|
||||
if (convcode) {
|
||||
char *newmemoryused = Strstr(convcode, "newmemory"); /* see if newmemory parameter is used in order to avoid unused parameter warnings */
|
||||
String *fn = Copy(convcode);
|
||||
Replaceall(fn, "$from", "x");
|
||||
Printf(out, "static void *%s(void *x, int *%s) {", convname, newmemoryused ? "newmemory" : "SWIGUNUSEDPARM(newmemory)");
|
||||
Printf(out, "%s", fn);
|
||||
} else {
|
||||
String *cast = Getattr(subhash, "cast");
|
||||
Printf(out, "static void *%s(void *x, int *SWIGUNUSEDPARM(newmemory)) {", convname);
|
||||
Printf(out, "\n return (void *)((%s) ", lkey);
|
||||
if (cast)
|
||||
Printf(out, "%s", cast);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue