[P4W-posixcvs] cygwin/newlib/libc/stdio sscanf.c,1.1.1.1,1.1.1.1.2.1 vfscanf.c,1.1.1.1.2.1,1.1.1.1.2
Status: Pre-Alpha
Brought to you by:
earnie
From: <ea...@us...> - 2003-04-18 20:28:18
|
Update of /cvsroot/p4w/cygwin/newlib/libc/stdio In directory sc8-pr-cvs1:/tmp/cvs-serv17902/newlib/libc/stdio Modified Files: Tag: p4wposix sscanf.c vfscanf.c Log Message: Sync with HEAD Index: sscanf.c =================================================================== RCS file: /cvsroot/p4w/cygwin/newlib/libc/stdio/sscanf.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** sscanf.c 20 Feb 2003 17:54:30 -0000 1.1.1.1 --- sscanf.c 18 Apr 2003 20:27:42 -0000 1.1.1.1.2.1 *************** *** 153,163 **** .Modifier Type(s) ! . h d, i, o, u, x convert input to short, . store in short object . . h D, I, O, U, X no effect ! . e, f, c, s, n, p . ! . l d, i, o, u, x convert input to long, . store in long object . --- 153,166 ---- .Modifier Type(s) ! . hh d, i, o, u, x, n convert input to char, ! . store in char object ! . ! . h d, i, o, u, x, n convert input to short, . store in short object . . h D, I, O, U, X no effect ! . e, f, c, s, p . ! . l d, i, o, u, x, n convert input to long, . store in long object . *************** *** 166,172 **** . . l D, I, O, U, X no effect ! . c, s, n, p . ! . L d, i, o, u, x convert to long double, . store in long double . --- 169,181 ---- . . l D, I, O, U, X no effect ! . c, s, p . ! . ll d, i, o, u, x, n convert to long long, ! . store in long long ! . ! . L d, i, o, u, x, n convert to long long, ! . store in long long ! . ! . L e, f, g, E, G convert to long double, . store in long double . Index: vfscanf.c =================================================================== RCS file: /cvsroot/p4w/cygwin/newlib/libc/stdio/vfscanf.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** vfscanf.c 21 Mar 2003 18:56:11 -0000 1.1.1.1.2.1 --- vfscanf.c 18 Apr 2003 20:27:44 -0000 1.1.1.1.2.2 *************** *** 152,160 **** #define LONG 0x01 /* l: long or double */ ! #define LONGDBL 0x02 /* L: long double or long long */ #define SHORT 0x04 /* h: short */ ! #define SUPPRESS 0x08 /* suppress assignment */ ! #define POINTER 0x10 /* weird %p pointer (`fake hex') */ ! #define NOSKIP 0x20 /* do not skip blanks */ /* --- 152,161 ---- #define LONG 0x01 /* l: long or double */ ! #define LONGDBL 0x02 /* L/ll: long double or long long */ #define SHORT 0x04 /* h: short */ ! #define CHAR 0x08 /* hh: 8 bit integer */ ! #define SUPPRESS 0x10 /* suppress assignment */ ! #define POINTER 0x20 /* weird %p pointer (`fake hex') */ ! #define NOSKIP 0x40 /* do not skip blanks */ /* *************** *** 164,175 **** */ ! #define SIGNOK 0x40 /* +/- is (still) legal */ ! #define NDIGITS 0x80 /* no digits detected */ ! #define DPTOK 0x100 /* (float) decimal point is still legal */ ! #define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */ ! #define PFXOK 0x100 /* 0x prefix is (still) legal */ ! #define NZDIGITS 0x200 /* no zero digits detected */ /* --- 165,176 ---- */ ! #define SIGNOK 0x80 /* +/- is (still) legal */ ! #define NDIGITS 0x100 /* no digits detected */ ! #define DPTOK 0x200 /* (float) decimal point is still legal */ ! #define EXPOK 0x400 /* (float) exponent (e+3, etc) still legal */ ! #define PFXOK 0x200 /* 0x prefix is (still) legal */ ! #define NZDIGITS 0x400 /* no zero digits detected */ /* *************** *** 263,266 **** --- 264,268 ---- #endif + char *cp; short *sp; int *ip; *************** *** 336,340 **** goto again; case 'l': ! flags |= LONG; goto again; case 'L': --- 338,348 ---- goto again; case 'l': ! if (*fmt == 'l') /* Check for 'll' = long long (SUSv3) */ ! { ! ++fmt; ! flags |= LONGDBL; ! } ! else ! flags |= LONG; goto again; case 'L': *************** *** 342,346 **** goto again; case 'h': ! flags |= SHORT; goto again; --- 350,360 ---- goto again; case 'h': ! if (*fmt == 'h') /* Check for 'hh' = char int (SUSv3) */ ! { ! ++fmt; ! flags |= CHAR; ! } ! else ! flags |= SHORT; goto again; *************** *** 441,445 **** if (flags & SUPPRESS) /* ??? */ continue; ! if (flags & SHORT) { sp = va_arg (ap, short *); --- 455,464 ---- if (flags & SUPPRESS) /* ??? */ continue; ! if (flags & CHAR) ! { ! cp = va_arg (ap, char *); ! *cp = nread; ! } ! else if (flags & SHORT) { sp = va_arg (ap, short *); *************** *** 809,812 **** --- 828,836 ---- if (flags & POINTER) *(va_arg (ap, _PTR *)) = (_PTR) (unsigned _POINTER_INT) res; + else if (flags & CHAR) + { + cp = va_arg (ap, char *); + *cp = res; + } else if (flags & SHORT) { |