fixed memory freeing bug, removed tabs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9878 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c70e98d185
commit
3aaa08c856
1 changed files with 59 additions and 55 deletions
|
|
@ -995,13 +995,15 @@ String *CFFI::convert_literal(String *literal, String *type, bool try_to_split)
|
||||||
return num;
|
return num;
|
||||||
} else if (SwigType_type(type) == T_CHAR) {
|
} else if (SwigType_type(type) == T_CHAR) {
|
||||||
/* Use CL syntax for character literals */
|
/* Use CL syntax for character literals */
|
||||||
|
String* result = NewStringf("#\\%c", s[2]);
|
||||||
Delete(num);
|
Delete(num);
|
||||||
// Printf(stderr, "%s %c %d", s, s[2], s);
|
// Printf(stderr, "%s %c %d", s, s[2], s);
|
||||||
return NewStringf("#\\%c", s[2]);
|
return result;
|
||||||
} else if (SwigType_type(type) == T_STRING) {
|
} else if (SwigType_type(type) == T_STRING) {
|
||||||
/* Use CL syntax for string literals */
|
/* Use CL syntax for string literals */
|
||||||
|
String* result = NewStringf("\"%s\"", num_param);
|
||||||
Delete(num);
|
Delete(num);
|
||||||
return NewStringf("\"%s\"", num_param);
|
return result;
|
||||||
} else if (SwigType_type(type) == T_INT || SwigType_type(type) == T_UINT) {
|
} else if (SwigType_type(type) == T_INT || SwigType_type(type) == T_UINT) {
|
||||||
// Printf(stderr, "Is a T_INT or T_UINT %s, before replaceall\n", s);
|
// Printf(stderr, "Is a T_INT or T_UINT %s, before replaceall\n", s);
|
||||||
Replaceall(num, "u", "");
|
Replaceall(num, "u", "");
|
||||||
|
|
@ -1011,11 +1013,13 @@ String *CFFI::convert_literal(String *literal, String *type, bool try_to_split)
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
if (sscanf(s, "%d >> %d", &i, &j) == 2) {
|
if (sscanf(s, "%d >> %d", &i, &j) == 2) {
|
||||||
|
String* result = NewStringf("(cl:ash %d -%d)", i, j);
|
||||||
Delete(num);
|
Delete(num);
|
||||||
return NewStringf("(cl:ash %d -%d)", i, j);
|
return result;
|
||||||
} else if (sscanf(s, "%d << %d", &i, &j) == 2) {
|
} else if (sscanf(s, "%d << %d", &i, &j) == 2) {
|
||||||
|
String* result = NewStringf("(cl:ash %d %d)", i, j);
|
||||||
Delete(num);
|
Delete(num);
|
||||||
return NewStringf("(cl:ash %d %d)", i, j);
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue