The R Project SVN R

Rev

Rev 36792 | Rev 43972 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36792 Rev 41539
Line 1... Line 1...
1
/* Formatted output to strings.
1
/* Formatted output to strings.
2
   Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
2
   Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc.
3
 
3
 
4
   This program is free software; you can redistribute it and/or modify it
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   any later version.
7
   any later version.
Line 383... Line 383...
383
	      /* Read the conversion character.  */
383
	      /* Read the conversion character.  */
384
	      c = *cp++;
384
	      c = *cp++;
385
	      switch (c)
385
	      switch (c)
386
		{
386
		{
387
		case 'd': case 'i':
387
		case 'd': case 'i':
388
#ifdef HAVE_LONG_LONG
388
#ifdef HAVE_LONG_LONG_INT
-
 
389
		  /* If 'long long' exists and is larger than 'long':  */
389
		  if (flags >= 16 || (flags & 4))
390
		  if (flags >= 16 || (flags & 4))
390
		    type = TYPE_LONGLONGINT;
391
		    type = TYPE_LONGLONGINT;
391
		  else
392
		  else
392
#endif
393
#endif
-
 
394
		  /* If 'long long' exists and is the same as 'long', we parse
-
 
395
		     "lld" into TYPE_LONGINT.  */
393
		  if (flags >= 8)
396
		  if (flags >= 8)
394
		    type = TYPE_LONGINT;
397
		    type = TYPE_LONGINT;
395
		  else if (flags & 2)
398
		  else if (flags & 2)
396
		    type = TYPE_SCHAR;
399
		    type = TYPE_SCHAR;
397
		  else if (flags & 1)
400
		  else if (flags & 1)
398
		    type = TYPE_SHORT;
401
		    type = TYPE_SHORT;
399
		  else
402
		  else
400
		    type = TYPE_INT;
403
		    type = TYPE_INT;
401
		  break;
404
		  break;
402
		case 'o': case 'u': case 'x': case 'X':
405
		case 'o': case 'u': case 'x': case 'X':
403
#ifdef HAVE_LONG_LONG
406
#ifdef HAVE_LONG_LONG_INT
-
 
407
		  /* If 'long long' exists and is larger than 'long':  */
404
		  if (flags >= 16 || (flags & 4))
408
		  if (flags >= 16 || (flags & 4))
405
		    type = TYPE_ULONGLONGINT;
409
		    type = TYPE_ULONGLONGINT;
406
		  else
410
		  else
407
#endif
411
#endif
-
 
412
		  /* If 'unsigned long long' exists and is the same as
-
 
413
		     'unsigned long', we parse "llu" into TYPE_ULONGINT.  */
408
		  if (flags >= 8)
414
		  if (flags >= 8)
409
		    type = TYPE_ULONGINT;
415
		    type = TYPE_ULONGINT;
410
		  else if (flags & 2)
416
		  else if (flags & 2)
411
		    type = TYPE_UCHAR;
417
		    type = TYPE_UCHAR;
412
		  else if (flags & 1)
418
		  else if (flags & 1)
Line 457... Line 463...
457
#endif
463
#endif
458
		case 'p':
464
		case 'p':
459
		  type = TYPE_POINTER;
465
		  type = TYPE_POINTER;
460
		  break;
466
		  break;
461
		case 'n':
467
		case 'n':
462
#ifdef HAVE_LONG_LONG
468
#ifdef HAVE_LONG_LONG_INT
-
 
469
		  /* If 'long long' exists and is larger than 'long':  */
463
		  if (flags >= 16 || (flags & 4))
470
		  if (flags >= 16 || (flags & 4))
464
		    type = TYPE_COUNT_LONGLONGINT_POINTER;
471
		    type = TYPE_COUNT_LONGLONGINT_POINTER;
465
		  else
472
		  else
466
#endif
473
#endif
-
 
474
		  /* If 'long long' exists and is the same as 'long', we parse
-
 
475
		     "lln" into TYPE_COUNT_LONGINT_POINTER.  */
467
		  if (flags >= 8)
476
		  if (flags >= 8)
468
		    type = TYPE_COUNT_LONGINT_POINTER;
477
		    type = TYPE_COUNT_LONGINT_POINTER;
469
		  else if (flags & 2)
478
		  else if (flags & 2)
470
		    type = TYPE_COUNT_SCHAR_POINTER;
479
		    type = TYPE_COUNT_SCHAR_POINTER;
471
		  else if (flags & 1)
480
		  else if (flags & 1)