a better fix for SYSBIOS-1453
diff --git a/src/packages/xdc/services/intern/gen/Config.java b/src/packages/xdc/services/intern/gen/Config.java
index e35d889..caa09aa 100644
--- a/src/packages/xdc/services/intern/gen/Config.java
+++ b/src/packages/xdc/services/intern/gen/Config.java
@@ -3687,8 +3687,8 @@
* The content of cast is (xdc_<type>), that's why we start match
* at the index 5.
*/
- if (value.indexOf("(") == -1) {
- if (cast.regionMatches(5, "UInt", 0, 4) ||
+ if (!(cast.isEmpty())) {
+ if (cast.regionMatches(5, "UInt", 0, 4) ||
cast.regionMatches(5, "Bits", 0, 4)) {
suffix = "U";
}
@@ -3699,6 +3699,24 @@
suffix = "ULL";
}
}
+
+ /* Value could be an expression enclosed in parentheses, or a
+ * rational number, and in these case we don't want a suffix.
+ */
+ if (value.indexOf("(") != -1 || value.indexOf(".") != -1) {
+ suffix = "";
+ }
+ if (value.toUpperCase().indexOf("0X") == 0) {
+ if (value.toUpperCase().indexOf("P") != -1) {
+ suffix = "";
+ }
+ }
+ else {
+ if (value.toUpperCase().indexOf("E") != -1) {
+ suffix = "";
+ }
+ }
+
return (cast + Proto.Elm.numval((Number)elm) + suffix);
}
else if (elm instanceof Boolean) {