Eliminated annoying C++ warnings for Workshop 5.0 compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@474 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
eab650bbca
commit
ae725e9727
3 changed files with 32 additions and 32 deletions
|
|
@ -1617,7 +1617,7 @@ void cplus_emit_member_func(char *classname, char *classtype, char *classrename,
|
|||
p->call_type = 0;
|
||||
|
||||
sprintf(p->t->name,"%s%s", classtype,classname);
|
||||
p->name = "self";
|
||||
p->name = (char*)"self";
|
||||
newparms->insert(p,0); // Attach parameter to beginning of list
|
||||
|
||||
// Now wrap the thing. The name of the function is iname
|
||||
|
|
@ -1903,7 +1903,7 @@ void cplus_emit_destructor(char *classname, char *classtype, char *classrename,
|
|||
p->t->id = cpp_id;
|
||||
p->call_type = 0;
|
||||
sprintf(p->t->name,"%s%s", classtype, classname);
|
||||
p->name = "self";
|
||||
p->name = (char*)"self";
|
||||
l->insert(p,0);
|
||||
|
||||
type = new DataType;
|
||||
|
|
@ -2162,7 +2162,7 @@ void cplus_emit_variable_get(char *classname, char *classtype, char *classrename
|
|||
|
||||
// Now write a function to get the value of the variable
|
||||
|
||||
tm = typemap_lookup("memberout",typemap_lang,type,mname,source,"result");
|
||||
tm = typemap_lookup((char*)"memberout",typemap_lang,type,mname,source,(char*)"result");
|
||||
|
||||
if ((type->type == T_USER) && (!type->is_pointer)) {
|
||||
type->is_pointer++;
|
||||
|
|
@ -2206,7 +2206,7 @@ void cplus_emit_variable_get(char *classname, char *classtype, char *classrename
|
|||
p->t->is_pointer = 1;
|
||||
p->t->id = cpp_id;
|
||||
p->call_type = 0;
|
||||
p->name = "self";
|
||||
p->name = (char*)"self";
|
||||
sprintf(p->t->name,"%s%s", classtype,classname);
|
||||
l->insert(p,0);
|
||||
|
||||
|
|
@ -2338,7 +2338,7 @@ void cplus_emit_variable_set(char *classname, char *classtype, char *classrename
|
|||
target << "obj->" << mname;
|
||||
|
||||
// Lookup any typemaps that might exist
|
||||
tm = typemap_lookup("memberin",typemap_lang,type,mname,"val",target);
|
||||
tm = typemap_lookup((char*)"memberin",typemap_lang,type,mname,(char*)"val",target);
|
||||
|
||||
// First write a function to set the variable
|
||||
|
||||
|
|
@ -2348,7 +2348,7 @@ void cplus_emit_variable_set(char *classname, char *classtype, char *classrename
|
|||
is_user = 1;
|
||||
}
|
||||
wrap << "static " << type->print_type() << " " << cname << "("
|
||||
<< classtype << classname << " *obj, " << type->print_real("val") << ") {\n";
|
||||
<< classtype << classname << " *obj, " << type->print_real((char*)"val") << ") {\n";
|
||||
if (is_user) {
|
||||
type->is_pointer--;
|
||||
}
|
||||
|
|
@ -2380,7 +2380,7 @@ void cplus_emit_variable_set(char *classname, char *classtype, char *classrename
|
|||
if ((type->type == T_CHAR) && (type->is_pointer == 1)) {
|
||||
String temp;
|
||||
wrap << "static " << type->print_type() << " " << cname << "("
|
||||
<< classtype << classname << " *obj, " << type->print_real("val") << ") {\n";
|
||||
<< classtype << classname << " *obj, " << type->print_real((char*)"val") << ") {\n";
|
||||
temp << "obj->" << mname;
|
||||
if (CPlusPlus) {
|
||||
wrap << tab4 << "if (" << temp << ") delete [] " << temp << ";\n"
|
||||
|
|
@ -2428,7 +2428,7 @@ void cplus_emit_variable_set(char *classname, char *classtype, char *classrename
|
|||
p->t->is_pointer = 1;
|
||||
p->t->id = cpp_id;
|
||||
sprintf(p->t->name,"%s%s", classtype,classname);
|
||||
p->name = "self";
|
||||
p->name = (char*)"self";
|
||||
l->insert(p,0);
|
||||
|
||||
if ((type->type == T_USER) && (!type->is_pointer)) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void emit_extern_var(char *decl, DataType *t, int extern_type, FILE *f) {
|
|||
char *arr = 0;
|
||||
|
||||
if (t->arraystr) arr = t->arraystr;
|
||||
else arr = "";
|
||||
else arr = (char*)"";
|
||||
|
||||
switch(extern_type) {
|
||||
|
||||
|
|
@ -230,13 +230,13 @@ int emit_args(DataType *rt, ParmList *l, WrapperFunction &f) {
|
|||
|
||||
// Special case for return by "value"
|
||||
rt->is_pointer++;
|
||||
f.add_local(rt->print_type(), "_result");
|
||||
f.add_local(rt->print_type(), (char*)"_result");
|
||||
rt->is_pointer--;
|
||||
} else {
|
||||
|
||||
// Normal return value
|
||||
|
||||
f.add_local(rt->print_type(), "_result");
|
||||
f.add_local(rt->print_type(), (char*)"_result");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -261,21 +261,21 @@ int emit_args(DataType *rt, ParmList *l, WrapperFunction &f) {
|
|||
dv = deftmp.get();
|
||||
}
|
||||
f.add_local(p->t->print_type(), temp, dv);
|
||||
tm = typemap_lookup("arginit", typemap_lang, p->t,p->name,"",temp,&f);
|
||||
tm = typemap_lookup((char*)"arginit", typemap_lang, p->t,p->name,(char*)"",temp,&f);
|
||||
if (tm) {
|
||||
f.code << tm << "\n";
|
||||
}
|
||||
}
|
||||
// Check for ignore or default typemaps
|
||||
tm = typemap_lookup("default",typemap_lang,p->t,p->name,"",temp,&f);
|
||||
tm = typemap_lookup((char*)"default",typemap_lang,p->t,p->name,(char*)"",temp,&f);
|
||||
if (tm)
|
||||
f.code << tm << "\n";
|
||||
tm = typemap_lookup("ignore",typemap_lang,p->t,p->name,"",temp,&f);
|
||||
tm = typemap_lookup((char*)"ignore",typemap_lang,p->t,p->name,(char*)"",temp,&f);
|
||||
if (tm) {
|
||||
f.code << tm << "\n";
|
||||
p->ignore = 1;
|
||||
}
|
||||
tm = typemap_check("build",typemap_lang,p->t,p->name);
|
||||
tm = typemap_check((char*)"build",typemap_lang,p->t,p->name);
|
||||
if (tm) {
|
||||
p->ignore = 1;
|
||||
}
|
||||
|
|
@ -379,13 +379,13 @@ void emit_func_call(char *decl, DataType *t, ParmList *l, WrapperFunction &f) {
|
|||
}
|
||||
// Check for exception handling
|
||||
|
||||
if ((tm = typemap_lookup("except",typemap_lang,t,decl,"_result",""))) {
|
||||
if ((tm = typemap_lookup((char*)"except",typemap_lang,t,decl,(char*)"_result",(char*)""))) {
|
||||
// Found a type-specific mapping
|
||||
exc << tm;
|
||||
exc.replace("$function",fcall);
|
||||
exc.replace("$name",decl);
|
||||
f.code << exc;
|
||||
} else if ((tm = fragment_lookup("except",typemap_lang, t->id))) {
|
||||
} else if ((tm = fragment_lookup((char*)"except",typemap_lang, t->id))) {
|
||||
exc << tm;
|
||||
exc.replace("$function",fcall);
|
||||
exc.replace("$name",decl);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ void typemap_apply(DataType *tm_type, char *tm_name, DataType *type, char *pname
|
|||
char temp[512];
|
||||
|
||||
// Form the application name
|
||||
if (!pname) pname = "";
|
||||
if (!pname) pname = (char*)"";
|
||||
sprintf(temp,"%s$%s",type->print_type(),pname);
|
||||
|
||||
// See if there is a method already defined
|
||||
|
|
@ -217,7 +217,7 @@ void typemap_apply(DataType *tm_type, char *tm_name, DataType *type, char *pname
|
|||
|
||||
void typemap_clear_apply(DataType *type, char *pname) {
|
||||
char temp[512];
|
||||
if (!pname) pname = "";
|
||||
if (!pname) pname = (char*)"";
|
||||
sprintf(temp,"%s$%s", type->print_type(), pname);
|
||||
application_hash.remove(temp);
|
||||
}
|
||||
|
|
@ -370,7 +370,7 @@ void typemap_register_default(char *op, char *lang, int type, int ptr, char *arr
|
|||
|
||||
// Now, go register this as a default type
|
||||
|
||||
typemap_register(op,lang,t,"SWIG_DEFAULT_TYPE",code,args);
|
||||
typemap_register(op,lang,t,(char*)"SWIG_DEFAULT_TYPE",code,args);
|
||||
delete t;
|
||||
}
|
||||
|
||||
|
|
@ -423,7 +423,7 @@ TypeMap *typemap_search_array(char *op, char *lang, DataType *type, char *pname,
|
|||
|
||||
// Check for unnamed array of specific dimensions
|
||||
if (!tm) {
|
||||
key = typemap_string(lang,type,"",type->arraystr,op);
|
||||
key = typemap_string(lang,type,(char*)"",type->arraystr,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ TypeMap *typemap_search_array(char *op, char *lang, DataType *type, char *pname,
|
|||
key = typemap_string(lang,type,pname,type->arraystr,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
if (!tm) {
|
||||
key = typemap_string(lang,type,"",type->arraystr,op);
|
||||
key = typemap_string(lang,type,(char*)"",type->arraystr,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
}
|
||||
type->arraystr = origarr;
|
||||
|
|
@ -605,7 +605,7 @@ char *typemap_lookup_internal(char *op, char *lang, DataType *type, char *pname,
|
|||
|
||||
// Check for unnamed type
|
||||
if (!tm) {
|
||||
key = typemap_string(lang,type,"",0,op);
|
||||
key = typemap_string(lang,type,(char*)"",0,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
if (tm)
|
||||
str << tm->code;
|
||||
|
|
@ -646,7 +646,7 @@ char *typemap_lookup_internal(char *op, char *lang, DataType *type, char *pname,
|
|||
|
||||
// If there were locals and no wrapper function, print a warning
|
||||
if ((tm->args) && !f) {
|
||||
if (!pname) pname = "";
|
||||
if (!pname) pname = (char*)"";
|
||||
fprintf(stderr,"%s:%d: Warning. '%%typemap(%s,%s) %s %s' being applied with ignored locals.\n",
|
||||
input_file, line_number, lang,op, type->print_type(), pname);
|
||||
}
|
||||
|
|
@ -681,7 +681,7 @@ char *typemap_lookup(char *op, char *lang, DataType *type, char *pname, char *so
|
|||
if ((!result) && (pname)) {
|
||||
int drop_pointer = 0;
|
||||
ppname = pname;
|
||||
if (!ppname) ppname = "";
|
||||
if (!ppname) ppname = (char*)"";
|
||||
|
||||
// The idea : We're going to cycle through applications and
|
||||
// drop pointers off until we get a match.
|
||||
|
|
@ -748,7 +748,7 @@ char *typemap_lookup(char *op, char *lang, DataType *type, char *pname, char *so
|
|||
if (!result) {
|
||||
DataType *t = new DataType(type);
|
||||
t->primitive(); // Knock it down to its basic type
|
||||
result = typemap_lookup_internal(op,lang,t,"SWIG_DEFAULT_TYPE",source,target,f);
|
||||
result = typemap_lookup_internal(op,lang,t,(char*)"SWIG_DEFAULT_TYPE",source,target,f);
|
||||
if (result) {
|
||||
delete t;
|
||||
return result;
|
||||
|
|
@ -762,7 +762,7 @@ char *typemap_lookup(char *op, char *lang, DataType *type, char *pname, char *so
|
|||
if (t->arraystr) delete [] t->arraystr;
|
||||
t->arraystr = 0;
|
||||
t->primitive();
|
||||
result = typemap_lookup_internal(op,lang,t,"SWIG_DEFAULT_TYPE",source,target,f);
|
||||
result = typemap_lookup_internal(op,lang,t,(char*)"SWIG_DEFAULT_TYPE",source,target,f);
|
||||
}
|
||||
delete t;
|
||||
}
|
||||
|
|
@ -803,13 +803,13 @@ char *typemap_check_internal(char *op, char *lang, DataType *type, char *pname)
|
|||
|
||||
// Check for unnamed array
|
||||
if ((!tm) && (type->arraystr)) {
|
||||
key = typemap_string(lang,type,"",type->arraystr,op);
|
||||
key = typemap_string(lang,type,(char*)"",type->arraystr,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
}
|
||||
|
||||
// Check for unname type
|
||||
if (!tm) {
|
||||
key = typemap_string(lang,type,"",0,op);
|
||||
key = typemap_string(lang,type,(char*)"",0,op);
|
||||
tm = typemap_search(key,type->id);
|
||||
}
|
||||
if (!tm) return 0;
|
||||
|
|
@ -837,7 +837,7 @@ char *typemap_check(char *op, char *lang, DataType *type, char *pname) {
|
|||
if (!result) {
|
||||
int drop_pointer = 0;
|
||||
ppname = pname;
|
||||
if (!ppname) ppname = "";
|
||||
if (!ppname) ppname = (char*)"";
|
||||
|
||||
// The idea : We're going to cycle through applications and
|
||||
// drop pointers off until we get a match.
|
||||
|
|
@ -900,7 +900,7 @@ char *typemap_check(char *op, char *lang, DataType *type, char *pname) {
|
|||
if (!result) {
|
||||
DataType *t = new DataType(type);
|
||||
t->primitive(); // Knock it down to its basic type
|
||||
result = typemap_check_internal(op,lang,t,"SWIG_DEFAULT_TYPE");
|
||||
result = typemap_check_internal(op,lang,t,(char*)"SWIG_DEFAULT_TYPE");
|
||||
if (result) {
|
||||
delete t;
|
||||
return result;
|
||||
|
|
@ -913,7 +913,7 @@ char *typemap_check(char *op, char *lang, DataType *type, char *pname) {
|
|||
if (t->arraystr) delete [] t->arraystr;
|
||||
t->arraystr = 0;
|
||||
t->primitive();
|
||||
result = typemap_check_internal(op,lang,t,"SWIG_DEFAULT_TYPE");
|
||||
result = typemap_check_internal(op,lang,t,(char*)"SWIG_DEFAULT_TYPE");
|
||||
}
|
||||
delete t;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue