forked from osmocom/wireshark
Make Mk16_le() work on both big-endian and little-endian processors and
on processors that don't support unaligned loads - just use pletohs(). svn path=/trunk/; revision=21534
This commit is contained in:
parent
6f4a938c64
commit
cdb59eed63
|
@ -35,6 +35,7 @@
|
|||
/******************************************************************************/
|
||||
/* File includes */
|
||||
/* */
|
||||
#include <epan/pint.h>
|
||||
#include "airpdcap_system.h"
|
||||
#include "airpdcap_int.h"
|
||||
|
||||
|
@ -132,9 +133,7 @@ static const UINT16 Sbox[256] = {
|
|||
#define Mk16(hi, lo) \
|
||||
((UINT16)((lo) | (((UINT16) (hi)) << 8)))
|
||||
|
||||
/* XXX - does this assume a little-endian processor? */
|
||||
/* For that matter, does it assume a processor that handles unaligned loads? */
|
||||
#define Mk16_le(v) ((UINT16)*(v))
|
||||
#define Mk16_le(v) ((UINT16)pletohs(v))
|
||||
|
||||
#define _S_(v) \
|
||||
((UINT16)(Sbox[Lo8(v)] ^ ((Sbox[Hi8(v)] << 8) | (Sbox[Hi8(v)] >> 8))))
|
||||
|
|
Loading…
Reference in New Issue