Skip to content

Commit 4b3b07f

Browse files
committed
Resolve one unconstify use
A small API change makes it unnecessary. Reported-by: Mark Dilger <hornschnorter@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/53a28052-f9f3-1808-fed9-460fd43035ab%402ndquadrant.com
1 parent 49fa99e commit 4b3b07f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/pgcrypto/md5.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static const uint8 md5_paddat[MD5_BUFLEN] = {
132132
0, 0, 0, 0, 0, 0, 0, 0,
133133
};
134134

135-
static void md5_calc(uint8 *, md5_ctxt *);
135+
static void md5_calc(const uint8 *, md5_ctxt *);
136136

137137
void
138138
md5_init(md5_ctxt *ctxt)
@@ -161,7 +161,7 @@ md5_loop(md5_ctxt *ctxt, const uint8 *input, unsigned len)
161161
md5_calc(ctxt->md5_buf, ctxt);
162162

163163
for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN)
164-
md5_calc(unconstify(uint8 *, (input + i)), ctxt);
164+
md5_calc(input + i, ctxt);
165165

166166
ctxt->md5_i = len - i;
167167
memmove(ctxt->md5_buf, input + i, ctxt->md5_i);
@@ -242,15 +242,15 @@ static uint32 X[16];
242242
#endif
243243

244244
static void
245-
md5_calc(uint8 *b64, md5_ctxt *ctxt)
245+
md5_calc(const uint8 *b64, md5_ctxt *ctxt)
246246
{
247247
uint32 A = ctxt->md5_sta;
248248
uint32 B = ctxt->md5_stb;
249249
uint32 C = ctxt->md5_stc;
250250
uint32 D = ctxt->md5_std;
251251

252252
#ifndef WORDS_BIGENDIAN
253-
uint32 *X = (uint32 *) b64;
253+
const uint32 *X = (const uint32 *) b64;
254254
#else
255255
/* 4 byte words */
256256
/* what a brute force but fast! */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy