]> pd.if.org Git - pdclib/commitdiff
Bug #11 - memswp() in qsort() not type correct. Fixed.
authorsolar <unknown>
Wed, 12 Sep 2007 04:08:48 +0000 (04:08 +0000)
committersolar <unknown>
Wed, 12 Sep 2007 04:08:48 +0000 (04:08 +0000)
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
functions/stdlib/qsort.c
includes/stdint.h
includes/stdlib.h
internals/_PDCLIB_int.h

index 6cd5a10e3520cdd059517d430de47460077b3792..d36837e49ae911369009643e7b383a88c18dc373 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include <ctype.h>
+#include <stddef.h>
 
 const char * _PDCLIB_strtox_prelim( const char * p, char * sign, int * base )
 {
index d12776993988278b304d625a8f0b604f0b4c988d..084cd3ca4cf07675cca839812a5e4526283550da 100644 (file)
@@ -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 );
 }
index 07a161af21c819274a939ef3250755de428a5ab2..a5dfc5cdc17672999e683058720010cb1e2db687 100644 (file)
@@ -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 */
 
index 026a82a5020cc7ea97b53bd2234619e99a8aeafe..06eb9ce628335167c48184ee89fabda72df9d140 100644 (file)
@@ -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 ) ); 
index 0ce2c99fc383ab9c700ceb42482203a3cc0da7fe..d84cc69d6b011234c011856c08186d11fcdcc942 100644 (file)
@@ -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