Hi Neil, Unfortunately the current printf() family does not support the long long type as far as I'm concerned.
The attached patch does add this support. -- $ cat ~/.signature Freddy Spierenburg <[email protected]> http://freddy.snarl.nl/ GnuPG: 0x7941D1E1=C948 5851 26D2 FA5C 39F1 E588 6F17 FD5D 7941 D1E1 $ # Please read http://www.ietf.org/rfc/rfc2015.txt before complain!
diff -Naur msp430-libc-20071026-orig/mspgcc-libc/src/stdlib/vuprintf.c msp430-libc-20071026/mspgcc-libc/src/stdlib/vuprintf.c
--- msp430-libc-20071026-orig/mspgcc-libc/src/stdlib/vuprintf.c 2007-10-26 22:33:50.000000000 +0000
+++ msp430-libc-20071026/mspgcc-libc/src/stdlib/vuprintf.c 2008-04-24 15:04:42.000000000 +0000
@@ -155,6 +155,7 @@
#define LADJUST 0x10 /* left adjustment */
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */
+#define LONGLONGINT 0x80 /* long long integer */
int vuprintf(int (*func)(int), const char *fmt0, va_list ap)
@@ -216,7 +217,14 @@
{
if (flags&LONGINT)
{
- _ulong=va_arg(ap, unsigned long);
+ if (flags&LONGLONGINT)
+ {
+ _ulong=va_arg(ap, unsigned long long);
+ }
+ else
+ {
+ _ulong=va_arg(ap, unsigned long);
+ }
}
else
{
@@ -312,7 +320,14 @@
}
else if (ch=='l')
{
- flags |= LONGINT;
+ if (flags & LONGINT)
+ {
+ flags |= LONGLONGINT;
+ }
+ else
+ {
+ flags |= LONGINT;
+ }
goto rflag;
}
else if (ch=='c')
@@ -327,7 +342,14 @@
flags |= LONGINT;
if (flags&LONGINT)
{
- _ulong=va_arg(ap, long);
+ if (flags&LONGLONGINT)
+ {
+ _ulong=va_arg(ap, long long);
+ }
+ else
+ {
+ _ulong=va_arg(ap, long);
+ }
}
else
{
signature.asc
Description: Digital signature
