Skip to content

Commit f10c205

Browse files
karel-msjaeckel
authored andcommitted
helper.pl - improved detection of static functions without _
(cherry picked from commit 5c34fb2)
1 parent a674de7 commit f10c205

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

helper.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ sub check_source {
6060
$file !~ m|src/hashes/.*\.c$| &&
6161
$file !~ m|src/math/.+_desc.c$| &&
6262
$file !~ m|src/stream/sober128/sober128_stream.c$| &&
63-
$l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
64-
push @{$troubles->{staticfunc_name}}, "$lineno($1)";
63+
$l =~ /^static(\s+\S+)+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
64+
push @{$troubles->{staticfunc_name}}, "$lineno($2)";
6565
}
6666
$lineno++;
6767
}

src/prngs/rng_get_bytes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#if defined(LTC_DEVRANDOM) && !defined(_WIN32)
1818
/* on *NIX read /dev/random */
19-
static unsigned long rng_nix(unsigned char *buf, unsigned long len,
19+
static unsigned long _rng_nix(unsigned char *buf, unsigned long len,
2020
void (*callback)(void))
2121
{
2222
#ifdef LTC_NO_FILE
@@ -56,7 +56,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len,
5656

5757
#define ANSI_RNG
5858

59-
static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
59+
static unsigned long _rng_ansic(unsigned char *buf, unsigned long len,
6060
void (*callback)(void))
6161
{
6262
clock_t t1;
@@ -97,7 +97,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
9797
#include <windows.h>
9898
#include <wincrypt.h>
9999

100-
static unsigned long rng_win32(unsigned char *buf, unsigned long len,
100+
static unsigned long _rng_win32(unsigned char *buf, unsigned long len,
101101
void (*callback)(void))
102102
{
103103
HCRYPTPROV hProv = 0;
@@ -143,12 +143,12 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen,
143143
#endif
144144

145145
#if defined(_WIN32) || defined(_WIN32_WCE)
146-
x = rng_win32(out, outlen, callback); if (x != 0) { return x; }
146+
x = _rng_win32(out, outlen, callback); if (x != 0) { return x; }
147147
#elif defined(LTC_DEVRANDOM)
148-
x = rng_nix(out, outlen, callback); if (x != 0) { return x; }
148+
x = _rng_nix(out, outlen, callback); if (x != 0) { return x; }
149149
#endif
150150
#ifdef ANSI_RNG
151-
x = rng_ansic(out, outlen, callback); if (x != 0) { return x; }
151+
x = _rng_ansic(out, outlen, callback); if (x != 0) { return x; }
152152
#endif
153153
return 0;
154154
}

0 commit comments

Comments
 (0)