diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-09-11 21:54:32 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-09-11 21:54:32 +0300 |
commit | 1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c (patch) | |
tree | 09075f19d47fd81df20beb96e27e0f21ad2a0729 /contrib/pgcrypto/crypt-md5.c | |
parent | 02bca4f35164dd1873eab9b8e6167e42a79157c4 (diff) | |
download | postgresql-1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c.tar.gz postgresql-1b81c2fe6ee2b26d37610c3d381a87fa17af0a7c.zip |
Remove many -Wcast-qual warnings
This addresses only those cases that are easy to fix by adding or
moving a const qualifier or removing an unnecessary cast. There are
many more complicated cases remaining.
Diffstat (limited to 'contrib/pgcrypto/crypt-md5.c')
-rw-r--r-- | contrib/pgcrypto/crypt-md5.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c index 30eb8bf5a27..2215f38d8bf 100644 --- a/contrib/pgcrypto/crypt-md5.c +++ b/contrib/pgcrypto/crypt-md5.c @@ -72,18 +72,18 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) err = px_find_digest("md5", &ctx1); /* The password first, since that is what is most unknown */ - px_md_update(ctx, (uint8 *) pw, strlen(pw)); + px_md_update(ctx, (const uint8 *) pw, strlen(pw)); /* Then our magic string */ px_md_update(ctx, (uint8 *) magic, strlen(magic)); /* Then the raw salt */ - px_md_update(ctx, (uint8 *) sp, sl); + px_md_update(ctx, (const uint8 *) sp, sl); /* Then just as many characters of the MD5(pw,salt,pw) */ - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); - px_md_update(ctx1, (uint8 *) sp, sl); - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) sp, sl); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); px_md_finish(ctx1, final); for (pl = strlen(pw); pl > 0; pl -= MD5_SIZE) px_md_update(ctx, final, pl > MD5_SIZE ? MD5_SIZE : pl); @@ -96,7 +96,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) if (i & 1) px_md_update(ctx, final, 1); else - px_md_update(ctx, (uint8 *) pw, 1); + px_md_update(ctx, (const uint8 *) pw, 1); /* Now make the output string */ strcpy(passwd, magic); @@ -114,20 +114,20 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) { px_md_reset(ctx1); if (i & 1) - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); else px_md_update(ctx1, final, MD5_SIZE); if (i % 3) - px_md_update(ctx1, (uint8 *) sp, sl); + px_md_update(ctx1, (const uint8 *) sp, sl); if (i % 7) - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); if (i & 1) px_md_update(ctx1, final, MD5_SIZE); else - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); px_md_finish(ctx1, final); } |