helper.pl - improved detection of static functions without _
(cherry picked from commit 5c34fb2bad2cc23fc2c038158a606d7b83c33170)
This commit is contained in:
parent
a674de7408
commit
f10c2055dc
@ -60,8 +60,8 @@ sub check_source {
|
|||||||
$file !~ m|src/hashes/.*\.c$| &&
|
$file !~ m|src/hashes/.*\.c$| &&
|
||||||
$file !~ m|src/math/.+_desc.c$| &&
|
$file !~ m|src/math/.+_desc.c$| &&
|
||||||
$file !~ m|src/stream/sober128/sober128_stream.c$| &&
|
$file !~ m|src/stream/sober128/sober128_stream.c$| &&
|
||||||
$l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
|
$l =~ /^static(\s+\S+)+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
|
||||||
push @{$troubles->{staticfunc_name}}, "$lineno($1)";
|
push @{$troubles->{staticfunc_name}}, "$lineno($2)";
|
||||||
}
|
}
|
||||||
$lineno++;
|
$lineno++;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#if defined(LTC_DEVRANDOM) && !defined(_WIN32)
|
#if defined(LTC_DEVRANDOM) && !defined(_WIN32)
|
||||||
/* on *NIX read /dev/random */
|
/* 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))
|
void (*callback)(void))
|
||||||
{
|
{
|
||||||
#ifdef LTC_NO_FILE
|
#ifdef LTC_NO_FILE
|
||||||
@ -56,7 +56,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len,
|
|||||||
|
|
||||||
#define ANSI_RNG
|
#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))
|
void (*callback)(void))
|
||||||
{
|
{
|
||||||
clock_t t1;
|
clock_t t1;
|
||||||
@ -97,7 +97,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
|
|
||||||
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))
|
void (*callback)(void))
|
||||||
{
|
{
|
||||||
HCRYPTPROV hProv = 0;
|
HCRYPTPROV hProv = 0;
|
||||||
@ -143,12 +143,12 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN32_WCE)
|
#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)
|
#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
|
#endif
|
||||||
#ifdef ANSI_RNG
|
#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
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user