simpler mangling method

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5791 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-03-23 01:47:54 +00:00
commit f958140af5

View file

@ -238,17 +238,10 @@ String *Swig_string_mangle(String *s) {
if (isalnum((int)c) || (c == '_')) {
state = 1;
if (space && (space == state)) {
Printf(result,"__b");
Printf(result,"_SS_");
}
space = 0;
if (c == '_' && *(pc + 1) == 'S' && *(pc + 2) == '_') {
/* '_S_' is use replaced because it is the special mangling symbol */
Printf(result,"_S_%02X",0);
pc += 3;
continue;
} else {
Printf(result,"%c",c);
}
Printf(result,"%c",c);
} else {
if (isspace((int)c)) {
@ -339,9 +332,9 @@ String *Swig_string_mangle(String *s) {
break;
}
if (isalpha((int)c)) {
Printf(result,"_S_%c",(int)c);
Printf(result,"_S%c_",(int)c);
} else{
Printf(result,"_S_%02X",(int)c);
Printf(result,"_S%02X_",(int)c);
}
}
++pc;