
7 Nov
2007
7 Nov
'07
2:33 p.m.
In message 4731A4E4.20308@inaccessnetworks.com you wrote:
So let me repeat my question: is there any special reason why "val" has to be a "char" type? Why not making it an "int" ?
Because you will run into endianness problems. You want to treat an "unsigned char" buffer as a bitstream, reading the MSB every time. How are you going to do this portably (in both big and little endian architectures) with an "int" type, which is at least 2 bytes wide?
Oops? I can't parse that. What's the difference between "signed char" and "int" except the number of bits?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"Wish not to seem, but to be, the best." - Aeschylus