From 6214bc20677ec006f9d8df0e6aa54333935230fe Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Fri, 10 Sep 2004 07:39:20 +0000 Subject: [PATCH] c.lib 1.175 (10.9.2004) - now tries to use the compiler supplied, machine specific file and also includes the OS4-specifc file, if necessary. - Added another test to to check if the "timeval" definition is already in place. If it is, will not be included. - can be made to define the timeval data structure locally if the __USE_CLIB2_TIMEVAL preprocessor symbol is defined. In this case no or file will be read. - The sprintf() family did not properly handle empty strings as format specifications. This would result in a necessary buffer flush action getting skipped, which consequently did not put the string termination character into the output buffer. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14723 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/amiga.lib_rev.h | 10 +++++----- library/amiga.lib_rev.rev | 2 +- library/c.lib_rev.h | 10 +++++----- library/c.lib_rev.rev | 2 +- library/changes | 11 +++++++++++ library/debug.lib_rev.h | 10 +++++----- library/debug.lib_rev.rev | 2 +- library/include/sys/time.h | 40 +++++++++++++++----------------------- library/m.lib_rev.h | 10 +++++----- library/m.lib_rev.rev | 2 +- library/m881.lib_rev.h | 10 +++++----- library/m881.lib_rev.rev | 2 +- library/net.lib_rev.h | 10 +++++----- library/net.lib_rev.rev | 2 +- library/releasenotes | 14 ++++++++----- library/stack.lib_rev.h | 10 +++++----- library/stack.lib_rev.rev | 2 +- library/stdio_puts.c | 4 ++-- library/stdio_vfprintf.c | 15 ++------------ library/unix.lib_rev.h | 10 +++++----- library/unix.lib_rev.rev | 2 +- 21 files changed, 88 insertions(+), 92 deletions(-) diff --git a/library/amiga.lib_rev.h b/library/amiga.lib_rev.h index 45f3917..20b13f3 100644 --- a/library/amiga.lib_rev.h +++ b/library/amiga.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "amiga.lib 1.174" -#define VSTRING "amiga.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: amiga.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "amiga.lib 1.175" +#define VSTRING "amiga.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: amiga.lib 1.175 (10.9.2004)" diff --git a/library/amiga.lib_rev.rev b/library/amiga.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/amiga.lib_rev.rev +++ b/library/amiga.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index df5691b..9a1487e 100644 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "c.lib 1.174" -#define VSTRING "c.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: c.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "c.lib 1.175" +#define VSTRING "c.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: c.lib 1.175 (10.9.2004)" diff --git a/library/c.lib_rev.rev b/library/c.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/c.lib_rev.rev +++ b/library/c.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/changes b/library/changes index a644ac1..8e6633d 100644 --- a/library/changes +++ b/library/changes @@ -1,3 +1,5 @@ +c.lib 1.175 (10.9.2004) + - now tries to use the compiler supplied, machine specific file and also includes the OS4-specifc file, if necessary. @@ -5,6 +7,15 @@ - Added another test to to check if the "timeval" definition is already in place. If it is, will not be included. +- can be made to define the timeval data structure locally if + the __USE_CLIB2_TIMEVAL preprocessor symbol is defined. In this case no + or file will be read. + +- The sprintf() family did not properly handle empty strings as format + specifications. This would result in a necessary buffer flush action + getting skipped, which consequently did not put the string termination + character into the output buffer. + c.lib 1.174 (27.8.2004) diff --git a/library/debug.lib_rev.h b/library/debug.lib_rev.h index 4ef748a..ec3d03e 100644 --- a/library/debug.lib_rev.h +++ b/library/debug.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "debug.lib 1.174" -#define VSTRING "debug.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: debug.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "debug.lib 1.175" +#define VSTRING "debug.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: debug.lib 1.175 (10.9.2004)" diff --git a/library/debug.lib_rev.rev b/library/debug.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/debug.lib_rev.rev +++ b/library/debug.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/include/sys/time.h b/library/include/sys/time.h index 8209369..ceafe1e 100644 --- a/library/include/sys/time.h +++ b/library/include/sys/time.h @@ -1,5 +1,5 @@ /* - * $Id: time.h,v 1.5 2004-09-09 10:56:24 obarthel Exp $ + * $Id: time.h,v 1.6 2004-09-10 07:39:20 obarthel Exp $ * * :ts=4 * @@ -52,11 +52,7 @@ extern "C" { structure and try to get by with this definition. Sometimes it works, sometimes it doesn't. Not sure if there really is a good solution for this problem... */ -#ifndef __TIMEVAL_ALREADY_DEFINED - -/****************************************************************************/ - -#ifndef DEVICES_TIMER_H +#if !defined(__TIMEVAL_ALREADY_DEFINED) && !defined(__USE_CLIB2_TIMEVAL) /****************************************************************************/ @@ -77,11 +73,23 @@ extern "C" { /****************************************************************************/ /* This will define the 'struct timeval' */ +#ifndef DEVICES_TIMER_H #include +#endif /* DEVICES_TIMER_H */ /****************************************************************************/ -#else +#endif /* INCLUDE_VERSION */ + +/****************************************************************************/ + +#endif /* !__TIMEVAL_ALREADY_DEFINED && !__USE_CLIB2_TIMEVAL */ + +/****************************************************************************/ + +/* If the timeval is still undefined or should be defined locally, + define our own now... */ +#if !defined(__TIMEVAL_ALREADY_DEFINED) /****************************************************************************/ @@ -98,19 +106,7 @@ struct timeval /****************************************************************************/ -#endif /* INCLUDE_VERSION */ - -/****************************************************************************/ - -#endif /* DEVICES_TIMER_H */ - -/****************************************************************************/ - -#endif /* __TIMEVAL_ALREADY_DEFINED */ - -/****************************************************************************/ - -#ifdef DEVICES_TIMER_H +#endif /* !__TIMEVAL_ALREADY_DEFINED */ /****************************************************************************/ @@ -124,10 +120,6 @@ struct timeval /****************************************************************************/ -#endif /* DEVICES_TIMER_H */ - -/****************************************************************************/ - struct timezone { int tz_minuteswest; /* of Greenwich */ diff --git a/library/m.lib_rev.h b/library/m.lib_rev.h index 4cb8f92..aee9903 100644 --- a/library/m.lib_rev.h +++ b/library/m.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "m.lib 1.174" -#define VSTRING "m.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: m.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "m.lib 1.175" +#define VSTRING "m.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: m.lib 1.175 (10.9.2004)" diff --git a/library/m.lib_rev.rev b/library/m.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/m.lib_rev.rev +++ b/library/m.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/m881.lib_rev.h b/library/m881.lib_rev.h index c0458b5..ac9f94c 100644 --- a/library/m881.lib_rev.h +++ b/library/m881.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "m881.lib 1.174" -#define VSTRING "m881.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: m881.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "m881.lib 1.175" +#define VSTRING "m881.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: m881.lib 1.175 (10.9.2004)" diff --git a/library/m881.lib_rev.rev b/library/m881.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/m881.lib_rev.rev +++ b/library/m881.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/net.lib_rev.h b/library/net.lib_rev.h index 9f37779..b35ff94 100644 --- a/library/net.lib_rev.h +++ b/library/net.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "net.lib 1.174" -#define VSTRING "net.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: net.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "net.lib 1.175" +#define VSTRING "net.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: net.lib 1.175 (10.9.2004)" diff --git a/library/net.lib_rev.rev b/library/net.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/net.lib_rev.rev +++ b/library/net.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/releasenotes b/library/releasenotes index dd823c0..430c950 100644 --- a/library/releasenotes +++ b/library/releasenotes @@ -1,7 +1,11 @@ -c.lib 1.174 (27.8.2004) +c.lib 1.175 (10.9.2004) -- atan2() did not work correctly. Please rebuild any code that - uses it. +- The timeval definition in can now be used without + having to include and . Just + define the __USE_CLIB2_TIMEVAL preprocessor symbol. However, + this is intended only for code which for certain reasons cannot + include these header files. Don't use this approach if your + code may include at some point. -- tan(), exp(), pow(), rint() and rintf() now should return more - accurate results. +- The sprintf() function family did not properly terminate the + output string if the format string itself was empty. Fixed. diff --git a/library/stack.lib_rev.h b/library/stack.lib_rev.h index 01dbb79..5f0b366 100644 --- a/library/stack.lib_rev.h +++ b/library/stack.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "stack.lib 1.174" -#define VSTRING "stack.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: stack.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "stack.lib 1.175" +#define VSTRING "stack.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: stack.lib 1.175 (10.9.2004)" diff --git a/library/stack.lib_rev.rev b/library/stack.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/stack.lib_rev.rev +++ b/library/stack.lib_rev.rev @@ -1 +1 @@ -174 +175 diff --git a/library/stdio_puts.c b/library/stdio_puts.c index ad6a2d5..b77c149 100644 --- a/library/stdio_puts.c +++ b/library/stdio_puts.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_puts.c,v 1.1.1.1 2004-07-26 16:31:40 obarthel Exp $ + * $Id: stdio_puts.c,v 1.2 2004-09-10 07:39:19 obarthel Exp $ * * :ts=4 * @@ -94,7 +94,7 @@ puts(const char *s) out: - /* Note: if buffering is disabled for this stdout, then we still + /* Note: if buffering is disabled for this stream, then we still may have buffered data around, queued to be printed right now. This is intended to improve performance as it takes more effort to write a single character to a file than to write a bunch. */ diff --git a/library/stdio_vfprintf.c b/library/stdio_vfprintf.c index 6892ea3..086f66b 100644 --- a/library/stdio_vfprintf.c +++ b/library/stdio_vfprintf.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_vfprintf.c,v 1.4 2004-08-14 11:11:01 obarthel Exp $ + * $Id: stdio_vfprintf.c,v 1.5 2004-09-10 07:39:19 obarthel Exp $ * * :ts=4 * @@ -262,7 +262,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -344,7 +343,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -566,7 +564,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -623,7 +620,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1013,7 +1009,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1168,7 +1163,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1224,7 +1218,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(arg == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1243,7 +1236,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(short_ptr == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1268,7 +1260,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(int_ptr == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1289,7 +1280,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(int_ptr == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1311,7 +1301,6 @@ vfprintf(FILE * stream,const char * format, va_list arg) if(int_ptr == NULL) { errno = EFAULT; - result = EOF; goto out; } } @@ -1524,7 +1513,7 @@ vfprintf(FILE * stream,const char * format, va_list arg) may have buffered data around, queued to be printed right now. This is intended to improve performance as it takes more effort to write a single character to a file than to write a bunch. */ - if(result > 0 && (iob->iob_Flags & IOBF_BUFFER_MODE) == IOBF_BUFFER_MODE_NONE) + if(result != EOF && (iob->iob_Flags & IOBF_BUFFER_MODE) == IOBF_BUFFER_MODE_NONE) { if(__iob_write_buffer_is_valid(iob) && __flush_iob_write_buffer(iob) < 0) result = EOF; diff --git a/library/unix.lib_rev.h b/library/unix.lib_rev.h index 4f9edb8..fc469df 100644 --- a/library/unix.lib_rev.h +++ b/library/unix.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 174 -#define DATE "27.8.2004" -#define VERS "unix.lib 1.174" -#define VSTRING "unix.lib 1.174 (27.8.2004)\r\n" -#define VERSTAG "\0$VER: unix.lib 1.174 (27.8.2004)" +#define REVISION 175 +#define DATE "10.9.2004" +#define VERS "unix.lib 1.175" +#define VSTRING "unix.lib 1.175 (10.9.2004)\r\n" +#define VERSTAG "\0$VER: unix.lib 1.175 (10.9.2004)" diff --git a/library/unix.lib_rev.rev b/library/unix.lib_rev.rev index c5356ba..f07e286 100644 --- a/library/unix.lib_rev.rev +++ b/library/unix.lib_rev.rev @@ -1 +1 @@ -174 +175