From f8dfae46eb161173a4460a98075669e810c8bb7b Mon Sep 17 00:00:00 2001 From: solar Date: Wed, 12 Sep 2007 04:08:48 +0000 Subject: [PATCH] Bug #11 - memswp() in qsort() not type correct. Fixed. Bug #12 - Documentation for atexit() wrong. Fixed. Bug #13 - Missing NULL include in strtox_prelim.c. Fixed. Bug #14 - s / us - unknown suffix. Fixed. Bug #15 - Wrong macro name "concat". Fixed. --- functions/_PDCLIB/strtox_prelim.c | 1 + functions/stdlib/qsort.c | 2 +- includes/stdint.h | 16 ++++++++-------- includes/stdlib.h | 6 +++--- internals/_PDCLIB_int.h | 6 ------ 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/functions/_PDCLIB/strtox_prelim.c b/functions/_PDCLIB/strtox_prelim.c index 6cd5a10..d36837e 100644 --- a/functions/_PDCLIB/strtox_prelim.c +++ b/functions/_PDCLIB/strtox_prelim.c @@ -7,6 +7,7 @@ */ #include +#include const char * _PDCLIB_strtox_prelim( const char * p, char * sign, int * base ) { diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c index d127769..084cd3c 100644 --- a/functions/stdlib/qsort.c +++ b/functions/stdlib/qsort.c @@ -19,7 +19,7 @@ */ /* Wrapper for _PDCLIB_memswp protects against multiple argument evaluation. */ -static inline void memswp( char * i, char * j, unsigned int size ) +static inline void memswp( char * i, char * j, size_t size ) { _PDCLIB_memswp( i, j, size ); } diff --git a/includes/stdint.h b/includes/stdint.h index 07a161a..a5dfc5c 100644 --- a/includes/stdint.h +++ b/includes/stdint.h @@ -187,17 +187,17 @@ typedef _PDCLIB_uintmax_t uintmax_t; /* Expand to an integer constant of specified value and type int_leastN_t */ -#define INT8_C( value ) concat( value, _PDCLIB_INT8_LITERAL ) -#define INT16_C( value ) concat( value, _PDCLIB_INT16_LITERAL ) -#define INT32_C( value ) concat( value, _PDCLIB_INT32_LITERAL ) -#define INT64_C( value ) concat( value, _PDCLIB_INT64_LITERAL ) +#define INT8_C( value ) value +#define INT16_C( value ) value +#define INT32_C( value ) _PDCLIB_concat( value, _PDCLIB_INT32_LITERAL ) +#define INT64_C( value ) _PDCLIB_concat( value, _PDCLIB_INT64_LITERAL ) /* Expand to an integer constant of specified value and type uint_leastN_t */ -#define UINT8_C( value ) concat( value, _PDCLIB_UINT8_LITERAL ) -#define UINT16_C( value ) concat( value, _PDCLIB_UINT16_LITERAL ) -#define UINT32_C( value ) concat( value, _PDCLIB_UINT32_LITERAL ) -#define UINT64_C( value ) concat( value, _PDCLIB_UINT64_LITERAL ) +#define UINT8_C( value ) value +#define UINT16_C( value ) value +#define UINT32_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT32_LITERAL ) +#define UINT64_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT64_LITERAL ) /* 7.18.4.2 Macros for greatest-width integer constants */ diff --git a/includes/stdlib.h b/includes/stdlib.h index 026a82a..06eb9ce 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -140,9 +140,9 @@ void * realloc( void * ptr, size_t size ); */ void abort( void ); -/* Register a function that will be called on exit(), _Exit(), or when main() - returns. At least 32 functions can be registered this way, and will be - called in reverse order of registration (last-in, first-out). +/* Register a function that will be called on exit(), or when main() returns. + At least 32 functions can be registered this way, and will be called in + reverse order of registration (last-in, first-out). Returns zero if registration is successfull, nonzero if it failed. */ int atexit( void (*func)( void ) ); diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index 0ce2c99..d84cc69 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -118,8 +118,6 @@ typedef unsigned char _PDCLIB_uint8_t; #define _PDCLIB_INT8_MAX _PDCLIB_CHAR_MAX #define _PDCLIB_INT8_MIN _PDCLIB_CHAR_MIN #define _PDCLIB_UINT8_MAX _PDCLIB_UCHAR_MAX -#define _PDCLIB_INT8_LITERAL -#define _PDCLIB_UINT8_LITERAL #else #error Unsupported width of char (not 8 bits). #endif @@ -131,16 +129,12 @@ typedef unsigned int _PDCLIB_uint16_t; #define _PDCLIB_INT16_MAX _PDCLIB_INT_MAX #define _PDCLIB_INT16_MIN _PDCLIB_INT_MIN #define _PDCLIB_UINT16_MAX _PDCLIB_UINT_MAX -#define _PDCLIB_INT16_LITERAL -#define _PDCLIB_UINT16_LITERAL #elif _PDCLIB_SHRT_BYTES == 2 typedef signed short _PDCLIB_int16_t; typedef unsigned short _PDCLIB_uint16_t; #define _PDCLIB_INT16_MAX _PDCLIB_SHRT_MAX #define _PDCLIB_INT16_MIN _PDCLIB_SHRT_MIN #define _PDCLIB_UINT16_MAX _PDCLIB_USHRT_MAX -#define _PDCLIB_INT16_LITERAL s -#define _PDCLIB_UINT16_LITERAL us #else #error Neither 'short' nor 'int' are 16-bit. #endif -- 2.40.0