squash! vfprintf
This commit is contained in:
parent
96ced05f24
commit
28f115713c
|
@ -65,6 +65,7 @@ int ferror (FILE * stream);
|
||||||
int fflush (FILE * stream);
|
int fflush (FILE * stream);
|
||||||
int fgetc (FILE * stream);
|
int fgetc (FILE * stream);
|
||||||
char *fgets (char *s, int size, FILE * stream);
|
char *fgets (char *s, int size, FILE * stream);
|
||||||
|
int fileno (FILE *);
|
||||||
int fpurge (FILE * stream);
|
int fpurge (FILE * stream);
|
||||||
int fputc (int c, FILE * stream);
|
int fputc (int c, FILE * stream);
|
||||||
int fputs (char const *s, FILE * stream);
|
int fputs (char const *s, FILE * stream);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
int
|
int
|
||||||
vfprintf (FILE * f, char const *format, va_list ap)
|
vfprintf (FILE * f, char const *format, va_list ap)
|
||||||
{
|
{
|
||||||
int fd = (long) f;
|
int fd = fileno (f);
|
||||||
char const *p = format;
|
char const *p = format;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (*p)
|
while (*p)
|
||||||
|
@ -212,6 +212,9 @@ vfprintf (FILE * f, char const *format, va_list ap)
|
||||||
case 'G':
|
case 'G':
|
||||||
{
|
{
|
||||||
double d = va_arg8 (ap, double);
|
double d = va_arg8 (ap, double);
|
||||||
|
#if 1
|
||||||
|
fputs ("0.0", f);
|
||||||
|
#else
|
||||||
char *s = dtoab (d, 10, 1);
|
char *s = dtoab (d, 10, 1);
|
||||||
if (c == 'E' || c == 'G')
|
if (c == 'E' || c == 'G')
|
||||||
strupr (s);
|
strupr (s);
|
||||||
|
@ -248,6 +251,7 @@ vfprintf (FILE * f, char const *format, va_list ap)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case 'n':
|
case 'n':
|
||||||
{
|
{
|
||||||
|
@ -268,5 +272,5 @@ vfprintf (FILE * f, char const *format, va_list ap)
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
return 0;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue