From: Joel Rosdahl Date: Sun, 13 Dec 2009 16:03:46 +0000 (+0100) Subject: Use standard uint32_t type instead of uint32 X-Git-Tag: v3.0pre0~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78beb6c38b62f8aa75bbaff195419ddeca432e20;p=thirdparty%2Fccache.git Use standard uint32_t type instead of uint32 --- diff --git a/ccache.h b/ccache.h index a111c18fa..ad2d9d448 100644 --- a/ccache.h +++ b/ccache.h @@ -79,8 +79,6 @@ enum stats { STATS_END }; -typedef unsigned uint32; - #include "mdfour.h" void hash_start(struct mdfour *md); diff --git a/manifest.c b/manifest.c index c61a0fe22..9a1711334 100644 --- a/manifest.c +++ b/manifest.c @@ -420,11 +420,11 @@ static uint32_t get_include_file_index(struct manifest *mf, return n; } -static uint32 get_file_hash_index(struct manifest *mf, - char *path, - struct file_hash *file_hash, - struct hashtable *mf_files, - struct hashtable *mf_file_infos) +static uint32_t get_file_hash_index(struct manifest *mf, + char *path, + struct file_hash *file_hash, + struct hashtable *mf_files, + struct hashtable *mf_file_infos) { struct file_info fi; uint32_t *fi_index; diff --git a/mdfour.c b/mdfour.c index b54c5f66b..3091cc3ae 100644 --- a/mdfour.c +++ b/mdfour.c @@ -38,10 +38,10 @@ static struct mdfour *m; #define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s) /* this applies md4 to 64 byte chunks */ -static void mdfour64(uint32 *M) +static void mdfour64(uint32_t *M) { - uint32 AA, BB, CC, DD; - uint32 A,B,C,D; + uint32_t AA, BB, CC, DD; + uint32_t A,B,C,D; A = m->A; B = m->B; C = m->C; D = m->D; AA = A; BB = B; CC = C; DD = D; @@ -83,7 +83,7 @@ static void mdfour64(uint32 *M) m->A = A; m->B = B; m->C = C; m->D = D; } -static void copy64(uint32 *M, const unsigned char *in) +static void copy64(uint32_t *M, const unsigned char *in) { int i; @@ -92,7 +92,7 @@ static void copy64(uint32 *M, const unsigned char *in) (in[i*4+1]<<8) | (in[i*4+0]<<0); } -static void copy4(unsigned char *out,uint32 x) +static void copy4(unsigned char *out, uint32_t x) { out[0] = x&0xFF; out[1] = (x>>8)&0xFF; @@ -114,8 +114,8 @@ void mdfour_begin(struct mdfour *md) static void mdfour_tail(const unsigned char *in, int n) { unsigned char buf[128]; - uint32 M[16]; - uint32 b; + uint32_t M[16]; + uint32_t b; m->totalN += n; @@ -140,7 +140,7 @@ static void mdfour_tail(const unsigned char *in, int n) void mdfour_update(struct mdfour *md, const unsigned char *in, int n) { - uint32 M[16]; + uint32_t M[16]; m = md; diff --git a/mdfour.h b/mdfour.h index 17dc82605..e31eeacd1 100644 --- a/mdfour.h +++ b/mdfour.h @@ -19,9 +19,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef MDFOUR_H +#define MDFOUR_H + +#include + struct mdfour { - uint32 A, B, C, D; - uint32 totalN; + uint32_t A, B, C, D; + uint32_t totalN; unsigned char tail[64]; unsigned tail_len; }; @@ -30,3 +35,5 @@ void mdfour_begin(struct mdfour *md); void mdfour_update(struct mdfour *md, const unsigned char *in, int n); void mdfour_result(struct mdfour *md, unsigned char *out); void mdfour(unsigned char *out, const unsigned char *in, int n); + +#endif