Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/epsilon
Dir : e17/libs/epsilon/src/lib
Modified Files:
Epsilon.c md5.c md5.h
Log Message:
Shift the md5.h include to avoid some undefined types.
Use uint32_t instead of u_int32_t.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/Epsilon.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- Epsilon.c 4 Nov 2005 08:21:28 -0000 1.22
+++ Epsilon.c 21 Nov 2005 21:33:00 -0000 1.23
@@ -2,7 +2,6 @@
#define X_DISPLAY_MISSING 1
#include <Imlib2.h>
#include <png.h>
-#include "md5.h"
#include <limits.h>
#include <string.h>
#include <sys/types.h>
@@ -10,6 +9,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
+#include "md5.h"
#include "../config.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/md5.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- md5.c 10 Dec 2003 04:46:36 -0000 1.1.1.1
+++ md5.c 21 Nov 2005 21:33:00 -0000 1.2
@@ -28,11 +28,11 @@
*/
void byteReverse(unsigned char *buf, unsigned longs)
{
- u_int32_t t;
+ uint32_t t;
do {
- t = (u_int32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
- *(u_int32_t *) buf = t;
+ *(uint32_t *) buf = t;
buf += 4;
} while (--longs);
}
@@ -59,12 +59,12 @@
*/
void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
{
- u_int32_t t;
+ uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((u_int32_t) len << 3)) < t)
+ if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
@@ -82,7 +82,7 @@
}
memcpy(p, buf, t);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u_int32_t *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += t;
len -= t;
}
@@ -91,7 +91,7 @@
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u_int32_t *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += 64;
len -= 64;
}
@@ -126,7 +126,7 @@
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u_int32_t *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
@@ -137,10 +137,10 @@
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((u_int32_t *) ctx->in)[14] = ctx->bits[0];
- ((u_int32_t *) ctx->in)[15] = ctx->bits[1];
+ ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+ ((uint32_t *) ctx->in)[15] = ctx->bits[1];
- MD5Transform(ctx->buf, (u_int32_t *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset((char *) ctx, 0, sizeof(ctx)); /* In case it's sensitive */
@@ -163,9 +163,9 @@
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
-void MD5Transform(u_int32_t buf[4], u_int32_t const in[16])
+void MD5Transform(uint32_t buf[4], uint32_t const in[16])
{
- register u_int32_t a, b, c, d;
+ register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/md5.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- md5.h 10 Dec 2003 04:46:36 -0000 1.1.1.1
+++ md5.h 21 Nov 2005 21:33:00 -0000 1.2
@@ -6,8 +6,8 @@
#define MD5_HASHBYTES 16
typedef struct MD5Context {
- u_int32_t buf[4];
- u_int32_t bits[2];
+ uint32_t buf[4];
+ uint32_t bits[2];
unsigned char in[64];
} MD5_CTX;
@@ -15,7 +15,7 @@
extern void MD5Update(MD5_CTX *context,unsigned char const *buf,unsigned
len);
extern void MD5Final(unsigned char digest[MD5_HASHBYTES], MD5_CTX *context);
-extern void MD5Transform(u_int32_t buf[4], u_int32_t const in[16]);
+extern void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
extern char *MD5End(MD5_CTX *, char *);
extern char *MD5File(const char *, char *);
extern char *MD5Data (const unsigned char *, unsigned int, char *);
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs