(RUBY::create_function): Placate old sgi C++ compiler, which
can't handle "for-scope" variables by declaring an auto `i'. This is arguably the wrong thing to do. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ce63c99954
commit
7f1d6aea40
1 changed files with 12 additions and 11 deletions
|
|
@ -356,6 +356,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
char *tm;
|
char *tm;
|
||||||
String cleanup, outarg;
|
String cleanup, outarg;
|
||||||
WrapperFunction f;
|
WrapperFunction f;
|
||||||
|
int i;
|
||||||
|
|
||||||
// Ruby needs no destructor wrapper
|
// Ruby needs no destructor wrapper
|
||||||
if (current == DESTRUCTOR)
|
if (current == DESTRUCTOR)
|
||||||
|
|
@ -395,7 +396,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
|
|
||||||
int numreq = 0;
|
int numreq = 0;
|
||||||
int numoptreal = 0;
|
int numoptreal = 0;
|
||||||
for (int i = start; i < l->nparms; i++) {
|
for (i = start; i < l->nparms; i++) {
|
||||||
if (!l->get(i)->ignore) {
|
if (!l->get(i)->ignore) {
|
||||||
if (i >= l->nparms - numopt) numoptreal++;
|
if (i >= l->nparms - numopt) numoptreal++;
|
||||||
else numreq++;
|
else numreq++;
|
||||||
|
|
@ -409,7 +410,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
f.def << "int argc, VALUE *argv, VALUE self";
|
f.def << "int argc, VALUE *argv, VALUE self";
|
||||||
} else {
|
} else {
|
||||||
f.def << "VALUE self";
|
f.def << "VALUE self";
|
||||||
for (int i = start; i < l->nparms; i++) {
|
for (i = start; i < l->nparms; i++) {
|
||||||
if (!l->get(i)->ignore) {
|
if (!l->get(i)->ignore) {
|
||||||
f.def << ", VALUE varg" << i;
|
f.def << ", VALUE varg" << i;
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +420,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
|
|
||||||
// Emit all of the local variables for holding arguments.
|
// Emit all of the local variables for holding arguments.
|
||||||
if (vararg) {
|
if (vararg) {
|
||||||
for (int i = start; i < l->nparms; i++) {
|
for (i = start; i < l->nparms; i++) {
|
||||||
if (!l->get(i)->ignore) {
|
if (!l->get(i)->ignore) {
|
||||||
String s;
|
String s;
|
||||||
s << "varg" << i;
|
s << "varg" << i;
|
||||||
|
|
@ -449,7 +450,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
if (vararg) {
|
if (vararg) {
|
||||||
f.code << tab4 << "rb_scan_args(argc, argv, \""
|
f.code << tab4 << "rb_scan_args(argc, argv, \""
|
||||||
<< (numarg-numoptreal) << numoptreal << "\"";
|
<< (numarg-numoptreal) << numoptreal << "\"";
|
||||||
for (int i = start; i < l->nparms; i++) {
|
for (i = start; i < l->nparms; i++) {
|
||||||
if (!l->get(i)->ignore) {
|
if (!l->get(i)->ignore) {
|
||||||
f.code << ", &varg" << i;
|
f.code << ", &varg" << i;
|
||||||
}
|
}
|
||||||
|
|
@ -461,7 +462,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
// to get arguments
|
// to get arguments
|
||||||
int j = 0; // Total number of non-optional arguments
|
int j = 0; // Total number of non-optional arguments
|
||||||
|
|
||||||
for (int i = 0; i < pcount ; i++) {
|
for (i = 0; i < pcount ; i++) {
|
||||||
Parm &p = (*l)[i]; // Get the ith argument
|
Parm &p = (*l)[i]; // Get the ith argument
|
||||||
source = "";
|
source = "";
|
||||||
target = "";
|
target = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue