Skip to content

Commit d4738c8

Browse files
committed
CCBC-1596: Fix signatures in md5c-inl.h to use modern C style
In file included from src/vbucket/ketama.c:25: src/vbucket/rfc1321/md5c-inl.h:100:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] void MD5Init(context) MD5_CTX *context; /* context */ ^ src/vbucket/ketama.c:21:17: note: expanded from macro 'MD5Init' ^ In file included from src/vbucket/ketama.c:25: src/vbucket/rfc1321/md5c-inl.h:115:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] void MD5Update(context, input, inputLen) MD5_CTX *context; /* context */ ^ src/vbucket/ketama.c:22:19: note: expanded from macro 'MD5Update' ^ In file included from src/vbucket/ketama.c:25: src/vbucket/rfc1321/md5c-inl.h:151:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] void MD5Final(digest, context) unsigned char digest[16]; /* message digest */ ^ src/vbucket/ketama.c:20:18: note: expanded from macro 'MD5Final' ^ In file included from src/vbucket/ketama.c:25: src/vbucket/rfc1321/md5c-inl.h:179:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] static void MD5Transform(state, block) UINT4 state[4]; ^ src/vbucket/rfc1321/md5c-inl.h:179:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] src/vbucket/rfc1321/md5c-inl.h:271:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] static void Encode(output, input, len) unsigned char *output; ^ src/vbucket/rfc1321/md5c-inl.h:271:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] src/vbucket/rfc1321/md5c-inl.h:288:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] static void Decode(output, input, len) UINT4 *output; ^ src/vbucket/rfc1321/md5c-inl.h:288:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] src/vbucket/rfc1321/md5c-inl.h:302:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] static void MD5_memcpy(output, input, len) POINTER output; ^ src/vbucket/rfc1321/md5c-inl.h:302:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] src/vbucket/rfc1321/md5c-inl.h:314:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] static void MD5_memset(output, value, len) POINTER output; ^ src/vbucket/rfc1321/md5c-inl.h:314:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] Change-Id: Ibb4acd90be56ea1573d959fa5398e7e24cb6ab14 Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/190108 Reviewed-by: Brett Lawson <brett19@gmail.com> Reviewed-by: Trond Norbye <trond.norbye@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent b9e5b8a commit d4738c8

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

src/vbucket/rfc1321/md5c-inl.h

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static unsigned char PADDING[64] = {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9797

9898
/* MD5 initialization. Begins an MD5 operation, writing a new context.
9999
*/
100-
void MD5Init(context) MD5_CTX *context; /* context */
100+
void MD5Init(MD5_CTX *context)
101101
{
102102
context->count[0] = context->count[1] = 0;
103103
/* Load magic initialization constants.
@@ -112,9 +112,7 @@ void MD5Init(context) MD5_CTX *context; /* context */
112112
operation, processing another message block, and updating the
113113
context.
114114
*/
115-
void MD5Update(context, input, inputLen) MD5_CTX *context; /* context */
116-
unsigned char *input; /* input block */
117-
unsigned int inputLen; /* length of input block */
115+
void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
118116
{
119117
unsigned int i, ix, partLen;
120118

@@ -148,8 +146,7 @@ unsigned int inputLen; /* length of input bl
148146
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
149147
the message digest and zeroizing the context.
150148
*/
151-
void MD5Final(digest, context) unsigned char digest[16]; /* message digest */
152-
MD5_CTX *context; /* context */
149+
void MD5Final(unsigned char digest[16], MD5_CTX *context)
153150
{
154151
unsigned char bits[8];
155152
unsigned int ix, padLen;
@@ -176,8 +173,7 @@ MD5_CTX *context; /* context */
176173

177174
/* MD5 basic transformation. Transforms state based on block.
178175
*/
179-
static void MD5Transform(state, block) UINT4 state[4];
180-
unsigned char block[64];
176+
static void MD5Transform(UINT4 state[4], unsigned char block[64])
181177
{
182178
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
183179

@@ -268,9 +264,7 @@ unsigned char block[64];
268264
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
269265
a multiple of 4.
270266
*/
271-
static void Encode(output, input, len) unsigned char *output;
272-
UINT4 *input;
273-
unsigned int len;
267+
static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
274268
{
275269
unsigned int i, j;
276270

@@ -285,9 +279,7 @@ unsigned int len;
285279
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
286280
a multiple of 4.
287281
*/
288-
static void Decode(output, input, len) UINT4 *output;
289-
unsigned char *input;
290-
unsigned int len;
282+
static void Decode(UINT4 *output, unsigned char *input, unsigned int len)
291283
{
292284
unsigned int i, j;
293285

@@ -299,9 +291,7 @@ unsigned int len;
299291
/* Note: Replace "for loop" with standard memcpy if possible.
300292
*/
301293

302-
static void MD5_memcpy(output, input, len) POINTER output;
303-
POINTER input;
304-
unsigned int len;
294+
static void MD5_memcpy(POINTER output, POINTER input, unsigned int len)
305295
{
306296
unsigned int i;
307297

@@ -311,9 +301,7 @@ unsigned int len;
311301

312302
/* Note: Replace "for loop" with standard memset if possible.
313303
*/
314-
static void MD5_memset(output, value, len) POINTER output;
315-
int value;
316-
unsigned int len;
304+
static void MD5_memset(POINTER output, int value, unsigned int len)
317305
{
318306
unsigned int i;
319307

0 commit comments

Comments
 (0)