On Mon, 12 Jan 2004 22:04:16 +0100 (MET)
[EMAIL PROTECTED] wrote:

>     > So everybody who does not want to know how integers are represented
>     > on the current architecture writes
>     >     start = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24);
>     > And it just works.
> 
>     Really, do you think your statement is better, clearer, or less
>     error-prone than this:
> 
>         start = get_be32(p);

> I have been arguing that casts are bad. If get_le32(p) does not
> involve a cast but is just an abbreviation of what I wrote above,
> then of course I do not object.

Both work in kernel, because Linux guarantees processing of alignment
traps and emulation of unaligned access. But I really dislike when
people abuse this property of kernel. It's not intended for routine use.

-- Pete


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to