[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts |
Date: |
Mon, 30 Mar 2009 19:05:53 +0200 (MET DST) |
Dave Hansen <address@hidden> wrote:
> In this code=2C the handle_input function falls into an infinite loop if pl=
> ain char is signed. This is because key gets promoted (to signed int) befo=
> re the comparison with EXIT_KEY (which is already signed int). If plain c=
> har is signed=2C and key is 0xF1=2C the sign is extended for key=2C but not=
> EXIT_KEY.
I didn't try it, but wouldn't the correct solution be to declare
#define EXIT_KEY ((char)0xF1)
That way, EXIT_KEY must be promoted by the same rules, and the
comparison ought to work again.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- [avr-gcc-list] Passing a string variable to lcd_puts, David VanHorn, 2009/03/27
- Re: [avr-gcc-list] Passing a string variable to lcd_puts, Sean D'Epagnier, 2009/03/27
- Re: [avr-gcc-list] Passing a string variable to lcd_puts, Preston Wilson, 2009/03/27
- [avr-gcc-list] Re: Passing a string variable to lcd_puts, David Brown, 2009/03/28
- Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts, Joerg Wunsch, 2009/03/28
- RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts, Dave Hansen, 2009/03/30
- Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts,
Joerg Wunsch <=
- Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts, David VanHorn, 2009/03/30
- RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts, Larry Barello, 2009/03/30
- Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts, David VanHorn, 2009/03/31
- RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts, Dave Hansen, 2009/03/30
- RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts, Dave Hansen, 2009/03/30
- [avr-gcc-list] Re: Passing a string variable to lcd_puts, David Brown, 2009/03/30
- Re: [avr-gcc-list] Passing a string variable to lcd_puts, Graham Davies, 2009/03/27
- Re: [avr-gcc-list] Passing a string variable to lcd_puts, David VanHorn, 2009/03/27
- Re: [avr-gcc-list] Passing a string variable to lcd_puts, Graham Davies, 2009/03/27
Re: [avr-gcc-list] Passing a string variable to lcd_puts, Joerg Wunsch, 2009/03/28