[U-Boot-Users] Spartan FPGA patch

Wolfgang Denk wd at denx.de
Wed Nov 7 14:33:24 CET 2007


In message <4731A4E4.20308 at 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 at denx.de
"Wish not to seem, but to be, the best."                  - Aeschylus




More information about the U-Boot mailing list