Mark some global vars as const and static and some static local vars as const

This way the compiler puts those vars in .rodata instead of .data and everyone
happy. (Plus we have one symbol less exported)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1241 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-10-07 13:45:34 +00:00
parent 92a718e3a6
commit 2573b6408e
4 changed files with 7 additions and 9 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ void CMD5::md5_starts(md5_context *ctx) const {
ctx->state[3] = 0x10325476;
}
void CMD5::md5_process(md5_context *ctx, uint8 data[64]) const {
void CMD5::md5_process(md5_context *ctx, const uint8 data[64]) const {
uint32 X[16], A, B, C, D;
GET_UINT32(X[0], data, 0);
@@ -180,7 +180,7 @@ void CMD5::md5_process(md5_context *ctx, uint8 data[64]) const {
ctx->state[3] += D;
}
void CMD5::md5_update(md5_context *ctx, uint8 *input, uint32 length) const {
void CMD5::md5_update(md5_context *ctx, const uint8 *input, uint32 length) const {
uint32 left, fill;
if (!length) return;
@@ -215,7 +215,7 @@ void CMD5::md5_update(md5_context *ctx, uint8 *input, uint32 length) const {
}
}
static uint8 md5_padding[64] = {
static const uint8 md5_padding[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,