From f10c2055dc594063f0a4d0b6c8afc653f33a597f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 5 Nov 2017 11:40:01 +0100 Subject: [PATCH] helper.pl - improved detection of static functions without _ (cherry picked from commit 5c34fb2bad2cc23fc2c038158a606d7b83c33170) --- helper.pl | 4 ++-- src/prngs/rng_get_bytes.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helper.pl b/helper.pl index 4e437fa..bd32378 100755 --- a/helper.pl +++ b/helper.pl @@ -60,8 +60,8 @@ sub check_source { $file !~ m|src/hashes/.*\.c$| && $file !~ m|src/math/.+_desc.c$| && $file !~ m|src/stream/sober128/sober128_stream.c$| && - $l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) { - push @{$troubles->{staticfunc_name}}, "$lineno($1)"; + $l =~ /^static(\s+\S+)+\s+([^_][a-zA-Z0-9_]+)\s*\(/) { + push @{$troubles->{staticfunc_name}}, "$lineno($2)"; } $lineno++; } diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 8a9fbb2..4e9a063 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -16,7 +16,7 @@ #if defined(LTC_DEVRANDOM) && !defined(_WIN32) /* on *NIX read /dev/random */ -static unsigned long rng_nix(unsigned char *buf, unsigned long len, +static unsigned long _rng_nix(unsigned char *buf, unsigned long len, void (*callback)(void)) { #ifdef LTC_NO_FILE @@ -56,7 +56,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, #define ANSI_RNG -static unsigned long rng_ansic(unsigned char *buf, unsigned long len, +static unsigned long _rng_ansic(unsigned char *buf, unsigned long len, void (*callback)(void)) { clock_t t1; @@ -97,7 +97,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, #include #include -static unsigned long rng_win32(unsigned char *buf, unsigned long len, +static unsigned long _rng_win32(unsigned char *buf, unsigned long len, void (*callback)(void)) { HCRYPTPROV hProv = 0; @@ -143,12 +143,12 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, #endif #if defined(_WIN32) || defined(_WIN32_WCE) - x = rng_win32(out, outlen, callback); if (x != 0) { return x; } + x = _rng_win32(out, outlen, callback); if (x != 0) { return x; } #elif defined(LTC_DEVRANDOM) - x = rng_nix(out, outlen, callback); if (x != 0) { return x; } + x = _rng_nix(out, outlen, callback); if (x != 0) { return x; } #endif #ifdef ANSI_RNG - x = rng_ansic(out, outlen, callback); if (x != 0) { return x; } + x = _rng_ansic(out, outlen, callback); if (x != 0) { return x; } #endif return 0; }