diff --git a/library/math_logb.c b/library/math_logb.c index c2d74a3..c77b621 100644 --- a/library/math_logb.c +++ b/library/math_logb.c @@ -1,5 +1,5 @@ /* - * $Id: math_logb.c,v 1.1 2004-08-12 12:31:16 obarthel Exp $ + * $Id: math_logb.c,v 1.2 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -59,7 +59,7 @@ __logb(double x) { double result; - result = log(x) / log(FLT_RADIX); + result = log(x) / log((double)FLT_RADIX); return(result); } diff --git a/library/stdio_vfprintf.c b/library/stdio_vfprintf.c index 553d849..6892ea3 100644 --- a/library/stdio_vfprintf.c +++ b/library/stdio_vfprintf.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_vfprintf.c,v 1.3 2004-08-08 10:55:57 obarthel Exp $ + * $Id: stdio_vfprintf.c,v 1.4 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -635,6 +635,7 @@ vfprintf(FILE * stream,const char * format, va_list arg) char * buffer_start = buffer; __long_double_t v; + int sign; output_buffer = buffer_start; @@ -645,14 +646,14 @@ vfprintf(FILE * stream,const char * format, va_list arg) else v = va_arg(arg, double); - if(isinf(v) != 0) + if((sign = isinf(v)) != 0) { SHOWMSG("infinity"); strcpy(output_buffer,"Inf"); output_len = 3; - if(v < 0.0) + if(sign < 0) SET_FLAG(format_flags,FORMATF_IsNegative); fill_character = ' '; diff --git a/library/stdlib_qsort.c b/library/stdlib_qsort.c index e88403a..1d1e6b4 100644 --- a/library/stdlib_qsort.c +++ b/library/stdlib_qsort.c @@ -1,5 +1,5 @@ /* - * $Id: stdlib_qsort.c,v 1.1.1.1 2004-07-26 16:32:02 obarthel Exp $ + * $Id: stdlib_qsort.c,v 1.2 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -81,7 +81,7 @@ /* For an 68030 and beyond the alignment does not matter and you can skip the second half of the test (everything beyond the 'nbytes >= sizeof(long)'). */ #if defined(M68020) -#define IS_WORD_ALIGNED(a,b) 1 +#define IS_WORD_ALIGNED(a,b) (1) #else #define IS_WORD_ALIGNED(a,b) (((((unsigned long)(a)) | ((unsigned long)(b))) & 1) == 0) #endif /* M68020 */ diff --git a/library/string_headers.h b/library/string_headers.h index 6a34754..115e321 100644 --- a/library/string_headers.h +++ b/library/string_headers.h @@ -1,5 +1,5 @@ /* - * $Id: string_headers.h,v 1.1.1.1 2004-07-26 16:32:14 obarthel Exp $ + * $Id: string_headers.h,v 1.2 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -57,4 +57,21 @@ /****************************************************************************/ +/* Address is neither aligned to a word or long word boundary. */ +#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) + +/* Address is aligned to a word boundary, but not to a long + word boundary. */ +#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) + +/* Address is aligned to a long word boundary. For an 68030 and beyond the + alignment does not matter. */ +#if defined(M68020) +#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 3) == 0) +#else +#define IS_LONG_ALIGNED(a) (1) +#endif /* M68020 */ + +/****************************************************************************/ + #endif /* _STRING_HEADERS_H */ diff --git a/library/string_memchr.c b/library/string_memchr.c index adb92c0..73895a5 100644 --- a/library/string_memchr.c +++ b/library/string_memchr.c @@ -1,5 +1,5 @@ /* - * $Id: string_memchr.c,v 1.1.1.1 2004-07-26 16:32:15 obarthel Exp $ + * $Id: string_memchr.c,v 1.2 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -43,12 +43,6 @@ /****************************************************************************/ -#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) -#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) -#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 1) == 0) - -/****************************************************************************/ - /* Check if one of the four bytes which make up a long word is zero. */ #define LONG_CONTAINS_ZERO_OCTET(x) (((x) + 0xfefefeff) & ~((x) | 0x7f7f7f7f)) diff --git a/library/string_memcmp.c b/library/string_memcmp.c index 4da76b7..8f679c5 100644 --- a/library/string_memcmp.c +++ b/library/string_memcmp.c @@ -1,5 +1,5 @@ /* - * $Id: string_memcmp.c,v 1.2 2004-08-14 10:00:33 obarthel Exp $ + * $Id: string_memcmp.c,v 1.3 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -43,12 +43,6 @@ /****************************************************************************/ -#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) -#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) -#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 1) == 0) - -/****************************************************************************/ - INLINE static int __memcmp(const char *m1,const char *m2,size_t len) { diff --git a/library/string_memcpy.c b/library/string_memcpy.c index aa1168a..aa2663c 100644 --- a/library/string_memcpy.c +++ b/library/string_memcpy.c @@ -1,5 +1,5 @@ /* - * $Id: string_memcpy.c,v 1.2 2004-08-14 10:00:33 obarthel Exp $ + * $Id: string_memcpy.c,v 1.3 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -229,12 +229,6 @@ memcpy(void *dst, const void *src, size_t len) /****************************************************************************/ -#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) -#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) -#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 1) == 0) - -/****************************************************************************/ - INLINE static void __memcpy(unsigned char * to,unsigned char * from,size_t len) { diff --git a/library/string_memmove.c b/library/string_memmove.c index a44051e..18d7c43 100644 --- a/library/string_memmove.c +++ b/library/string_memmove.c @@ -1,5 +1,5 @@ /* - * $Id: string_memmove.c,v 1.1.1.1 2004-07-26 16:32:16 obarthel Exp $ + * $Id: string_memmove.c,v 1.2 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -351,12 +351,6 @@ memmove(void *dest, const void * src, size_t len) /****************************************************************************/ -#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) -#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) -#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 1) == 0) - -/****************************************************************************/ - INLINE static void __memmove(unsigned char * to,unsigned char * from,size_t len) { diff --git a/library/string_memset.c b/library/string_memset.c index e216260..5ea1159 100644 --- a/library/string_memset.c +++ b/library/string_memset.c @@ -1,5 +1,5 @@ /* - * $Id: string_memset.c,v 1.2 2004-08-14 10:00:33 obarthel Exp $ + * $Id: string_memset.c,v 1.3 2004-08-14 11:11:01 obarthel Exp $ * * :ts=4 * @@ -43,12 +43,6 @@ /****************************************************************************/ -#define IS_UNALIGNED(a) ((((unsigned long)(a)) & 1) != 0) -#define IS_SHORT_ALIGNED(a) ((((unsigned long)(a)) & 3) == 2) -#define IS_LONG_ALIGNED(a) ((((unsigned long)(a)) & 1) == 0) - -/****************************************************************************/ - INLINE static void __memset(unsigned char * to,unsigned char value,size_t len) {