Fix CFFI incorrect constant names

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13962 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-12-14 07:38:44 +00:00
commit 1ab67f5bed
2 changed files with 12 additions and 4 deletions

View file

@ -1031,10 +1031,14 @@ String *CFFI::convert_literal(String *literal, String *type, bool try_to_split)
return result;
} 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);
Replaceall(num, "u", "");
Replaceall(num, "U", "");
Replaceall(num, "l", "");
Replaceall(num, "L", "");
const char *num_start = Char(num);
bool is_literal = isdigit(*num_start) || (*num_start == '.') || (*num_start == '+') || (*num_start == '-');
if (is_literal) {
Replaceall(num, "u", "");
Replaceall(num, "U", "");
Replaceall(num, "l", "");
Replaceall(num, "L", "");
}
int i, j;
if (sscanf(s, "%d >> %d", &i, &j) == 2) {