Eliminated Workshop5.0 warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@476 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
df442c12e5
commit
2bff7e2491
7 changed files with 72 additions and 72 deletions
|
|
@ -36,11 +36,11 @@ public :
|
||||||
JAVA() {
|
JAVA() {
|
||||||
module = NULL;
|
module = NULL;
|
||||||
package = NULL;
|
package = NULL;
|
||||||
java_path = "java";
|
java_path = (char*)"java";
|
||||||
f_java = f_shadow = NULL;
|
f_java = f_shadow = NULL;
|
||||||
native_func = shadow = member_func = 0;
|
native_func = shadow = member_func = 0;
|
||||||
jimport = shadow_name = shadow_baseclass = NULL;
|
jimport = shadow_name = shadow_baseclass = NULL;
|
||||||
method_modifiers = "public final static";
|
method_modifiers = (char*)"public final static";
|
||||||
jnic = -1;
|
jnic = -1;
|
||||||
useRegisterNatives=0;
|
useRegisterNatives=0;
|
||||||
finalize=0;
|
finalize=0;
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ static char cvsroot[] = "$Header$";
|
||||||
|
|
||||||
static String pragma_include;
|
static String pragma_include;
|
||||||
|
|
||||||
static char *usage = "\
|
static char *usage = (char*)"\
|
||||||
Perl5 Options (available with -perl5)\n\
|
Perl5 Options (available with -perl5)\n\
|
||||||
-module name - Set module name\n\
|
-module name - Set module name\n\
|
||||||
-package name - Set package prefix\n\
|
-package name - Set package prefix\n\
|
||||||
|
|
@ -191,7 +191,7 @@ PERL5::parse_args(int argc, char *argv[]) {
|
||||||
|
|
||||||
// Set name of typemaps
|
// Set name of typemaps
|
||||||
|
|
||||||
typemap_lang = "perl5";
|
typemap_lang = (char*)"perl5";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -654,7 +654,7 @@ void PERL5::get_pointer(char *iname, char *srcname, char *src, char *dest,
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
void PERL5::create_command(char *cname, char *iname) {
|
void PERL5::create_command(char *cname, char *iname) {
|
||||||
fprintf(f_init,"\t newXS(\"%s::%s\", %s, file);\n", package, iname, name_wrapper(cname,""));
|
fprintf(f_init,"\t newXS(\"%s::%s\", %s, file);\n", package, iname, name_wrapper(cname,(char*)""));
|
||||||
if (export_all) {
|
if (export_all) {
|
||||||
exported << iname << " ";
|
exported << iname << " ";
|
||||||
}
|
}
|
||||||
|
|
@ -683,7 +683,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
// Make a wrapper name for this
|
// Make a wrapper name for this
|
||||||
|
|
||||||
wname = name_wrapper(iname,"");
|
wname = name_wrapper(iname,(char*)"");
|
||||||
|
|
||||||
// Now write the wrapper function itself....this is pretty ugly
|
// Now write the wrapper function itself....this is pretty ugly
|
||||||
|
|
||||||
|
|
@ -693,7 +693,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
pcount = emit_args(d, l, f);
|
pcount = emit_args(d, l, f);
|
||||||
numopt = l->numopt();
|
numopt = l->numopt();
|
||||||
|
|
||||||
f.add_local("int","argvi = 0");
|
f.add_local((char*)"int",(char*)"argvi = 0");
|
||||||
|
|
||||||
// Check the number of arguments
|
// Check the number of arguments
|
||||||
|
|
||||||
|
|
@ -724,7 +724,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
f.code << tab4 << "if (items > " << j << ") {\n";
|
f.code << tab4 << "if (items > " << j << ") {\n";
|
||||||
|
|
||||||
// See if there is a type-map
|
// See if there is a type-map
|
||||||
if ((tm = typemap_lookup("in","perl5",p->t,p->name,source,target,&f))) {
|
if ((tm = typemap_lookup((char*)"in",(char*)"perl5",p->t,p->name,source,target,&f))) {
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
f.code.replace("$argnum",argnum);
|
f.code.replace("$argnum",argnum);
|
||||||
f.code.replace("$arg",source);
|
f.code.replace("$arg",source);
|
||||||
|
|
@ -800,7 +800,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
// typed pointer.
|
// typed pointer.
|
||||||
|
|
||||||
sprintf(temp,"argument %d", i+1);
|
sprintf(temp,"argument %d", i+1);
|
||||||
get_pointer(iname,temp,source,target, p->t, f.code, "XSRETURN(1)");
|
get_pointer(iname,temp,source,target, p->t, f.code, (char*)"XSRETURN(1)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -815,25 +815,25 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
}
|
}
|
||||||
// Check to see if there is any sort of "build" typemap (highly complicated)
|
// Check to see if there is any sort of "build" typemap (highly complicated)
|
||||||
|
|
||||||
if ((tm = typemap_lookup("build","perl5",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"build",(char*)"perl5",p->t,p->name,source,target))) {
|
||||||
build << tm << "\n";
|
build << tm << "\n";
|
||||||
have_build = 1;
|
have_build = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is any constraint code
|
// Check if there is any constraint code
|
||||||
if ((tm = typemap_lookup("check","perl5",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"check",(char*)"perl5",p->t,p->name,source,target))) {
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
f.code.replace("$argnum",argnum);
|
f.code.replace("$argnum",argnum);
|
||||||
}
|
}
|
||||||
need_save = 0;
|
need_save = 0;
|
||||||
|
|
||||||
if ((tm = typemap_lookup("freearg","perl5",p->t,p->name,target,temp))) {
|
if ((tm = typemap_lookup((char*)"freearg",(char*)"perl5",p->t,p->name,target,temp))) {
|
||||||
cleanup << tm << "\n";
|
cleanup << tm << "\n";
|
||||||
cleanup.replace("$argnum",argnum);
|
cleanup.replace("$argnum",argnum);
|
||||||
cleanup.replace("$arg",temp);
|
cleanup.replace("$arg",temp);
|
||||||
need_save = 1;
|
need_save = 1;
|
||||||
}
|
}
|
||||||
if ((tm = typemap_lookup("argout","perl5",p->t,p->name,target,"ST(argvi)"))) {
|
if ((tm = typemap_lookup((char*)"argout",(char*)"perl5",p->t,p->name,target,(char*)"ST(argvi)"))) {
|
||||||
String tempstr;
|
String tempstr;
|
||||||
tempstr = tm;
|
tempstr = tm;
|
||||||
tempstr.replace("$argnum",argnum);
|
tempstr.replace("$argnum",argnum);
|
||||||
|
|
@ -855,7 +855,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
if (num_saved) {
|
if (num_saved) {
|
||||||
sprintf(temp,"_saved[%d]",num_saved);
|
sprintf(temp,"_saved[%d]",num_saved);
|
||||||
f.add_local("SV *",temp);
|
f.add_local((char*)"SV *",temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there was a "build" typemap, we need to go in and perform a serious hack
|
// If there was a "build" typemap, we need to go in and perform a serious hack
|
||||||
|
|
@ -885,7 +885,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
emit_func_call(name,d,l,f);
|
emit_func_call(name,d,l,f);
|
||||||
|
|
||||||
// See if there was a typemap
|
// See if there was a typemap
|
||||||
if ((tm = typemap_lookup("out","perl5",d,iname,"_result","ST(argvi)"))) {
|
if ((tm = typemap_lookup((char*)"out",(char*)"perl5",d,iname,(char*)"_result",(char*)"ST(argvi)"))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
} else if ((d->type != T_VOID) || (d->is_pointer)) {
|
} else if ((d->type != T_VOID) || (d->is_pointer)) {
|
||||||
|
|
@ -905,7 +905,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
f.code << tab4 << "sv_setnv(ST(argvi++), (double) _result);\n";
|
f.code << tab4 << "sv_setnv(ST(argvi++), (double) _result);\n";
|
||||||
break;
|
break;
|
||||||
case T_CHAR :
|
case T_CHAR :
|
||||||
f.add_local("char", "_ctemp[2]");
|
f.add_local((char*)"char", (char*)"_ctemp[2]");
|
||||||
f.code << tab4 << "_ctemp[0] = _result;\n"
|
f.code << tab4 << "_ctemp[0] = _result;\n"
|
||||||
<< tab4 << "_ctemp[1] = 0;\n"
|
<< tab4 << "_ctemp[1] = 0;\n"
|
||||||
<< tab4 << "sv_setpv((SV*)ST(argvi++),_ctemp);\n";
|
<< tab4 << "sv_setpv((SV*)ST(argvi++),_ctemp);\n";
|
||||||
|
|
@ -950,12 +950,12 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
f.code << cleanup;
|
f.code << cleanup;
|
||||||
|
|
||||||
if (NewObject) {
|
if (NewObject) {
|
||||||
if ((tm = typemap_lookup("newfree","perl5",d,iname,"_result",""))) {
|
if ((tm = typemap_lookup((char*)"newfree",(char*)"perl5",d,iname,(char*)"_result",(char*)""))) {
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tm = typemap_lookup("ret","perl5",d,iname,"_result",""))) {
|
if ((tm = typemap_lookup((char*)"ret",(char*)"perl5",d,iname,(char*)"_result",(char*)""))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
}
|
}
|
||||||
|
|
@ -966,7 +966,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
// Add the dXSARGS last
|
// Add the dXSARGS last
|
||||||
|
|
||||||
f.add_local("dXSARGS","");
|
f.add_local((char*)"dXSARGS",(char*)"");
|
||||||
|
|
||||||
// Substitute the cleanup code
|
// Substitute the cleanup code
|
||||||
f.code.replace("$cleanup",cleanup);
|
f.code.replace("$cleanup",cleanup);
|
||||||
|
|
@ -1017,7 +1017,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
String sourceNtarget;
|
String sourceNtarget;
|
||||||
sourceNtarget << "$args[" << i << "]";
|
sourceNtarget << "$args[" << i << "]";
|
||||||
|
|
||||||
if ((tm = typemap_lookup("perl5in","perl5",p->t,"",sourceNtarget,sourceNtarget)))
|
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget,sourceNtarget)))
|
||||||
func << tm << "\n";
|
func << tm << "\n";
|
||||||
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
||||||
if (i >= (pcount - numopt))
|
if (i >= (pcount - numopt))
|
||||||
|
|
@ -1042,7 +1042,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
// implicit malloc/new. We'll mark the object like it was created
|
// implicit malloc/new. We'll mark the object like it was created
|
||||||
// in Perl so we can garbage collect it.
|
// in Perl so we can garbage collect it.
|
||||||
|
|
||||||
if ((tm = typemap_lookup("perl5out","perl5",d,"",name,"sv"))) {
|
if ((tm = typemap_lookup((char*)"perl5out",(char*)"perl5",d,(char*)"",name,(char*)"sv"))) {
|
||||||
func << tm << "\n"
|
func << tm << "\n"
|
||||||
<< tab4 <<"return $result;\n"
|
<< tab4 <<"return $result;\n"
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
|
|
@ -1119,9 +1119,9 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
setf.code << tab4 << "mg = mg;\n";
|
setf.code << tab4 << "mg = mg;\n";
|
||||||
|
|
||||||
/* Check for a few typemaps */
|
/* Check for a few typemaps */
|
||||||
if ((tm = typemap_lookup("varin","perl5",t,"","sv",name))) {
|
if ((tm = typemap_lookup((char*)"varin",(char*)"perl5",t,(char*)"",(char*)"sv",name))) {
|
||||||
setf.code << tm << "\n";
|
setf.code << tm << "\n";
|
||||||
} else if ((tm = typemap_lookup("in","perl5",t,"","sv",name))) {
|
} else if ((tm = typemap_lookup((char*)"in",(char*)"perl5",t,(char*)"",(char*)"sv",name))) {
|
||||||
setf.code << tm << "\n";
|
setf.code << tm << "\n";
|
||||||
} else {
|
} else {
|
||||||
if (!t->is_pointer) {
|
if (!t->is_pointer) {
|
||||||
|
|
@ -1149,8 +1149,8 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
// Get as a pointer value
|
// Get as a pointer value
|
||||||
|
|
||||||
t->is_pointer++;
|
t->is_pointer++;
|
||||||
setf.add_local("void","*_temp");
|
setf.add_local((char*)"void",(char*)"*_temp");
|
||||||
get_pointer(iname,"value","sv","_temp", t, setf.code, "return(1)");
|
get_pointer(iname,(char*)"value",(char*)"sv",(char*)"_temp", t, setf.code, (char*)"return(1)");
|
||||||
setf.code << tab4 << name << " = *(" << t->print_cast() << " _temp);\n";
|
setf.code << tab4 << name << " = *(" << t->print_cast() << " _temp);\n";
|
||||||
t->is_pointer--;
|
t->is_pointer--;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1162,7 +1162,7 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
} else {
|
} else {
|
||||||
// Have some sort of pointer type here, Process it differently
|
// Have some sort of pointer type here, Process it differently
|
||||||
if ((t->type == T_CHAR) && (t->is_pointer == 1)) {
|
if ((t->type == T_CHAR) && (t->is_pointer == 1)) {
|
||||||
setf.add_local("char","*_a");
|
setf.add_local((char*)"char",(char*)"*_a");
|
||||||
setf.code << tab4 << "_a = (char *) SvPV(sv,PL_na);\n";
|
setf.code << tab4 << "_a = (char *) SvPV(sv,PL_na);\n";
|
||||||
|
|
||||||
if (CPlusPlus)
|
if (CPlusPlus)
|
||||||
|
|
@ -1175,8 +1175,8 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
} else {
|
} else {
|
||||||
// Set the value of a pointer
|
// Set the value of a pointer
|
||||||
|
|
||||||
setf.add_local("void","*_temp");
|
setf.add_local((char*)"void",(char*)"*_temp");
|
||||||
get_pointer(iname,"value","sv","_temp", t, setf.code, "return(1)");
|
get_pointer(iname,(char*)"value",(char*)"sv",(char*)"_temp", t, setf.code, (char*)"return(1)");
|
||||||
setf.code << tab4 << name << " = " << t->print_cast() << " _temp;\n";
|
setf.code << tab4 << name << " = " << t->print_cast() << " _temp;\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1197,9 +1197,9 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
|
|
||||||
// Check for a typemap
|
// Check for a typemap
|
||||||
|
|
||||||
if ((tm = typemap_lookup("varout","perl5",t,"",name, "sv"))) {
|
if ((tm = typemap_lookup((char*)"varout",(char*)"perl5",t,(char*)"",name, (char*)"sv"))) {
|
||||||
getf.code << tm << "\n";
|
getf.code << tm << "\n";
|
||||||
} else if ((tm = typemap_lookup("out","perl5",t,"",name,"sv"))) {
|
} else if ((tm = typemap_lookup((char*)"out",(char*)"perl5",t,(char*)"",name,(char*)"sv"))) {
|
||||||
setf.code << tm << "\n";
|
setf.code << tm << "\n";
|
||||||
} else {
|
} else {
|
||||||
if (!t->is_pointer) {
|
if (!t->is_pointer) {
|
||||||
|
|
@ -1217,7 +1217,7 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
vinit << tab4 << "sv_setnv(sv,(double)" << name << ");\n";
|
vinit << tab4 << "sv_setnv(sv,(double)" << name << ");\n";
|
||||||
break;
|
break;
|
||||||
case T_CHAR :
|
case T_CHAR :
|
||||||
getf.add_local("char","_ptemp[2]");
|
getf.add_local((char*)"char",(char*)"_ptemp[2]");
|
||||||
getf.code << tab4 << "_ptemp[0] = " << name << ";\n"
|
getf.code << tab4 << "_ptemp[0] = " << name << ";\n"
|
||||||
<< tab4 << "_ptemp[1] = 0;\n"
|
<< tab4 << "_ptemp[1] = 0;\n"
|
||||||
<< tab4 << "sv_setpv((SV*) sv, _ptemp);\n";
|
<< tab4 << "sv_setpv((SV*) sv, _ptemp);\n";
|
||||||
|
|
@ -1230,7 +1230,7 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
// getf.code << tab4 << "sv_setref_pv((SV*) sv,\"" << t->print_mangle()
|
// getf.code << tab4 << "sv_setref_pv((SV*) sv,\"" << t->print_mangle()
|
||||||
// << "\", (void *) &" << name << ");\n";
|
// << "\", (void *) &" << name << ");\n";
|
||||||
|
|
||||||
getf.add_local("SV","*rsv");
|
getf.add_local((char*)"SV",(char*)"*rsv");
|
||||||
vinit << tab4 << "sv_setref_pv(sv,\"" << t->print_mangle() << "\",(void *) &" << name << ");\n";
|
vinit << tab4 << "sv_setref_pv(sv,\"" << t->print_mangle() << "\",(void *) &" << name << ");\n";
|
||||||
t->is_pointer--;
|
t->is_pointer--;
|
||||||
|
|
||||||
|
|
@ -1247,7 +1247,7 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
||||||
else {
|
else {
|
||||||
getf.code << tab4 << "rsv = SvRV(sv);\n"
|
getf.code << tab4 << "rsv = SvRV(sv);\n"
|
||||||
<< tab4 << "sv_setiv(rsv,(IV) " << name << ");\n";
|
<< tab4 << "sv_setiv(rsv,(IV) " << name << ");\n";
|
||||||
getf.add_local("SV","*rsv");
|
getf.add_local((char*)"SV",(char*)"*rsv");
|
||||||
vinit << tab4 << "sv_setref_pv(sv,\"" << t->print_mangle() << "\",(void *) 1);\n";
|
vinit << tab4 << "sv_setref_pv(sv,\"" << t->print_mangle() << "\",(void *) 1);\n";
|
||||||
|
|
||||||
//getf.code << tab4 << "sv_setref_pv((SV*) sv,\"" << t->print_mangle()
|
//getf.code << tab4 << "sv_setref_pv((SV*) sv,\"" << t->print_mangle()
|
||||||
|
|
@ -1359,7 +1359,7 @@ PERL5::declare_const(char *name, char *, DataType *type, char *value)
|
||||||
static int have_char_func = 0;
|
static int have_char_func = 0;
|
||||||
static int have_ref_func = 0;
|
static int have_ref_func = 0;
|
||||||
|
|
||||||
if ((tm = typemap_lookup("const","perl5",type,name,value,name))) {
|
if ((tm = typemap_lookup((char*)"const",(char*)"perl5",type,name,value,name))) {
|
||||||
fprintf(f_init,"%s\n",tm);
|
fprintf(f_init,"%s\n",tm);
|
||||||
} else {
|
} else {
|
||||||
if ((type->type == T_USER) && (!type->is_pointer)) {
|
if ((type->type == T_USER) && (!type->is_pointer)) {
|
||||||
|
|
@ -1706,7 +1706,7 @@ void PERL5::cpp_close_class() {
|
||||||
// Output a FETCH method. This is actually common to all classes
|
// Output a FETCH method. This is actually common to all classes
|
||||||
pm << "sub FETCH {\n"
|
pm << "sub FETCH {\n"
|
||||||
<< tab4 << "my ($self,$field) = @_;\n"
|
<< tab4 << "my ($self,$field) = @_;\n"
|
||||||
<< tab4 << "my $member_func = \"" << package << "::" << name_get(name_member("${field}",class_name,AS_IS),AS_IS) << "\";\n"
|
<< tab4 << "my $member_func = \"" << package << "::" << name_get(name_member((char*)"${field}",class_name,AS_IS),AS_IS) << "\";\n"
|
||||||
<< tab4 << "my $val = &$member_func($self);\n"
|
<< tab4 << "my $val = &$member_func($self);\n"
|
||||||
<< tab4 << "if (exists $BLESSEDMEMBERS{$field}) {\n"
|
<< tab4 << "if (exists $BLESSEDMEMBERS{$field}) {\n"
|
||||||
<< tab8 << "return undef if (!defined($val));\n"
|
<< tab8 << "return undef if (!defined($val));\n"
|
||||||
|
|
@ -1721,7 +1721,7 @@ void PERL5::cpp_close_class() {
|
||||||
|
|
||||||
pm << "sub STORE {\n"
|
pm << "sub STORE {\n"
|
||||||
<< tab4 << "my ($self,$field,$newval) = @_;\n"
|
<< tab4 << "my ($self,$field,$newval) = @_;\n"
|
||||||
<< tab4 << "my $member_func = \"" << package << "::" << name_set(name_member("${field}",class_name,AS_IS),AS_IS) << "\";\n"
|
<< tab4 << "my $member_func = \"" << package << "::" << name_set(name_member((char*)"${field}",class_name,AS_IS),AS_IS) << "\";\n"
|
||||||
<< tab4 << "if (exists $BLESSEDMEMBERS{$field}) {\n"
|
<< tab4 << "if (exists $BLESSEDMEMBERS{$field}) {\n"
|
||||||
<< tab8 << "&$member_func($self,tied(%{$newval}));\n"
|
<< tab8 << "&$member_func($self,tied(%{$newval}));\n"
|
||||||
<< tab4 << "} else {\n"
|
<< tab4 << "} else {\n"
|
||||||
|
|
@ -1813,7 +1813,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
String sourceNtarget;
|
String sourceNtarget;
|
||||||
sourceNtarget << "$args[" << i << "]";
|
sourceNtarget << "$args[" << i << "]";
|
||||||
|
|
||||||
if ((tm = typemap_lookup("perl5in","perl5",p->t,"",sourceNtarget,sourceNtarget)))
|
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget,sourceNtarget)))
|
||||||
func << tm << "\n";
|
func << tm << "\n";
|
||||||
// Look up the datatype name here
|
// Look up the datatype name here
|
||||||
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
||||||
|
|
@ -1842,7 +1842,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
||||||
// implicit malloc/new. We'll mark the object like it was created
|
// implicit malloc/new. We'll mark the object like it was created
|
||||||
// in Perl so we can garbage collect it.
|
// in Perl so we can garbage collect it.
|
||||||
|
|
||||||
if ((tm = typemap_lookup("perl5out","perl5",t,"",name,"sv"))) {
|
if ((tm = typemap_lookup((char*)"perl5out",(char*)"perl5",t,(char*)"",name,(char*)"sv"))) {
|
||||||
func << tm << "\n"
|
func << tm << "\n"
|
||||||
<< tab4 <<"return $result;\n"
|
<< tab4 <<"return $result;\n"
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public :
|
||||||
PERL5() {
|
PERL5() {
|
||||||
package = 0;
|
package = 0;
|
||||||
module = 0;
|
module = 0;
|
||||||
perl_path = "perl5";
|
perl_path = (char*)"perl5";
|
||||||
is_static = 0;
|
is_static = 0;
|
||||||
blessed = 0;
|
blessed = 0;
|
||||||
hidden = 0;
|
hidden = 0;
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,9 @@ protected:
|
||||||
public :
|
public :
|
||||||
PYTHON() {
|
PYTHON() {
|
||||||
module = (char *) 0;
|
module = (char *) 0;
|
||||||
path = "python"; // Set this to subdirectory where language
|
path = (char*)"python"; // Set this to subdirectory where language
|
||||||
// Dependent library files will be stored
|
// Dependent library files will be stored
|
||||||
global_name = "cvar";
|
global_name = (char*)"cvar";
|
||||||
shadow = 0;
|
shadow = 0;
|
||||||
have_defarg = 0;
|
have_defarg = 0;
|
||||||
import_file = 0;
|
import_file = 0;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ static char cvsroot[] = "$Header$";
|
||||||
#define SWIG_LANG PYTHON
|
#define SWIG_LANG PYTHON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *usage = "\
|
static char *usage = (char*)"\
|
||||||
swig <options> filename\n\n\
|
swig <options> filename\n\n\
|
||||||
Target Language Options:\n\
|
Target Language Options:\n\
|
||||||
-tcl - Generate Tcl wrappers.\n\
|
-tcl - Generate Tcl wrappers.\n\
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ static char cvsroot[] = "$Header$";
|
||||||
#include "tcl8.h"
|
#include "tcl8.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
static char *Tcl_config="swigtcl.swg";
|
static char *Tcl_config=(char*)"swigtcl.swg";
|
||||||
static char *usage = "\
|
static char *usage = (char*)"\
|
||||||
Tcl 8.0 Options (available with -tcl)\n\
|
Tcl 8.0 Options (available with -tcl)\n\
|
||||||
-module name - Set name of module\n\
|
-module name - Set name of module\n\
|
||||||
-prefix name - Set a prefix to be appended to all names\n\
|
-prefix name - Set a prefix to be appended to all names\n\
|
||||||
|
|
@ -101,7 +101,7 @@ void TCL8::parse_args(int argc, char *argv[]) {
|
||||||
prefix[strlen(prefix)] = '_';
|
prefix[strlen(prefix)] = '_';
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
prefix = "";
|
prefix = (char*)"";
|
||||||
|
|
||||||
// Create a symbol SWIGTCL
|
// Create a symbol SWIGTCL
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ void TCL8::parse_args(int argc, char *argv[]) {
|
||||||
|
|
||||||
// Set name of typemaps
|
// Set name of typemaps
|
||||||
|
|
||||||
typemap_lang = "tcl8";
|
typemap_lang = (char*)"tcl8";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,7 +268,7 @@ void TCL8::initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(f_header,"#define SWIG_init %s\n", init_name);
|
fprintf(f_header,"#define SWIG_init %s\n", init_name);
|
||||||
if (!module) module = "swig";
|
if (!module) module = (char*)"swig";
|
||||||
fprintf(f_header,"#define SWIG_name \"%s\"\n", module);
|
fprintf(f_header,"#define SWIG_name \"%s\"\n", module);
|
||||||
if (nspace) {
|
if (nspace) {
|
||||||
fprintf(f_header,"#define SWIG_prefix \"%s::\"\n", ns_name);
|
fprintf(f_header,"#define SWIG_prefix \"%s::\"\n", ns_name);
|
||||||
|
|
@ -496,7 +496,7 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
argstr << "|";
|
argstr << "|";
|
||||||
// f.code << tab4 << "if (objc >" << j+1 << ") { \n";
|
// f.code << tab4 << "if (objc >" << j+1 << ") { \n";
|
||||||
|
|
||||||
if ((tm = typemap_lookup("in","tcl8",p->t,p->name,source,target,&f))) {
|
if ((tm = typemap_lookup((char*)"in",(char*)"tcl8",p->t,p->name,source,target,&f))) {
|
||||||
argstr << "o";
|
argstr << "o";
|
||||||
args << ",0";
|
args << ",0";
|
||||||
|
|
||||||
|
|
@ -524,7 +524,7 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
{
|
{
|
||||||
char tb[32];
|
char tb[32];
|
||||||
sprintf(tb,"tempb%d",i);
|
sprintf(tb,"tempb%d",i);
|
||||||
f.add_local("int",tb);
|
f.add_local((char*)"int",tb);
|
||||||
args << ",&" << tb;
|
args << ",&" << tb;
|
||||||
incode << tab4 << target << " = (bool) " << tb << ";\n";
|
incode << tab4 << target << " = (bool) " << tb << ";\n";
|
||||||
}
|
}
|
||||||
|
|
@ -599,13 +599,13 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
// Check to see if there is any sort of "build" typemap (highly complicated)
|
// Check to see if there is any sort of "build" typemap (highly complicated)
|
||||||
|
|
||||||
if ((tm = typemap_lookup("build","tcl8",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"build",(char*)"tcl8",p->t,p->name,source,target))) {
|
||||||
build << tm << "\n";
|
build << tm << "\n";
|
||||||
have_build = 1;
|
have_build = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if there was any sort of a constaint typemap
|
// Check to see if there was any sort of a constaint typemap
|
||||||
if ((tm = typemap_lookup("check","tcl8",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"check",(char*)"tcl8",p->t,p->name,source,target))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
incode << tm << "\n";
|
incode << tm << "\n";
|
||||||
incode.replace("$argnum",argnum);
|
incode.replace("$argnum",argnum);
|
||||||
|
|
@ -613,14 +613,14 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there was any cleanup code (save it for later)
|
// Check if there was any cleanup code (save it for later)
|
||||||
if ((tm = typemap_lookup("freearg","tcl8",p->t,p->name,target,"tcl_result"))) {
|
if ((tm = typemap_lookup((char*)"freearg",(char*)"tcl8",p->t,p->name,target,(char*)"tcl_result"))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
cleanup << tm << "\n";
|
cleanup << tm << "\n";
|
||||||
cleanup.replace("$argnum",argnum);
|
cleanup.replace("$argnum",argnum);
|
||||||
cleanup.replace("$arg",source);
|
cleanup.replace("$arg",source);
|
||||||
}
|
}
|
||||||
// Look for output arguments
|
// Look for output arguments
|
||||||
if ((tm = typemap_lookup("argout","tcl8",p->t,p->name,target,"tcl_result"))) {
|
if ((tm = typemap_lookup((char*)"argout",(char*)"tcl8",p->t,p->name,target,(char*)"tcl_result"))) {
|
||||||
outarg << tm << "\n";
|
outarg << tm << "\n";
|
||||||
outarg.replace("$argnum",argnum);
|
outarg.replace("$argnum",argnum);
|
||||||
outarg.replace("$arg",source);
|
outarg.replace("$arg",source);
|
||||||
|
|
@ -662,7 +662,7 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
// Return value if necessary
|
// Return value if necessary
|
||||||
|
|
||||||
if ((tm = typemap_lookup("out","tcl8",d,name,"_result","tcl_result"))) {
|
if ((tm = typemap_lookup((char*)"out",(char*)"tcl8",d,name,(char*)"_result",(char*)"tcl_result"))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
} else if ((d->type != T_VOID) || (d->is_pointer)) {
|
} else if ((d->type != T_VOID) || (d->is_pointer)) {
|
||||||
|
|
@ -743,12 +743,12 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
// Look for any remaining cleanup
|
// Look for any remaining cleanup
|
||||||
|
|
||||||
if (NewObject) {
|
if (NewObject) {
|
||||||
if ((tm = typemap_lookup("newfree","tcl8",d,iname,"_result",""))) {
|
if ((tm = typemap_lookup((char*)"newfree",(char*)"tcl8",d,iname,(char*)"_result",(char*)""))) {
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tm = typemap_lookup("ret","tcl8",d,name,"_result",""))) {
|
if ((tm = typemap_lookup((char*)"ret",(char*)"tcl8",d,name,(char*)"_result",(char*)""))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
f.code << tm << "\n";
|
f.code << tm << "\n";
|
||||||
}
|
}
|
||||||
|
|
@ -781,8 +781,8 @@ void TCL8::link_variable(char *name, char *iname, DataType *t)
|
||||||
|
|
||||||
// See if there were any typemaps
|
// See if there were any typemaps
|
||||||
|
|
||||||
tm = typemap_lookup("varin","tcl8",t,name,"","");
|
tm = typemap_lookup((char*)"varin",(char*)"tcl8",t,name,(char*)"",(char*)"");
|
||||||
tm1 = typemap_lookup("varout","tcl8",t,name,"","");
|
tm1 = typemap_lookup((char*)"varout",(char*)"tcl8",t,name,(char*)"",(char*)"");
|
||||||
if (tm || tm1) {
|
if (tm || tm1) {
|
||||||
fprintf(stderr,"%s : Line %d. Warning. varin/varout typemap methods not supported.",
|
fprintf(stderr,"%s : Line %d. Warning. varin/varout typemap methods not supported.",
|
||||||
input_file, line_number);
|
input_file, line_number);
|
||||||
|
|
@ -796,13 +796,13 @@ void TCL8::link_variable(char *name, char *iname, DataType *t)
|
||||||
set.def << "static char *_swig_" << t->print_mangle() << "_set(ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags) {";
|
set.def << "static char *_swig_" << t->print_mangle() << "_set(ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags) {";
|
||||||
get.def << "static char *_swig_" << t->print_mangle() << "_get(ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags) {";
|
get.def << "static char *_swig_" << t->print_mangle() << "_get(ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags) {";
|
||||||
t->is_pointer++;
|
t->is_pointer++;
|
||||||
get.add_local(t->print_type(),"addr");
|
get.add_local(t->print_type(),(char*)"addr");
|
||||||
set.add_local(t->print_type(),"addr");
|
set.add_local(t->print_type(),(char*)"addr");
|
||||||
set.code << tab4 << "addr = " << t->print_cast() << " clientData;\n";
|
set.code << tab4 << "addr = " << t->print_cast() << " clientData;\n";
|
||||||
get.code << tab4 << "addr = " << t->print_cast() << " clientData;\n";
|
get.code << tab4 << "addr = " << t->print_cast() << " clientData;\n";
|
||||||
t->is_pointer--;
|
t->is_pointer--;
|
||||||
set.add_local("char *","value");
|
set.add_local((char*)"char *",(char*)"value");
|
||||||
get.add_local("Tcl_Obj *","value");
|
get.add_local((char*)"Tcl_Obj *",(char*)"value");
|
||||||
|
|
||||||
set.code << tab4 << "value = Tcl_GetVar2(interp, name1, name2, flags);\n"
|
set.code << tab4 << "value = Tcl_GetVar2(interp, name1, name2, flags);\n"
|
||||||
<< tab4 << "if (!value) return NULL;\n";
|
<< tab4 << "if (!value) return NULL;\n";
|
||||||
|
|
@ -887,27 +887,27 @@ void TCL8::link_variable(char *name, char *iname, DataType *t)
|
||||||
case T_UCHAR:
|
case T_UCHAR:
|
||||||
case T_SCHAR:
|
case T_SCHAR:
|
||||||
case T_BOOL:
|
case T_BOOL:
|
||||||
get.add_local("Tcl_Obj *","value");
|
get.add_local((char*)"Tcl_Obj *",(char*)"value");
|
||||||
get.code << tab4 << "value = Tcl_NewIntObj((int) *addr);\n"
|
get.code << tab4 << "value = Tcl_NewIntObj((int) *addr);\n"
|
||||||
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
||||||
<< tab4 << "Tcl_DecrRefCount(value);\n";
|
<< tab4 << "Tcl_DecrRefCount(value);\n";
|
||||||
break;
|
break;
|
||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
case T_DOUBLE:
|
case T_DOUBLE:
|
||||||
get.add_local("Tcl_Obj *","value");
|
get.add_local((char*)"Tcl_Obj *",(char*)"value");
|
||||||
get.code << tab4 << "value = Tcl_NewDoubleObj((double) *addr);\n"
|
get.code << tab4 << "value = Tcl_NewDoubleObj((double) *addr);\n"
|
||||||
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
||||||
<< tab4 << "Tcl_DecrRefCount(value);\n";
|
<< tab4 << "Tcl_DecrRefCount(value);\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_CHAR:
|
case T_CHAR:
|
||||||
get.add_local("char","temp[4]");
|
get.add_local((char*)"char",(char*)"temp[4]");
|
||||||
get.code << tab4 << "temp[0] = *addr; temp[1] = 0;\n"
|
get.code << tab4 << "temp[0] = *addr; temp[1] = 0;\n"
|
||||||
<< tab4 << "Tcl_SetVar2(interp,name1,name2,temp,flags);\n";
|
<< tab4 << "Tcl_SetVar2(interp,name1,name2,temp,flags);\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_USER:
|
case T_USER:
|
||||||
get.add_local("Tcl_Obj *","value");
|
get.add_local((char*)"Tcl_Obj *",(char*)"value");
|
||||||
t->is_pointer++;
|
t->is_pointer++;
|
||||||
t->remember();
|
t->remember();
|
||||||
get.code << tab4 << "value = SWIG_NewPointerObj(addr, SWIGTYPE" << t->print_mangle() << ");\n"
|
get.code << tab4 << "value = SWIG_NewPointerObj(addr, SWIGTYPE" << t->print_mangle() << ");\n"
|
||||||
|
|
@ -923,7 +923,7 @@ void TCL8::link_variable(char *name, char *iname, DataType *t)
|
||||||
if ((t->is_pointer == 1) && (t->type == T_CHAR)) {
|
if ((t->is_pointer == 1) && (t->type == T_CHAR)) {
|
||||||
get.code << tab4 << "Tcl_SetVar2(interp,name1,name2,*addr, flags);\n";
|
get.code << tab4 << "Tcl_SetVar2(interp,name1,name2,*addr, flags);\n";
|
||||||
} else {
|
} else {
|
||||||
get.add_local("Tcl_Obj *","value");
|
get.add_local((char*)"Tcl_Obj *",(char*)"value");
|
||||||
t->remember();
|
t->remember();
|
||||||
get.code << tab4 << "value = SWIG_NewPointerObj(*addr, SWIGTYPE" << t->print_mangle() << ");\n"
|
get.code << tab4 << "value = SWIG_NewPointerObj(*addr, SWIGTYPE" << t->print_mangle() << ");\n"
|
||||||
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
<< tab4 << "Tcl_SetVar2(interp,name1,name2,Tcl_GetStringFromObj(value,NULL), flags);\n"
|
||||||
|
|
@ -985,7 +985,7 @@ void TCL8::declare_const(char *name, char *, DataType *type, char *value) {
|
||||||
rvalue << "'";
|
rvalue << "'";
|
||||||
"'" >> rvalue;
|
"'" >> rvalue;
|
||||||
}
|
}
|
||||||
if ((tm = typemap_lookup("const","tcl8",type,name,rvalue.get(),name))) {
|
if ((tm = typemap_lookup((char*)"const",(char*)"tcl8",type,name,rvalue.get(),name))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
fprintf(f_init,"%s\n",tm);
|
fprintf(f_init,"%s\n",tm);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1133,7 +1133,7 @@ char * TCL8::usage_string(char *iname, DataType *, ParmList *l) {
|
||||||
|
|
||||||
// Only print an argument if not ignored
|
// Only print an argument if not ignored
|
||||||
|
|
||||||
if (!typemap_check("ignore","tcl8",p->t,p->name)) {
|
if (!typemap_check((char*)"ignore",(char*)"tcl8",p->t,p->name)) {
|
||||||
if (i >= (pcount-numopt))
|
if (i >= (pcount-numopt))
|
||||||
temp << "?";
|
temp << "?";
|
||||||
|
|
||||||
|
|
@ -1257,7 +1257,7 @@ void TCL8::cpp_open_class(char *classname, char *rename, char *ctype, int strip)
|
||||||
class_type = new char[strlen(ctype)+2];
|
class_type = new char[strlen(ctype)+2];
|
||||||
sprintf(class_type,"%s ", ctype);
|
sprintf(class_type,"%s ", ctype);
|
||||||
} else
|
} else
|
||||||
class_type = "";
|
class_type = (char*)"";
|
||||||
|
|
||||||
real_classname = copy_string(classname);
|
real_classname = copy_string(classname);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ public :
|
||||||
init_name = 0;
|
init_name = 0;
|
||||||
nspace = 0;
|
nspace = 0;
|
||||||
shadow = 1;
|
shadow = 1;
|
||||||
char_result = "TCL_VOLATILE";
|
char_result = (char*)"TCL_VOLATILE";
|
||||||
tcl_path = "tcl";
|
tcl_path = (char*)"tcl";
|
||||||
sprintf(interp_name,"interp");
|
sprintf(interp_name,"interp");
|
||||||
class_name = 0;
|
class_name = 0;
|
||||||
class_type = 0;
|
class_type = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue