Add a 'git__' prefix to the block-sha1 functions This reduces the global namespace pollution. These functions were the only remaining external symbols (with the exception of an PPC_SHA1 build) which did not start with 'git', and since these are private library symbols the 'git__' prefix is appropriate. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/src/block-sha1/sha1.c b/src/block-sha1/sha1.c
index e3409fb..8c14601 100644
--- a/src/block-sha1/sha1.c
+++ b/src/block-sha1/sha1.c
@@ -221,7 +221,7 @@ static void blk_SHA1_Block(blk_SHA_CTX *ctx, const unsigned int *data)
ctx->H[4] += E;
}
-void blk_SHA1_Init(blk_SHA_CTX *ctx)
+void git__blk_SHA1_Init(blk_SHA_CTX *ctx)
{
ctx->size = 0;
@@ -233,7 +233,7 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx)
ctx->H[4] = 0xc3d2e1f0;
}
-void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
+void git__blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
{
unsigned int lenW = ctx->size & 63;
@@ -261,7 +261,7 @@ void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
memcpy(ctx->W, data, len);
}
-void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
+void git__blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
{
static const unsigned char pad[64] = { 0x80 };
unsigned int padlen[2];
@@ -272,8 +272,8 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
padlen[1] = htonl((uint32_t)(ctx->size << 3));
i = ctx->size & 63;
- blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));
- blk_SHA1_Update(ctx, padlen, 8);
+ git__blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));
+ git__blk_SHA1_Update(ctx, padlen, 8);
/* Output hash */
for (i = 0; i < 5; i++)
diff --git a/src/block-sha1/sha1.h b/src/block-sha1/sha1.h
index bb2bad2..558d6ae 100644
--- a/src/block-sha1/sha1.h
+++ b/src/block-sha1/sha1.h
@@ -12,11 +12,11 @@ typedef struct {
unsigned int W[16];
} blk_SHA_CTX;
-void blk_SHA1_Init(blk_SHA_CTX *ctx);
-void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
-void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
+void git__blk_SHA1_Init(blk_SHA_CTX *ctx);
+void git__blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
+void git__blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
#define SHA_CTX blk_SHA_CTX
-#define SHA1_Init blk_SHA1_Init
-#define SHA1_Update blk_SHA1_Update
-#define SHA1_Final blk_SHA1_Final
+#define SHA1_Init git__blk_SHA1_Init
+#define SHA1_Update git__blk_SHA1_Update
+#define SHA1_Final git__blk_SHA1_Final