1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00
Commit Graph

260 Commits

Author SHA1 Message Date
3975d234bd - Ported cosf(), coshf(), sinf(), sinhf(), tanf(), tanhf()
and hypotf() for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14964 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-30 08:10:41 +00:00
3c220c3939 - Implemented fmin()/fminf(), fmax()/fmaxf(), fdim()/fdimf() for C99.
- Ported acosf(), asinf(), atan2f(), atanf(), ceilf(), expf(), floorf(),
  fmodf(), frexpf(), ldexpf(), log10f(), logbf(), logf(), modff(), powf(), sqrtf(),
  scalbn() and scalbnf() for C99.

- Ported cbrt(), cbrtf(), erf(), erff(), erfc(), erfcf(), expm1(),
  expm1f(), ilogb(), ilogbf(), log1p() and log1pf() for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14963 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 14:45:33 +00:00
49e98713d4 - Implemented fmin()/fminf(), fmax()/fmaxf(), fdim()/fdimf() (C99).
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14962 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 12:41:04 +00:00
505c23237a - Added skeleton code for acosf(), acosh(), acoshf(), asinf(), asinh(),
asinhf(), atan2f(), atanf(), atanh(), atanhf(), cbrt(), cbrtf(),
  ceilf(), cosf(), coshf(), erf(), erfc(), erfcf(), erff(),
  exp2(), exp2f(), expf(), expm1(), expm1f(), fdim(), fdimf(),
  floorf(), fma(), fmaf(), fmax(), fmaxf(), fmin(), fminf(),
  fmodf(), frexpf(), hypotf(), ilogb(), ilogbf(), ldexpf(), lgamma(),
  lgammaf(), log10f(), log1p(), log1pf(), log2(), log2f(), logbf(),
  logf(), lrint(), lrintf(), lround(), lroundf(), modff(), nearbyint(),
  nearbyintf(), powf(), remainder(), remainderf(), remquo(), remquof(), round(),
  roundf(), scalbn(), scalbnf(), sinf(), sinhf(), sqrtf(), tanf(),
  tanhf(), tgamma(), tgammaf(), trunc() and truncf(), to be filled in
  later...


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14961 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 11:19:01 +00:00
ffeb475873 - Added a TODO-list which at this time only covers the missing floating
point arithmetic functions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14960 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 10:44:23 +00:00
c3a10b88b5 - Added NAN, INFINITY, FLT_EVAL_METHOD, float_t and double_t to
<math.h>.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14959 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 10:09:55 +00:00
2ced1d3293 - Modified the locale-aware isalnum(), isalpha(), iscntrl(),
isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(),
  isupper(), isxdigit(), tolower() and toupper() functions
  to clamp the input parameter to the "unsigned char" range before
  it is submitted to the respective locale.library function. This
  should be in sync with what the specs demand, which state that
  if the input parameter is neither EOF nor in the range of an
  "unsigned char" variable, then the results are undefined.

- ungetc() now returns the input character, clamped to an unsigned
  char value, upon success. Previously, if the input parameter was
  negative and not EOF, the result was identical to the input, which
  could have had negative side-effects.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14958 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 09:56:09 +00:00
fb4dae84aa - Added a couple of (float) casts.
- Fixed isblank() to compile properly.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14957 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 08:19:36 +00:00
a03ced93b0 - The record locking code in fcntl() is no longer part of the
regular libc.a, but only of libunix.a.

- Changed the definition of the D_S() macro to cast the pointer
  address to an unsigned 32 bit integer.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14956 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-27 13:19:30 +00:00
a19d60f524 - For %C strtime() should return the century number, not the
year number mod 100.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14955 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-19 13:57:53 +00:00
f6d20fee01 - Moved the IExec initialization in "simple_sprintf.c".
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14954 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-18 07:22:52 +00:00
d4aa0b04af - Forgot to update the .cvsignore file to ignore the simple_sprintf test
program.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14953 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-17 19:16:43 +00:00
df05c80c57 - Added a simple test for sprintf() which does not use any of the
normal library startup code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14952 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-17 19:15:32 +00:00
a1ffc20864 - Documented __strip_double_slash() and plugged in a memmove()
in place of the copying loop.

- Modified __translate_unix_to_amiga_path_name() and
  __translate_amiga_to_unix_path_name() to not to call strlen()
  on the results of __strip_double_slash().


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14951 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-15 12:32:59 +00:00
13c857ba0a - Added %D, %e, %F, %g, %G and %h for strftime(); repaired %I.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14950 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-14 14:47:46 +00:00
5ecfdf33c6 - Added tests for inf/nan.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14949 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-14 10:57:43 +00:00
fa31c468dc - fpclassify() now returns FP_ZERO both for 0 and -0.
- nan() and nanf() now return quiet NaNs.

- Added internal __inf() and __inff() functions.

- strtof() now calls nanf() and __inff(), respectively, to produce
  the special floating point values for nan/inf/infinity.

- strtod() now calls nan() and __inf(), respectively, to produce
  the special floating point values for nan/inf/infinity.

- The scanf() family now calls nan() and __inf(), respectively, to
  produce the special floating point values for nan/inf/infinity.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14948 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-14 10:52:31 +00:00
feb29fa334 - Enabled the C99 language option.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14947 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 15:07:22 +00:00
d0a4e057bc - Added C99 checks to "complex_headers.h".
- No longer uses a local copysign() function in "math_kernel_scalbn.c".

- Fixed an assignment which actually came out as a comparison in "stdio_vfscanf.c".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14946 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 14:50:06 +00:00
c5087c78ce - Getting ready for the 1.192 release.
- Floating point output in hexadecimal notation can now show a sign
  in front of the hex prefix string.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14945 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 14:42:32 +00:00
c5c6492868 - fflush() no longer calls flockfile()/funlockfile() with a NULL parameter.
- Removed the old isinf() and isnan() functions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14944 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 14:00:54 +00:00
539cc3553d - Added isunordered(), isgreater(), isgreaterequal(), isless(),
islessequal() and islessgreater() to <math.h> for C99.

- The wchar_t type is now an 'unsigned short' integer (16 bits wide).

- Added PTRDIFF_MIN/PTRDIFF_MAX, WCHAR_MIN/WCHAR_MAX and
  WINT_MIN/WINT_MAX to <stdint.h> for C99.

- Added imaxdiv() and imaxabs() for C99.

- Added strtoimax() and strtoumax() for C99.

- Added nextafter() and nextafterf() for C99.

- Added copysign() and copysignf() for C99.

- Unless I missed something, clib2 should now be functionally complete
  with regard to C99, except for the floating point operations covered.
  These are a major challenge all by themselves, and I wonder both
  whether they are worth the effort and how one could implement them
  correctly.

- fflush() now consistently supports a NULL parameter, causing all
  streams to be flushed for which this behaviour is defined.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14943 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 13:21:47 +00:00
bc65dd2877 - Added isblank().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14942 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-11 20:15:28 +00:00
ec027fa510 - The strftime() %z conversion now prints the time zone difference as a
"decimal" number. That is, if the difference is 5 hours and 30 minutes,
  then %z will now print "530" rather than "330".

- mktime() now handles one leap second gracefully.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14941 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-09 13:47:24 +00:00
65484eac3c - Corrected the thread-safe clearerr() macro.
- Fixed math_headers.h so that fabsf.c compiles correctly with SAS/C.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14940 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 17:02:16 +00:00
2be60de3e7 - Added "fstat_stdout_test".
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14939 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 16:27:25 +00:00
89b568bcb8 - Small fixes to the scanf() family.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14938 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 11:27:26 +00:00
2548af2b4b - Hid two more program files.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14937 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 11:20:49 +00:00
a1b39c4d01 - Added test cases for C99 format conversions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14936 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 11:20:03 +00:00
9e32991a6d - For the printf() "%a" conversion the exponent now comes out as a binary
number rather than a decimal one. Now how odd is that?

- strtod() and strtof() now support "inf"/"infinity"/"nan"/"nan(..)" and
  hexadecimal floating point numbers, for C99.

- Added the fpclassify(), isfinite(), isnormal() and signbit() macros for C99.

- Reimplemented isnan() and isinf() as macros for C99. The corresponding
  functions will be dropped from the library. Note that the isinf() macro
  does not return -1, 0 or 1 like the old function did, but only 0 or 1
  depending upon whether the parameter represents +/- infinity or not.

- Added fabsf() for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14935 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 08:51:30 +00:00
c8d29ea9c1 - Added HUGE_VALF to <math.h>.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14934 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 17:04:07 +00:00
28f561c61b - The printf() family now supports the %hh, %j, %t and %z modifiers and the
%a/%A conversions for C99. The %j is treated like %ll, %t and %z are treated
  like %l.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14933 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 16:39:27 +00:00
07056f3e26 - Plugged in the proper ISO 8601 week number calculation function.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14932 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 14:03:08 +00:00
3bd6766484 - strftime() now ignores the E and O modifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14931 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 13:40:19 +00:00
e01d58319d - Added strtof(), llabs(), lldiv(), vsscanf() and vscanf() for C99.
- strftime() now supports %C, %n, %r, %R, %t, %T, %u, %V, and %z for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14930 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 13:21:49 +00:00
ec4fd3c2cb - The libunix.a flavour of system() no longer attempts to translate the name
of a command unless it contains path separator characters.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14929 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-28 15:38:47 +00:00
df89c636db - Fixed a typo in the semaphore creation code. Ouch.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14928 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-25 15:39:56 +00:00
90a192134e - If fread()/fwrite() fail to read/write any data because either the number
of records or the size of each record is zero, both now call clearerr() to
  avoid giving the caller the wrong impression that an EOF or error occured.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14927 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 19:38:59 +00:00
3660b26c9f - Fixed two linker errors which were caused by duplicate symbol definitions.
- Added code to the startup routine which allows you to monitor where command
  was started from and which parameters it was invoked with.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14926 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 15:27:13 +00:00
9f3d5e50b4 - Fixed two linker errors which were caused by duplicate symbol definitions.
- Added code to the startup routine which allows you to monitor where command
  was started from and which parameters it was invoked with.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14925 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 14:04:36 +00:00
876039440f - The record locking semaphore could wind up getting added to the public
list twice. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14924 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 12:19:06 +00:00
0c553faff1 - Changed how errors are detected, as returned by Write(), Read() and
Seek(). Seek() is particularly challenging because the value it
  returns might be a valid file position and not an error.

- Replaced numeric function return codes of 0 and -1 with macros OK,
  SEEK_ERROR/ERROR to clarify the respective purposes.

- Changed how ftell() and fseek() are used, double-checking the return
  value and the errno code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14923 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 09:53:12 +00:00
1d611fefbe - Changed how error conditions raised by dos.library file I/O functions
are detected.

- Modified function return values of 0 and -1 to use macros like OK,
  ERROR/SEEK_ERROR instead, to better convey what the purpose of these
  values is.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14922 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 08:46:37 +00:00
a50aba0b64 - Reversed the change in rename() which enforced deletion of the target file.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14921 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-21 10:23:17 +00:00
2e9ac7d003 - The Unix-like rename() now removes the target file even if that
file has been protected from deletion.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14920 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-20 12:06:00 +00:00
0a440c8405 - Added the two release archive build scripts.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14919 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-16 10:35:12 +00:00
f63a0788d5 - Fixed the startup build target directory names.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14918 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-16 10:11:26 +00:00
431dd488a1 - Changed how the startup code is built for the different library flavours,
and which files this involves.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14917 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-13 14:35:06 +00:00
15c16efd07 - Final version bump before release.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14916 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-09 09:30:29 +00:00
6e39efe7d7 - Added a hopefully enlightening comment on the subtleties of semaphore
locking in the stdio_fflush.c file.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14915 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-04 11:56:26 +00:00