summaryrefslogtreecommitdiff
path: root/libavutil/md5.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2006-07-03 11:11:22 +0000
committerLuca Barbato <lu_zero@gentoo.org>2006-07-03 11:11:22 +0000
commit5351c29cbe15c25d0a81a896ed56e6f5495746a7 (patch)
tree0e1941fd81fe19b97f82ebd52e3715bd8da1cc19 /libavutil/md5.c
parent9c39071d6de074c6584b21b6c38adf498102a686 (diff)
downloadffmpeg-5351c29cbe15c25d0a81a896ed56e6f5495746a7.tar.gz
fix endianess build in a better way
Originally committed as revision 5596 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/md5.c')
-rw-r--r--libavutil/md5.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 82a2cffc22..557cc82286 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -69,11 +69,8 @@ static const uint32_t T[64] = {
}\
a = b + (( a << t ) | ( a >> (32 - t) ));
-#ifdef WORDS_BIGENDIAN
static void body(uint32_t ABCD[4], uint32_t X[16]){
-#else
-static void body(uint32_t ABCD[4], const uint32_t X[16]){
-#endif
+
int t;
int i attribute_unused;
unsigned int a= ABCD[3];
@@ -121,7 +118,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){
for( i = 0; i < len; i++ ){
ctx->block[ ctx->b_used++ ] = src[i];
if( 64 == ctx->b_used ){
- body(ctx->ABCD, (const uint32_t*) ctx->block);
+ body(ctx->ABCD, (uint32_t*) ctx->block);
ctx->b_used = 0;
}
}
@@ -135,14 +132,14 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst){
memset(&ctx->block[ctx->b_used], 0, 64 - ctx->b_used);
if( 56 < ctx->b_used ){
- body( ctx->ABCD, (const uint32_t*) ctx->block );
+ body( ctx->ABCD, (uint32_t*) ctx->block );
memset(ctx->block, 0, 64);
}
for(i=0; i<8; i++)
ctx->block[56+i] = (ctx->len << 3) >> (i<<3);
- body(ctx->ABCD, (const uint32_t*) ctx->block);
+ body(ctx->ABCD, (uint32_t*) ctx->block);
for(i=0; i<4; i++)
((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]);