summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.current4
-rw-r--r--Source/Modules/cffi.cxx12
2 files changed, 12 insertions, 4 deletions
diff --git a/CHANGES.current b/CHANGES.current
index b1107dada..a1e1e1a62 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.9 (in progress)
===========================
+
+2012-12-13: wsfulton
+ [CFFI] Fix #3529690 - Fix incorrect constant names.
+
2012-12-12: drjoe
[R] add fix to finalizer that was missed earlier
diff --git a/Source/Modules/cffi.cxx b/Source/Modules/cffi.cxx
index c2c79b007..d3f0391d0 100644
--- a/Source/Modules/cffi.cxx
+++ b/Source/Modules/cffi.cxx
@@ -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) {