(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@533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
faadedeeb2
commit
40deb5d53c
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;
|
||||
String cleanup, outarg;
|
||||
WrapperFunction f;
|
||||
int i;
|
||||
|
||||
// Ruby needs no destructor wrapper
|
||||
if (current == DESTRUCTOR)
|
||||
|
|
@ -395,7 +396,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
|
||||
int numreq = 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 (i >= l->nparms - numopt) numoptreal++;
|
||||
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";
|
||||
} else {
|
||||
f.def << "VALUE self";
|
||||
for (int i = start; i < l->nparms; i++) {
|
||||
for (i = start; i < l->nparms; i++) {
|
||||
if (!l->get(i)->ignore) {
|
||||
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.
|
||||
if (vararg) {
|
||||
for (int i = start; i < l->nparms; i++) {
|
||||
for (i = start; i < l->nparms; i++) {
|
||||
if (!l->get(i)->ignore) {
|
||||
String s;
|
||||
s << "varg" << i;
|
||||
|
|
@ -449,7 +450,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
if (vararg) {
|
||||
f.code << tab4 << "rb_scan_args(argc, argv, \""
|
||||
<< (numarg-numoptreal) << numoptreal << "\"";
|
||||
for (int i = start; i < l->nparms; i++) {
|
||||
for (i = start; i < l->nparms; i++) {
|
||||
if (!l->get(i)->ignore) {
|
||||
f.code << ", &varg" << i;
|
||||
}
|
||||
|
|
@ -461,7 +462,7 @@ void RUBY::create_function(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
// to get 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
|
||||
source = "";
|
||||
target = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue