From: Wolfgang Denk Date: Wed, 07 Nov 2007 14:33:24 +0100 Subject: [U-Boot-Users] Spartan FPGA patch In-Reply-To: Your message of "Wed, 07 Nov 2007 13:43:32 +0200." <4731A4E4.20308@inaccessnetworks.com> Message-ID: <20071107133324.CBCAC248D3@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 at denx.de "Wish not to seem, but to be, the best." - Aeschylus