From ee47eaceaa148e07b566ff420f9a3c2edde2fa34 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Wed, 29 Jun 2022 12:55:36 +0100 Subject: patch 9.0.0003: functions are global while they could be local Problem: Functions are global while they could be local. Solution: Add "static". Add a few tests. (Yegappan Lakshmanan, closes #10612) --- src/crypt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/crypt.c') diff --git a/src/crypt.c b/src/crypt.c index bed76a96d..b2b50d463 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -73,6 +73,10 @@ typedef struct { char_u *p2, int last); } cryptmethod_T; +static int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); +static long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last); +static long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last); + // index is method_nr of cryptstate_T, CRYPT_M_* static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { // PK_Zip; very weak @@ -850,7 +854,7 @@ crypt_append_msg( } } - int + static int crypt_sodium_init( cryptstate_T *state UNUSED, char_u *key UNUSED, @@ -1030,7 +1034,7 @@ fail: * Encrypt "from[len]" into "to[len]". * "from" and "to" can be equal to encrypt in place. */ - long + static long crypt_sodium_buffer_encode( cryptstate_T *state UNUSED, char_u *from UNUSED, @@ -1080,7 +1084,7 @@ crypt_sodium_buffer_encode( * Decrypt "from[len]" into "to[len]". * "from" and "to" can be equal to encrypt in place. */ - long + static long crypt_sodium_buffer_decode( cryptstate_T *state UNUSED, char_u *from UNUSED, -- cgit v1.2.1