From 9544456b9d2679b02e95ae96646b5d27813944cf Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 9 Aug 2015 00:34:02 +1000 Subject: remove unused variables in xn__next --- src/openssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 84a0155..5a69f99 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -2941,9 +2941,8 @@ static int xn__next(lua_State *L) { X509_NAME *name = checksimple(L, lua_upvalueindex(1), X509_NAME_CLASS); X509_NAME_ENTRY *entry; ASN1_OBJECT *obj; - const char *id; char txt[256]; - int i, n, nid, len; + int i, n, len; lua_settop(L, 0); -- cgit v1.2.3-59-g8ed1b From ae502efbb770605babdf3f73aedfc19be42fe426 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 9 Aug 2015 00:37:33 +1000 Subject: removed unused warning across #if --- src/openssl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 5a69f99..9c0f852 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -1208,6 +1208,7 @@ static void ex_newstate(lua_State *L) { * Instead, we'll install our own panic handlers. */ #if defined LUA_RIDX_MAINTHREAD + (void)thr; lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD); state->L = lua_tothread(L, -1); lua_pop(L, 1); -- cgit v1.2.3-59-g8ed1b From dd9216f46e2f2a3f55dcf4486db8bb36a4f48fdb Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 9 Aug 2015 00:34:16 +1000 Subject: remove trailing whitespace --- src/openssl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 9c0f852..e8ec0f4 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -314,7 +314,7 @@ static int badoption(lua_State *L, int index, const char *opt) { static int checkoption(lua_State *L, int index, const char *def, const char *const opts[]) { const char *opt = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index); - int i; + int i; for (i = 0; opts[i]; i++) { if (strieq(opts[i], opt)) @@ -3826,7 +3826,7 @@ static double timeutc(ASN1_TIME *time) { gmtoff *= sign; } - + return tm2unix(&tm, gmtoff); badfmt: return INFINITY; @@ -7114,7 +7114,7 @@ static unsigned long long rand_llu(lua_State *L) { * The following algorithm for rand_uniform() is taken from OpenBSD's * arc4random_uniform, written by Otto Moerbeek, with subsequent * simplification by Jorden Verwer. Otto's source code comment reads - * + * * Uniformity is achieved by generating new random numbers until the one * returned is outside the range [0, 2**32 % upper_bound). This guarantees * the selected random number will be inside [2**32 % upper_bound, 2**32) @@ -7137,22 +7137,22 @@ static unsigned long long rand_llu(lua_State *L) { * X-Complaints-To: ne...@news.purdue.edu * NNTP-Posting-Date: Thu, 14 Nov 2002 16:20:37 +0000 (UTC) * Xref: archiver1.google.com sci.crypt:78935 - * + * * In article <3DCD8D7...@nospam.com>, * Michael Amling wrote: * >Carlos Moreno wrote: - * + * * I have already posted on this, but a repeat might be * in order. - * + * * If one can trust random bits, the most bitwise efficient * manner to get a single random integer between 0 and N-1 * can be obtained as follows; the code can be made more * computationally efficient. I believe it is easier to * understand with gotos. I am assuming N>1. - * + * * i = 0; j = 1; - * + * * loop: j=2*j; i=2*i+RANBIT; * if (j < N) goto loop; * if (i >= N) { @@ -7160,14 +7160,14 @@ static unsigned long long rand_llu(lua_State *L) { * j = j - N; * goto loop:} * else return (i); - * + * * The algorithm works because at each stage i is uniform * between 0 and j-1. - * + * * Another possibility is to generate k bits, where 2^k >= N. * If 2^k = c*N + remainder, generate the appropriate value * if a k-bit random number is less than c*N. - * + * * For N = 17 (numbers just larger than powers of 2 are "bad"), * the amount of information is about 4.09 bits, the best * algorithm to generate one random number takes about 5.765 @@ -7345,7 +7345,7 @@ static int mt_init(void) { int i; mt_state.nlock = CRYPTO_num_locks(); - + if (!(mt_state.lock = malloc(mt_state.nlock * sizeof *mt_state.lock))) { error = errno; goto epilog; -- cgit v1.2.3-59-g8ed1b From 9c3b4678c321ac6370faa9d3c2643dace2eaabf0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 18 Dec 2015 22:30:59 +1100 Subject: Give auxL_getref NOTUSED attribute --- src/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index e8ec0f4..93e069f 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -620,7 +620,7 @@ static void auxL_ref(lua_State *L, int index, auxref_t *ref) { *ref = luaL_ref(L, LUA_REGISTRYINDEX); } /* auxL_ref() */ -static auxtype_t auxL_getref(lua_State *L, auxref_t ref) { +NOTUSED static auxtype_t auxL_getref(lua_State *L, auxref_t ref) { if (ref == LUA_NOREF || ref == LUA_REFNIL) { lua_pushnil(L); } else { -- cgit v1.2.3-59-g8ed1b