mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be
right, there seems precious little reason to have a pile of hand-maintained endianness definitions in src/include/port/*.h. Get rid of those, and make the couple of places that used them depend on WORDS_BIGENDIAN instead.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-blowfish.c,v 1.11 2006/03/11 04:38:30 momjian Exp $
|
||||
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-blowfish.c,v 1.12 2007/04/06 05:36:50 tgl Exp $
|
||||
*
|
||||
* This code comes from John the Ripper password cracker, with reentrant
|
||||
* and crypt(3) interfaces added, but optimizations specific to password
|
||||
@ -436,19 +436,19 @@ BF_encode(char *dst, const BF_word * src, int size)
|
||||
}
|
||||
|
||||
static void
|
||||
BF_swap(BF_word * x, int count)
|
||||
BF_swap(BF_word *x, int count)
|
||||
{
|
||||
static int endianness_check = 1;
|
||||
char *is_little_endian = (char *) &endianness_check;
|
||||
/* Swap on little-endian hardware, else do nothing */
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
BF_word tmp;
|
||||
|
||||
if (*is_little_endian)
|
||||
do
|
||||
{
|
||||
tmp = *x;
|
||||
tmp = (tmp << 16) | (tmp >> 16);
|
||||
*x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF);
|
||||
} while (--count);
|
||||
do
|
||||
{
|
||||
tmp = *x;
|
||||
tmp = (tmp << 16) | (tmp >> 16);
|
||||
*x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF);
|
||||
} while (--count);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BF_SCALE
|
||||
|
Reference in New Issue
Block a user