Skip to content

Commit 090add1

Browse files
rsalvaterrarobimarko
authored andcommitted
mtd: fix building with GCC 15.1
Convert old style declarations to modern ones. Signed-off-by: Rui Salvaterra <[email protected]> Link: openwrt/openwrt#18600 Signed-off-by: Robert Marko <[email protected]>
1 parent a6ab705 commit 090add1

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

package/system/mtd/src/md5.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*/
4949

5050
/* forward declaration */
51-
static void Transform ();
51+
static void Transform (UINT4 *buf, UINT4 *in);
5252

5353
static unsigned char PADDING[64] = {
5454
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -102,8 +102,7 @@ static unsigned char PADDING[64] = {
102102
/* The routine MD5_Init initializes the message-digest context
103103
mdContext. All fields are set to zero.
104104
*/
105-
void MD5_Init (mdContext)
106-
MD5_CTX *mdContext;
105+
void MD5_Init (MD5_CTX *mdContext)
107106
{
108107
mdContext->i[0] = mdContext->i[1] = (UINT4)0;
109108

@@ -119,10 +118,7 @@ MD5_CTX *mdContext;
119118
account for the presence of each of the characters inBuf[0..inLen-1]
120119
in the message whose digest is being computed.
121120
*/
122-
void MD5_Update (mdContext, inBuf, inLen)
123-
MD5_CTX *mdContext;
124-
unsigned char *inBuf;
125-
unsigned int inLen;
121+
void MD5_Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen)
126122
{
127123
UINT4 in[16];
128124
int mdi;
@@ -157,9 +153,7 @@ unsigned int inLen;
157153
/* The routine MD5Final terminates the message-digest computation and
158154
ends with the desired message digest in mdContext->digest[0...15].
159155
*/
160-
void MD5_Final (hash, mdContext)
161-
unsigned char hash[];
162-
MD5_CTX *mdContext;
156+
void MD5_Final (unsigned char hash[], MD5_CTX *mdContext)
163157
{
164158
UINT4 in[16];
165159
int mdi;
@@ -200,9 +194,7 @@ MD5_CTX *mdContext;
200194

201195
/* Basic MD5 step. Transforms buf based on in.
202196
*/
203-
static void Transform (buf, in)
204-
UINT4 *buf;
205-
UINT4 *in;
197+
static void Transform (UINT4 *buf, UINT4 *in)
206198
{
207199
UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
208200

package/system/mtd/src/md5.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ typedef struct {
5757
unsigned char digest[16]; /* actual digest after MD5Final call */
5858
} MD5_CTX;
5959

60-
void MD5_Init ();
61-
void MD5_Update ();
62-
void MD5_Final ();
60+
void MD5_Init (MD5_CTX *mdContext);
61+
void MD5_Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
62+
void MD5_Final (unsigned char hash[], MD5_CTX *mdContext);
6363

6464
#define __MD5_INCLUDE__
6565
#endif /* __MD5_INCLUDE__ */

0 commit comments

Comments
 (0)