summaryrefslogtreecommitdiff
path: root/src/sha256.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 21:10:09 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 21:10:09 +0100
commit764b23c8fd3369cb05ae9122abf3ca16fec539d7 (patch)
tree9f9c938d8f1d4d38aae0ea514eed94c89cb1aeb8 /src/sha256.c
parent055409764ca5f7978d4c399d2c440af0ce971c4f (diff)
downloadvim-git-764b23c8fd3369cb05ae9122abf3ca16fec539d7.tar.gz
patch 7.4.1214v7.4.1214
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
Diffstat (limited to 'src/sha256.c')
-rw-r--r--src/sha256.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/src/sha256.c b/src/sha256.c
index d65b72c0f..db916a691 100644
--- a/src/sha256.c
+++ b/src/sha256.c
@@ -43,8 +43,7 @@ static void sha256_process(context_sha256_T *ctx, char_u data[64]);
}
void
-sha256_start(ctx)
- context_sha256_T *ctx;
+sha256_start(context_sha256_T *ctx)
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -60,9 +59,7 @@ sha256_start(ctx)
}
static void
-sha256_process(ctx, data)
- context_sha256_T *ctx;
- char_u data[64];
+sha256_process(context_sha256_T *ctx, char_u data[64])
{
UINT32_T temp1, temp2, W[64];
UINT32_T A, B, C, D, E, F, G, H;
@@ -194,10 +191,7 @@ sha256_process(ctx, data)
}
void
-sha256_update(ctx, input, length)
- context_sha256_T *ctx;
- char_u *input;
- UINT32_T length;
+sha256_update(context_sha256_T *ctx, char_u *input, UINT32_T length)
{
UINT32_T left, fill;
@@ -241,9 +235,7 @@ static char_u sha256_padding[64] = {
};
void
-sha256_finish(ctx, digest)
- context_sha256_T *ctx;
- char_u digest[32];
+sha256_finish(context_sha256_T *ctx, char_u digest[32])
{
UINT32_T last, padn;
UINT32_T high, low;
@@ -280,11 +272,11 @@ static unsigned int get_some_time(void);
* if "salt" is not NULL also do "salt[salt_len]".
*/
char_u *
-sha256_bytes(buf, buf_len, salt, salt_len)
- char_u *buf;
- int buf_len;
- char_u *salt;
- int salt_len;
+sha256_bytes(
+ char_u *buf,
+ int buf_len,
+ char_u *salt,
+ int salt_len)
{
char_u sha256sum[32];
static char_u hexit[65];
@@ -308,10 +300,10 @@ sha256_bytes(buf, buf_len, salt, salt_len)
* Returns sha256(buf) as 64 hex chars in static array.
*/
char_u *
-sha256_key(buf, salt, salt_len)
- char_u *buf;
- char_u *salt;
- int salt_len;
+sha256_key(
+ char_u *buf,
+ char_u *salt,
+ int salt_len)
{
/* No passwd means don't encrypt */
if (buf == NULL || *buf == NUL)
@@ -344,7 +336,7 @@ static char *sha_self_test_vector[] = {
* Return FAIL or OK.
*/
int
-sha256_self_test()
+sha256_self_test(void)
{
int i, j;
char output[65];
@@ -389,7 +381,7 @@ sha256_self_test()
}
static unsigned int
-get_some_time()
+get_some_time(void)
{
# ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
@@ -407,11 +399,11 @@ get_some_time()
* Also "salt[salt_len]" when "salt" is not NULL.
*/
void
-sha2_seed(header, header_len, salt, salt_len)
- char_u *header;
- int header_len;
- char_u *salt;
- int salt_len;
+sha2_seed(
+ char_u *header,
+ int header_len,
+ char_u *salt,
+ int salt_len)
{
int i;
static char_u random_data[1000];