Skip to content

Commit

Permalink
get rid of LITTLE_ENDIAN define
Browse files Browse the repository at this point in the history
  • Loading branch information
grum committed Sep 20, 2007
1 parent 24e312a commit 549562e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion make.defaults
Expand Up @@ -26,7 +26,6 @@ FEATURES += EYE_CANDY # (undocumented)
FEATURES += FONTS_FIX # dynamically loads all fonts with the filename in the format font*.bmp, and makes them accessable in the options
FEATURES += FUZZY_PATHS # Makes Tab Map walking not always follow exaclty the same path
FEATURES += IDLE_FIX # Fix for idle animations being stuck in one sequence
#FEATURES += LITTLE_ENDIAN # indicate that ELC is running on a little-endian computer (FIXME: Shouldn't this also be removed and set in code as for EL_BIG_ENDIAN?)
FEATURES += MASKING # Allow for item masking on Actors, example, can allow for short sleeves
#FEATURES += MEMORY_DEBUG # gather information about memory allocation and freeing
#FEATURES += MINES # Enables support for mines (INCOMPLETE)
Expand Down
15 changes: 8 additions & 7 deletions md5.c
Expand Up @@ -27,6 +27,7 @@ documentation and/or software.

#include <memory.h>
#include "md5.h"
#include "platform.h"

void MD5Open(MD5 *md5)
{
Expand Down Expand Up @@ -100,9 +101,7 @@ static void MD5Transform(UINT4 state[4], const unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
/* Move contents of block to x, putting bytes in little-endian order. */
#ifdef LITTLE_ENDIAN
memcpy(x, block, 64);
#else
#ifdef EL_BIG_ENDIAN
{
unsigned int i, j;
for (i = j = 0; i < 16; i++, j+= 4)
Expand All @@ -111,7 +110,9 @@ static void MD5Transform(UINT4 state[4], const unsigned char block[64])
(UINT4) block[j+2] << 16 | (UINT4) block[j+3] << 24;
}
}
#endif
#else
memcpy(x, block, 64);
#endif // EL_BIG_ENDIAN
/* Round 1 */
FF(a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF(d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
Expand Down Expand Up @@ -217,10 +218,10 @@ void MD5Digest(MD5 *md5, const void *input, unsigned int inputLen)
order.
*/

#ifdef LITTLE_ENDIAN
#define ENCODE(p,n) *(UINT4 *)(p) = n
#else
#ifdef EL_BIG_ENDIAN
#define ENCODE(p,n) (p)[0]=n,(p)[1]=n>>8,(p)[2]=n>>16,(p)[3]=n>>24
#else
#define ENCODE(p,n) *(UINT4 *)(p) = n
#endif

void MD5Close(MD5 *md5, MD5_DIGEST digest)
Expand Down

0 comments on commit 549562e

Please sign in to comment.