Mail Archives: djgpp/1997/01/28/07:26:09
Moo-Juice wrote:
>
> In article <32e22d1c DOT 4599867 AT ursa DOT smsu DOT edu>, Tony O'Bryan
> <aho450s AT nic DOT smsu DOT edu> writes
> >On Sat, 18 Jan 1997 01:01:22 GMT, Dave Pearson <davep AT hagbard DOT demon DOT co DOT uk>
> >wrote:
> >
> >>#ifndef BYTE
> >>typedef unsigned char BYTE;
> >>#endif
> >>
> >>#ifndef BYTE
> >>typedef unsigned char BYTE;
> >>#endif
> >
> >GCC complains about a redefinition, but will allow a #define in place of the
> >typedef. Turbo C allows both versions.
> >
> >Sorry for the extra text, but Free Agent won't let me send a message that has
> >more quoted material than new. :(
>
> One question... why are the 'chars' unsigned? This is a simple query
> and not an attack on the reason for using it :)
>
> --
> Moo-Juice
char foo;
unsigned char bar;
int foobar;
bar=foo=0xff; /* foo is -1, bar is 255, but no problem here */
foobar = bar, /* foobar is 255, probably what you wanted */
foobar = foo; /* foobar is -1, probably not what you wanted */
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* Voice/Fax Box: +49 2561 91371 2056 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -