return to first page linux journal archive
keywordscontents

Listing 1.

u_int byterev_naive (u_int L) {
 /* this is for sizeof(u_int)==4 */ return
 (((u_int)byte_reversed[(L >> 0) & 0xff] <<  0) |
  ((u_int)byte_reversed[(L >> 8) & 0xff] <<  8) |
  ((u_int)byte_reversed[(L >> 16) & 0xff] << 16) |
  ((u_int)byte_reversed[(L >> 24) & 0xff] << 24));
}