Grovelling with unsigned base types.
Mark Cox
markcox80 at gmail.com
Sun Sep 8 10:52:05 UTC 2013
G'day,
The attached patch ensures that the BASE-TYPE argument specified in CONSTANTENUM grovel forms has an affect on the format string passed to fprintf.
It appears CENUM should be fixed too. The patch does NOT fix that.
Thanks
Mark
diff --git a/grovel/grovel.lisp b/grovel/grovel.lisp
index a0c150c..1f97da6 100644
--- a/grovel/grovel.lisp
+++ b/grovel/grovel.lisp
@@ -634,7 +634,9 @@ int main(int argc, char**argv) {
(check-type c-name string)
(format out "~&#ifdef ~A~%" c-name)
(c-format out " ")
- (c-printf out "%i" c-name)
+ (format out "~& fprintf(output, ~A, ~A);~%"
+ (foreign-type-to-printf-specification (or base-type :int))
+ c-name)
(format out "~&#else~%"))
(unless optional
(c-format out
More information about the cffi-devel
mailing list