Cosmetic variable renaming for consistency across language modules

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-10-27 17:38:05 +00:00
commit b1ee062d2a
8 changed files with 39 additions and 40 deletions

View file

@ -132,7 +132,7 @@ String *Swig_method_call(const_String_or_char_ptr name, ParmList *parms) {
* *
*/ */
String *Swig_method_decl(SwigType *returntype, SwigType *decl, const_String_or_char_ptr id, List *args, int strip, int values) { String *Swig_method_decl(SwigType *rettype, SwigType *decl, const_String_or_char_ptr id, List *args, int strip, int values) {
String *result; String *result;
List *elements; List *elements;
String *element = 0, *nextelement; String *element = 0, *nextelement;
@ -203,7 +203,7 @@ String *Swig_method_decl(SwigType *returntype, SwigType *decl, const_String_or_c
Append(result, ", "); Append(result, ", ");
} }
Append(result, ")"); Append(result, ")");
} else if (returntype) { // This check is intended for conversion operators to a pointer/reference which needs the pointer/reference ignoring in the declaration } else if (rettype) { // This check is intended for conversion operators to a pointer/reference which needs the pointer/reference ignoring in the declaration
if (SwigType_ispointer(element)) { if (SwigType_ispointer(element)) {
Insert(result, 0, "*"); Insert(result, 0, "*");
if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) {
@ -256,9 +256,9 @@ String *Swig_method_decl(SwigType *returntype, SwigType *decl, const_String_or_c
Chop(result); Chop(result);
if (returntype) { if (rettype) {
Insert(result, 0, " "); Insert(result, 0, " ");
String *rtype = SwigType_str(returntype, 0); String *rtype = SwigType_str(rettype, 0);
Insert(result, 0, rtype); Insert(result, 0, rtype);
Delete(rtype); Delete(rtype);
} }

View file

@ -2977,7 +2977,6 @@ private:
int parm_count = emit_num_arguments(parms); int parm_count = emit_num_arguments(parms);
SwigType *result = Getattr(n, "type"); SwigType *result = Getattr(n, "type");
SwigType *returntype = result;
// Save the type for overload processing. // Save the type for overload processing.
Setattr(n, "go:type", result); Setattr(n, "go:type", result);
@ -3462,7 +3461,7 @@ private:
Printv(w->def, " {\n", NULL); Printv(w->def, " {\n", NULL);
if (SwigType_type(result) != T_VOID) { if (SwigType_type(result) != T_VOID) {
Wrapper_add_local(w, "c_result", SwigType_lstr(returntype, "c_result")); Wrapper_add_local(w, "c_result", SwigType_lstr(result, "c_result"));
} }
if (!is_ignored) { if (!is_ignored) {
@ -3528,7 +3527,7 @@ private:
Replaceall(tm, "$input", swig_a_result); Replaceall(tm, "$input", swig_a_result);
Replaceall(tm, "$result", "c_result"); Replaceall(tm, "$result", "c_result");
Printv(w->code, " ", tm, "\n", NULL); Printv(w->code, " ", tm, "\n", NULL);
String *retstr = SwigType_rcaststr(returntype, "c_result"); String *retstr = SwigType_rcaststr(result, "c_result");
Printv(w->code, " return ", retstr, ";\n", NULL); Printv(w->code, " return ", retstr, ";\n", NULL);
Delete(retstr); Delete(retstr);
Delete(tm); Delete(tm);
@ -3600,7 +3599,7 @@ private:
Replaceall(tm, "$input", Swig_cresult_name()); Replaceall(tm, "$input", Swig_cresult_name());
Replaceall(tm, "$result", "c_result"); Replaceall(tm, "$result", "c_result");
Printv(w->code, " ", tm, "\n", NULL); Printv(w->code, " ", tm, "\n", NULL);
String *retstr = SwigType_rcaststr(returntype, "c_result"); String *retstr = SwigType_rcaststr(result, "c_result");
Printv(w->code, " return ", retstr, ";\n", NULL); Printv(w->code, " return ", retstr, ";\n", NULL);
Delete(retstr); Delete(retstr);
Delete(tm); Delete(tm);
@ -3625,7 +3624,7 @@ private:
assert(is_pure_virtual); assert(is_pure_virtual);
Printv(w->code, " _swig_gopanic(\"call to pure virtual function ", Getattr(parent, "sym:name"), name, "\");\n", NULL); Printv(w->code, " _swig_gopanic(\"call to pure virtual function ", Getattr(parent, "sym:name"), name, "\");\n", NULL);
if (SwigType_type(result) != T_VOID) { if (SwigType_type(result) != T_VOID) {
String *retstr = SwigType_rcaststr(returntype, "c_result"); String *retstr = SwigType_rcaststr(result, "c_result");
Printv(w->code, " return ", retstr, ";\n", NULL); Printv(w->code, " return ", retstr, ";\n", NULL);
Delete(retstr); Delete(retstr);
} }

View file

@ -3519,7 +3519,7 @@ public:
String *c_classname = Getattr(parent, "name"); String *c_classname = Getattr(parent, "name");
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *symname = Getattr(n, "sym:name"); String *symname = Getattr(n, "sym:name");
SwigType *returntype = Getattr(n, "returntype"); SwigType *returntype = Getattr(n, "type");
String *overloaded_name = getOverloadedName(n); String *overloaded_name = getOverloadedName(n);
String *storage = Getattr(n, "storage"); String *storage = Getattr(n, "storage");
String *value = Getattr(n, "value"); String *value = Getattr(n, "value");

View file

@ -1383,7 +1383,7 @@ public:
String *storage = Getattr(n, "storage"); String *storage = Getattr(n, "storage");
String *value = Getattr(n, "value"); String *value = Getattr(n, "value");
String *decl = Getattr(n, "decl"); String *decl = Getattr(n, "decl");
String *return_type = Getattr(n, "type"); String *returntype = Getattr(n, "type");
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *classname = Getattr(parent, "sym:name"); String *classname = Getattr(parent, "sym:name");
String *c_classname = Getattr(parent, "name"); String *c_classname = Getattr(parent, "name");
@ -1408,7 +1408,7 @@ public:
/* determine if the method returns a pointer */ /* determine if the method returns a pointer */
is_pointer = SwigType_ispointer_return(decl); is_pointer = SwigType_ispointer_return(decl);
is_void = (!Cmp(return_type, "void") && !is_pointer); is_void = (!Cmp(returntype, "void") && !is_pointer);
/* virtual method definition */ /* virtual method definition */
String *target; String *target;
@ -1430,7 +1430,7 @@ public:
*/ */
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
Wrapper_add_localv(w, "c_result", SwigType_lstr(return_type, "c_result"), NIL); Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), NIL);
} }
} }
@ -1629,15 +1629,15 @@ public:
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
/* A little explanation: /* A little explanation:
* The director_enum test case makes a method whose return type * The director_enum test case makes a method whose return type
* is an enum type. return_type here is "int". gcc complains * is an enum type. returntype here is "int". gcc complains
* about an implicit enum conversion, and although i don't strictly * about an implicit enum conversion, and although i don't strictly
* agree with it, I'm working on fixing the error: * agree with it, I'm working on fixing the error:
* *
* Below is what I came up with. It's not great but it should * Below is what I came up with. It's not great but it should
* always essentially work. * always essentially work.
*/ */
if (!SwigType_isreference(return_type)) { if (!SwigType_isreference(returntype)) {
Printf(w->code, "CAMLreturn_type((%s)c_result);\n", SwigType_lstr(return_type, "")); Printf(w->code, "CAMLreturn_type((%s)c_result);\n", SwigType_lstr(returntype, ""));
} else { } else {
Printf(w->code, "CAMLreturn_type(*c_result);\n"); Printf(w->code, "CAMLreturn_type(*c_result);\n");
} }

View file

@ -1248,7 +1248,7 @@ public:
int is_void = 0; int is_void = 0;
int is_pointer = 0; int is_pointer = 0;
String *decl = Getattr(n, "decl"); String *decl = Getattr(n, "decl");
String *return_type = Getattr(n, "type"); String *returntype = Getattr(n, "type");
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *classname = Getattr(parent, "sym:name"); String *classname = Getattr(parent, "sym:name");
String *c_classname = Getattr(parent, "name"); String *c_classname = Getattr(parent, "name");
@ -1273,7 +1273,7 @@ public:
// determine if the method returns a pointer // determine if the method returns a pointer
is_pointer = SwigType_ispointer_return(decl); is_pointer = SwigType_ispointer_return(decl);
is_void = (!Cmp(return_type, "void") && !is_pointer); is_void = (!Cmp(returntype, "void") && !is_pointer);
// virtual method definition // virtual method definition
String *target; String *target;
@ -1327,7 +1327,7 @@ public:
// handle it, including declaration of c_result ($result). // handle it, including declaration of c_result ($result).
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *cres = SwigType_lstr(return_type, "c_result"); String *cres = SwigType_lstr(returntype, "c_result");
Printf(w->code, "%s;\n", cres); Printf(w->code, "%s;\n", cres);
Delete(cres); Delete(cres);
} }
@ -1444,7 +1444,7 @@ public:
} else { } else {
Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number,
"Unable to use return type %s in director method %s::%s (skipping method).\n", "Unable to use return type %s in director method %s::%s (skipping method).\n",
SwigType_str(return_type, 0), SwigType_namestr(c_classname), SwigType_namestr(name)); SwigType_str(returntype, 0), SwigType_namestr(c_classname), SwigType_namestr(name));
status = SWIG_ERROR; status = SWIG_ERROR;
} }
} }
@ -1471,8 +1471,8 @@ public:
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *rettype = SwigType_str(return_type, 0); String *rettype = SwigType_str(returntype, 0);
if (!SwigType_isreference(return_type)) { if (!SwigType_isreference(returntype)) {
Printf(w->code, "return (%s) c_result;\n", rettype); Printf(w->code, "return (%s) c_result;\n", rettype);
} else { } else {
Printf(w->code, "return (%s) *c_result;\n", rettype); Printf(w->code, "return (%s) *c_result;\n", rettype);

View file

@ -2416,7 +2416,7 @@ done:
int is_void = 0; int is_void = 0;
int is_pointer = 0; int is_pointer = 0;
String *decl = Getattr(n, "decl"); String *decl = Getattr(n, "decl");
String *return_type = Getattr(n, "type"); String *returntype = Getattr(n, "type");
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *classname = Getattr(parent, "sym:name"); String *classname = Getattr(parent, "sym:name");
String *c_classname = Getattr(parent, "name"); String *c_classname = Getattr(parent, "name");
@ -2441,7 +2441,7 @@ done:
/* determine if the method returns a pointer */ /* determine if the method returns a pointer */
is_pointer = SwigType_ispointer_return(decl); is_pointer = SwigType_ispointer_return(decl);
is_void = (Cmp(return_type, "void") == 0 && !is_pointer); is_void = (Cmp(returntype, "void") == 0 && !is_pointer);
/* virtual method definition */ /* virtual method definition */
String *target; String *target;
@ -2497,7 +2497,7 @@ done:
*/ */
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *cres = SwigType_lstr(return_type, "c_result"); String *cres = SwigType_lstr(returntype, "c_result");
Printf(w->code, "%s;\n", cres); Printf(w->code, "%s;\n", cres);
Delete(cres); Delete(cres);
} }
@ -2650,7 +2650,7 @@ done:
Delete(tm); Delete(tm);
} else { } else {
Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number,
"Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(return_type, 0), SwigType_namestr(c_classname), "Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(returntype, 0), SwigType_namestr(c_classname),
SwigType_namestr(name)); SwigType_namestr(name));
status = SWIG_ERROR; status = SWIG_ERROR;
} }
@ -2677,8 +2677,8 @@ done:
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *rettype = SwigType_str(return_type, 0); String *rettype = SwigType_str(returntype, 0);
if (!SwigType_isreference(return_type)) { if (!SwigType_isreference(returntype)) {
Printf(w->code, "return (%s) c_result;\n", rettype); Printf(w->code, "return (%s) c_result;\n", rettype);
} else { } else {
Printf(w->code, "return (%s) *c_result;\n", rettype); Printf(w->code, "return (%s) *c_result;\n", rettype);

View file

@ -4538,7 +4538,7 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
Wrapper *w = NewWrapper(); Wrapper *w = NewWrapper();
String *tm; String *tm;
String *wrap_args = NewString(""); String *wrap_args = NewString("");
String *return_type = Getattr(n, "type"); String *returntype = Getattr(n, "type");
String *value = Getattr(n, "value"); String *value = Getattr(n, "value");
String *storage = Getattr(n, "storage"); String *storage = Getattr(n, "storage");
bool pure_virtual = false; bool pure_virtual = false;
@ -4554,7 +4554,7 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
/* determine if the method returns a pointer */ /* determine if the method returns a pointer */
is_pointer = SwigType_ispointer_return(decl); is_pointer = SwigType_ispointer_return(decl);
is_void = (!Cmp(return_type, "void") && !is_pointer); is_void = (!Cmp(returntype, "void") && !is_pointer);
/* virtual method definition */ /* virtual method definition */
String *target; String *target;
@ -4608,7 +4608,7 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
*/ */
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *cres = SwigType_lstr(return_type, "c_result"); String *cres = SwigType_lstr(returntype, "c_result");
Printf(w->code, "%s;\n", cres); Printf(w->code, "%s;\n", cres);
Delete(cres); Delete(cres);
} }
@ -4903,7 +4903,7 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
Delete(tm); Delete(tm);
} else { } else {
Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number,
"Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(return_type, 0), SwigType_namestr(c_classname), "Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(returntype, 0), SwigType_namestr(c_classname),
SwigType_namestr(name)); SwigType_namestr(name));
status = SWIG_ERROR; status = SWIG_ERROR;
} }
@ -4940,8 +4940,8 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *rettype = SwigType_str(return_type, 0); String *rettype = SwigType_str(returntype, 0);
if (!SwigType_isreference(return_type)) { if (!SwigType_isreference(returntype)) {
Printf(w->code, "return (%s) c_result;\n", rettype); Printf(w->code, "return (%s) c_result;\n", rettype);
} else { } else {
Printf(w->code, "return (%s) *c_result;\n", rettype); Printf(w->code, "return (%s) *c_result;\n", rettype);

View file

@ -3027,7 +3027,7 @@ public:
Wrapper *w = NewWrapper(); Wrapper *w = NewWrapper();
String *tm; String *tm;
String *wrap_args = NewString(""); String *wrap_args = NewString("");
String *return_type = Getattr(n, "type"); String *returntype = Getattr(n, "type");
Parm *p; Parm *p;
String *value = Getattr(n, "value"); String *value = Getattr(n, "value");
String *storage = Getattr(n, "storage"); String *storage = Getattr(n, "storage");
@ -3050,7 +3050,7 @@ public:
/* determine if the method returns a pointer */ /* determine if the method returns a pointer */
is_pointer = SwigType_ispointer_return(decl); is_pointer = SwigType_ispointer_return(decl);
is_void = (!Cmp(return_type, "void") && !is_pointer); is_void = (!Cmp(returntype, "void") && !is_pointer);
/* virtual method definition */ /* virtual method definition */
String *target; String *target;
@ -3107,7 +3107,7 @@ public:
*/ */
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
Wrapper_add_localv(w, "c_result", SwigType_lstr(return_type, "c_result"), NIL); Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), NIL);
} }
} }
@ -3292,7 +3292,7 @@ public:
Printv(w->code, tm, "\n", NIL); Printv(w->code, tm, "\n", NIL);
} else { } else {
Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number,
"Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(return_type, 0), "Unable to use return type %s in director method %s::%s (skipping method).\n", SwigType_str(returntype, 0),
SwigType_namestr(c_classname), SwigType_namestr(name)); SwigType_namestr(c_classname), SwigType_namestr(name));
status = SWIG_ERROR; status = SWIG_ERROR;
} }
@ -3323,8 +3323,8 @@ public:
/* any existing helper functions to handle this? */ /* any existing helper functions to handle this? */
if (!is_void) { if (!is_void) {
if (!(ignored_method && !pure_virtual)) { if (!(ignored_method && !pure_virtual)) {
String *rettype = SwigType_str(return_type, 0); String *rettype = SwigType_str(returntype, 0);
if (!SwigType_isreference(return_type)) { if (!SwigType_isreference(returntype)) {
Printf(w->code, "return (%s) c_result;\n", rettype); Printf(w->code, "return (%s) c_result;\n", rettype);
} else { } else {
Printf(w->code, "return (%s) *c_result;\n", rettype); Printf(w->code, "return (%s) *c_result;\n", rettype);