? diffie Index: ChangeLog =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/ChangeLog,v retrieving revision 1.293.2.32 retrieving revision 1.293.2.37 diff -u -u -r1.293.2.32 -r1.293.2.37 --- ChangeLog 27 Nov 2003 05:25:23 -0000 1.293.2.32 +++ ChangeLog 15 Feb 2004 20:28:09 -0000 1.293.2.37 @@ -1,3 +1,33 @@ +2004-02-15 Joerg Wunsch + + * include/avr/timer.h: Warn about deprecation, warn for ATmega{64,128} + * include/timer.h: Warn about deprecation of + +2004-02-15 Joerg Wunsch + + Merge from HEAD: + * libc/stdlib/malloc.c: Fix bug #2143 (malloc wrap around top of RAM) + +2004-02-13 Joerg Wunsch + + Merge from HEAD: + * include/avr/interrupt.h: make timer_enable_int() static inline; + fixes bug #5454. + +2004-02-13 Joerg Wunsch + + Merge from HEAD: + * include/avr/crc16.h: use __inline__ instead of inline. + * include/avr/delay.h: Ditto. + * include/avr/interrupt.h: Ditto: + * include/avr/timer.h: Ditto. + +2004-02-13 Joerg Wunsch + + Merge from HEAD: + * libc/stdio/vfprintf.c: fix for bug #7556 (%.Xs searched for '\0') + * libc/stdio/vfscanf.c: apply patch #2554 (%ul not working) + 2003-11-26 Theodore A. Roth Released avr-libc-1.0.2. Index: include/timer.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/Attic/timer.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -u -r1.3 -r1.3.2.1 --- include/timer.h 12 Dec 2002 11:41:01 -0000 1.3 +++ include/timer.h 15 Feb 2004 20:28:09 -0000 1.3.2.1 @@ -1,5 +1,5 @@ -/* $Id: timer.h,v 1.3 2002/12/12 11:41:01 joerg_wunsch Exp $ */ +/* $Id: timer.h,v 1.3.2.1 2004/02/15 20:28:09 joerg_wunsch Exp $ */ -#warning " is deprecated, use instead" +#warning " and are deprecated, and will be removed in the next major release of avr-libc" #include Index: include/avr/crc16.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/crc16.h,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -u -u -r1.2.2.3 -r1.2.2.4 --- include/avr/crc16.h 18 Nov 2003 18:58:53 -0000 1.2.2.3 +++ include/avr/crc16.h 13 Feb 2004 21:43:37 -0000 1.2.2.4 @@ -23,7 +23,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: crc16.h,v 1.2.2.3 2003/11/18 18:58:53 troth Exp $ */ +/* $Id: crc16.h,v 1.2.2.4 2004/02/13 21:43:37 joerg_wunsch Exp $ */ #ifndef _AVR_CRC16_H_ #define _AVR_CRC16_H_ @@ -59,7 +59,7 @@ This CRC is normally used in disk-drive controllers. */ -static inline uint16_t +static __inline__ uint16_t _crc16_update(uint16_t __crc, uint8_t __data) { uint8_t __tmp; @@ -125,7 +125,7 @@ } \endcode */ -static inline uint16_t +static __inline__ uint16_t _crc_xmodem_update(uint16_t __crc, uint8_t __data) { uint16_t __ret; /* %B0:%A0 (alias for __crc) */ @@ -199,7 +199,7 @@ } \endcode */ -static inline uint16_t +static __inline__ uint16_t _crc_ccitt_update (uint16_t __crc, uint8_t __data) { uint16_t __ret; Index: include/avr/delay.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/delay.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -u -r1.2.2.1 -r1.2.2.2 --- include/avr/delay.h 11 Nov 2003 18:55:56 -0000 1.2.2.1 +++ include/avr/delay.h 13 Feb 2004 21:43:37 -0000 1.2.2.2 @@ -23,7 +23,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: delay.h,v 1.2.2.1 2003/11/11 18:55:56 troth Exp $ */ +/* $Id: delay.h,v 1.2.2.2 2004/02/13 21:43:37 joerg_wunsch Exp $ */ /* avr/delay.h - loops for small accurate delays @@ -35,7 +35,7 @@ #include /* 8-bit count, 3 cycles/loop */ -static inline void +static __inline__ void _delay_loop_1(uint8_t __count) { asm volatile ( @@ -47,7 +47,7 @@ } /* 16-bit count, 4 cycles/loop */ -static inline void +static __inline__ void _delay_loop_2(uint16_t __count) { asm volatile ( Index: include/avr/interrupt.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/interrupt.h,v retrieving revision 1.8 retrieving revision 1.8.2.2 diff -u -u -r1.8 -r1.8.2.2 --- include/avr/interrupt.h 11 Aug 2003 21:42:13 -0000 1.8 +++ include/avr/interrupt.h 13 Feb 2004 22:07:56 -0000 1.8.2.2 @@ -23,7 +23,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: interrupt.h,v 1.8 2003/08/11 21:42:13 troth Exp $ */ +/* $Id: interrupt.h,v 1.8.2.2 2004/02/13 22:07:56 joerg_wunsch Exp $ */ #ifndef _AVR_INTERRUPT_H_ #define _AVR_INTERRUPT_H_ @@ -126,7 +126,7 @@ This function modifies the \c timsk register. The value you pass via \c ints is device specific. */ -extern inline void timer_enable_int (unsigned char ints) +static __inline__ void timer_enable_int (unsigned char ints) { #ifdef TIMSK TIMSK = ints; Index: include/avr/timer.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/Attic/timer.h,v retrieving revision 1.4 retrieving revision 1.4.2.2 diff -u -u -r1.4 -r1.4.2.2 --- include/avr/timer.h 10 Jun 2003 19:12:25 -0000 1.4 +++ include/avr/timer.h 15 Feb 2004 20:28:09 -0000 1.4.2.2 @@ -23,13 +23,19 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: timer.h,v 1.4 2003/06/10 19:12:25 arcanum Exp $ */ +/* $Id: timer.h,v 1.4.2.2 2004/02/15 20:28:09 joerg_wunsch Exp $ */ #ifndef _AVR_TIMER_H_ #define _AVR_TIMER_H_ #include +#warning " is deprecated, and will be removed in the next major release of avr-libc" + +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega64__) +# warning "This file is known to be incorrect for your MCU type" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -45,17 +51,20 @@ T0_RISING_EDGE = 7 }; -static inline void timer0_source (unsigned int src) +static __inline__ void timer0_source (unsigned int src) { TCCR0 = src; } -static inline void timer0_stop (void) +/* + * NB: this is completely bogus. + */ +static __inline__ void timer0_stop (void) { TCNT0 = 0; } -static inline void timer0_start (void) +static __inline__ void timer0_start (void) { TCNT0 = 1; } Index: libc/stdio/vfprintf.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdio/vfprintf.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -u -r1.6 -r1.6.2.1 --- libc/stdio/vfprintf.c 2 Jan 2003 16:27:43 -0000 1.6 +++ libc/stdio/vfprintf.c 13 Feb 2004 20:50:39 -0000 1.6.2.1 @@ -29,7 +29,7 @@ */ /* From: Id: printf_p_new.c,v 1.1.1.9 2002/10/15 20:10:28 joerg_wunsch Exp */ -/* $Id: vfprintf.c,v 1.6 2003/01/02 16:27:43 joerg_wunsch Exp $ */ +/* $Id: vfprintf.c,v 1.6.2.1 2004/02/13 20:50:39 joerg_wunsch Exp $ */ #include #include @@ -332,12 +332,14 @@ goto nextitem; case 's': a.pc = va_arg(ap, char *); - for (base = 0; a.pc[base]; base++) - ; /* calc length of string */ #if PRINTF_LEVEL > PRINTF_MIN - if ((flags & FLPREC) && prec < base) - base = prec; + if (flags & FLPREC) + base = strnlen(a.pc, prec); + else + base = strlen(a.pc); width -= base; +#else + base = strlen(a.pc); #endif goto nextitem; case 'd': Index: libc/stdio/vfscanf.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdio/vfscanf.c,v retrieving revision 1.1 retrieving revision 1.1.2.2 diff -u -u -r1.1 -r1.1.2.2 --- libc/stdio/vfscanf.c 7 Jan 2003 22:17:24 -0000 1.1 +++ libc/stdio/vfscanf.c 13 Feb 2004 20:50:39 -0000 1.1.2.2 @@ -24,7 +24,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: vfscanf.c,v 1.1 2003/01/07 22:17:24 joerg_wunsch Exp $ */ +/* $Id: vfscanf.c,v 1.1.2.2 2004/02/13 20:50:39 joerg_wunsch Exp $ */ #include #include @@ -266,7 +266,6 @@ if (i == EOF) goto leave; - #if SCANF_LEVEL > SCANF_MIN while (width-- > 0) #else @@ -402,7 +401,8 @@ #if SCANF_LEVEL > SCANF_MIN if (!(flags & FLSTAR)) { #endif /* SCANF_LEVEL > SCANF_MIN */ - if (flags & (FLLONG & FLUNSIGNED)) + if (flags & (FLLONG | FLUNSIGNED) + == (FLLONG | FLUNSIGNED)) *(va_arg(ap, unsigned long *)) = a.ul; else if (flags & (FLUNSIGNED)) @@ -424,7 +424,7 @@ *(va_arg(ap, int *)) = stream->len; break; #endif /* SCANF_LEVEL > SCANF_MIN */ - + #if SCANF_LEVEL >= SCANF_FLT case 'e': case 'f': Index: libc/stdlib/malloc.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdlib/malloc.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -u -r1.6 -r1.6.2.1 --- libc/stdlib/malloc.c 8 Jan 2003 11:14:10 -0000 1.6 +++ libc/stdlib/malloc.c 15 Feb 2004 19:54:00 -0000 1.6.2.1 @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: malloc.c,v 1.6 2003/01/08 11:14:10 joerg_wunsch Exp $ + * $Id: malloc.c,v 1.6.2.1 2004/02/15 19:54:00 joerg_wunsch Exp $ */ #include @@ -95,7 +95,7 @@ { struct freelist *fp1, *fp2; char *cp; - size_t s; + size_t s, avail; /* * Our minimum chunk size is the size of a pointer (plus the @@ -197,7 +197,11 @@ cp = __malloc_heap_end; if (cp == 0) cp = STACK_POINTER() - __malloc_margin; - if (brkval + len + sizeof(size_t) < cp) { + avail = cp - brkval; + /* + * Both tests below are needed to catch the case len >= 0xfffe. + */ + if (avail >= len && avail >= len + sizeof(size_t)) { fp1 = (struct freelist *)brkval; brkval += len + sizeof(size_t); fp1->sz = len;