summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Ahern <william@25thandClement.com>2015-12-21 16:25:37 +0800
committerWilliam Ahern <william@25thandClement.com>2015-12-21 16:25:37 +0800
commite3e33aee0b6ae6454ef2fcb2826124d9d575041f (patch)
treeb779956fee4a194b91e32706c6ca8a6f9ab1b155
parentc81ff42854474dbc7f8e1fa617a33bff531d8a97 (diff)
parentea643d16a28f5d5059ed295605fca8c9b4f2c422 (diff)
downloadluaossl-e3e33aee0b6ae6454ef2fcb2826124d9d575041f.tar.gz
luaossl-e3e33aee0b6ae6454ef2fcb2826124d9d575041f.tar.bz2
luaossl-e3e33aee0b6ae6454ef2fcb2826124d9d575041f.zip
Merge branch 'daurnimator-remove-warnings'
-rw-r--r--src/openssl.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 7247616..afd1f61 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -314,7 +314,7 @@ static int badoption(lua_State *L, int index, const char *opt) {
314 314
315static int checkoption(lua_State *L, int index, const char *def, const char *const opts[]) { 315static int checkoption(lua_State *L, int index, const char *def, const char *const opts[]) {
316 const char *opt = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index); 316 const char *opt = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index);
317 int i; 317 int i;
318 318
319 for (i = 0; opts[i]; i++) { 319 for (i = 0; opts[i]; i++) {
320 if (strieq(opts[i], opt)) 320 if (strieq(opts[i], opt))
@@ -620,7 +620,7 @@ static void auxL_ref(lua_State *L, int index, auxref_t *ref) {
620 *ref = luaL_ref(L, LUA_REGISTRYINDEX); 620 *ref = luaL_ref(L, LUA_REGISTRYINDEX);
621} /* auxL_ref() */ 621} /* auxL_ref() */
622 622
623static auxtype_t auxL_getref(lua_State *L, auxref_t ref) { 623NOTUSED static auxtype_t auxL_getref(lua_State *L, auxref_t ref) {
624 if (ref == LUA_NOREF || ref == LUA_REFNIL) { 624 if (ref == LUA_NOREF || ref == LUA_REFNIL) {
625 lua_pushnil(L); 625 lua_pushnil(L);
626 } else { 626 } else {
@@ -1208,6 +1208,7 @@ static void ex_newstate(lua_State *L) {
1208 * Instead, we'll install our own panic handlers. 1208 * Instead, we'll install our own panic handlers.
1209 */ 1209 */
1210#if defined LUA_RIDX_MAINTHREAD 1210#if defined LUA_RIDX_MAINTHREAD
1211 (void)thr;
1211 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD); 1212 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD);
1212 state->L = lua_tothread(L, -1); 1213 state->L = lua_tothread(L, -1);
1213 lua_pop(L, 1); 1214 lua_pop(L, 1);
@@ -2945,9 +2946,8 @@ static int xn__next(lua_State *L) {
2945 X509_NAME *name = checksimple(L, lua_upvalueindex(1), X509_NAME_CLASS); 2946 X509_NAME *name = checksimple(L, lua_upvalueindex(1), X509_NAME_CLASS);
2946 X509_NAME_ENTRY *entry; 2947 X509_NAME_ENTRY *entry;
2947 ASN1_OBJECT *obj; 2948 ASN1_OBJECT *obj;
2948 const char *id;
2949 char txt[256]; 2949 char txt[256];
2950 int i, n, nid, len; 2950 int i, n, len;
2951 2951
2952 lua_settop(L, 0); 2952 lua_settop(L, 0);
2953 2953
@@ -3830,7 +3830,7 @@ static double timeutc(ASN1_TIME *time) {
3830 3830
3831 gmtoff *= sign; 3831 gmtoff *= sign;
3832 } 3832 }
3833 3833
3834 return tm2unix(&tm, gmtoff); 3834 return tm2unix(&tm, gmtoff);
3835badfmt: 3835badfmt:
3836 return INFINITY; 3836 return INFINITY;
@@ -7118,7 +7118,7 @@ static unsigned long long rand_llu(lua_State *L) {
7118 * The following algorithm for rand_uniform() is taken from OpenBSD's 7118 * The following algorithm for rand_uniform() is taken from OpenBSD's
7119 * arc4random_uniform, written by Otto Moerbeek, with subsequent 7119 * arc4random_uniform, written by Otto Moerbeek, with subsequent
7120 * simplification by Jorden Verwer. Otto's source code comment reads 7120 * simplification by Jorden Verwer. Otto's source code comment reads
7121 * 7121 *
7122 * Uniformity is achieved by generating new random numbers until the one 7122 * Uniformity is achieved by generating new random numbers until the one
7123 * returned is outside the range [0, 2**32 % upper_bound). This guarantees 7123 * returned is outside the range [0, 2**32 % upper_bound). This guarantees
7124 * the selected random number will be inside [2**32 % upper_bound, 2**32) 7124 * the selected random number will be inside [2**32 % upper_bound, 2**32)
@@ -7141,22 +7141,22 @@ static unsigned long long rand_llu(lua_State *L) {
7141 * X-Complaints-To: ne...@news.purdue.edu 7141 * X-Complaints-To: ne...@news.purdue.edu
7142 * NNTP-Posting-Date: Thu, 14 Nov 2002 16:20:37 +0000 (UTC) 7142 * NNTP-Posting-Date: Thu, 14 Nov 2002 16:20:37 +0000 (UTC)
7143 * Xref: archiver1.google.com sci.crypt:78935 7143 * Xref: archiver1.google.com sci.crypt:78935
7144 * 7144 *
7145 * In article <3DCD8D7...@nospam.com>, 7145 * In article <3DCD8D7...@nospam.com>,
7146 * Michael Amling <nos...@nospam.com> wrote: 7146 * Michael Amling <nos...@nospam.com> wrote:
7147 * >Carlos Moreno wrote: 7147 * >Carlos Moreno wrote:
7148 * 7148 *
7149 * I have already posted on this, but a repeat might be 7149 * I have already posted on this, but a repeat might be
7150 * in order. 7150 * in order.
7151 * 7151 *
7152 * If one can trust random bits, the most bitwise efficient 7152 * If one can trust random bits, the most bitwise efficient
7153 * manner to get a single random integer between 0 and N-1 7153 * manner to get a single random integer between 0 and N-1
7154 * can be obtained as follows; the code can be made more 7154 * can be obtained as follows; the code can be made more
7155 * computationally efficient. I believe it is easier to 7155 * computationally efficient. I believe it is easier to
7156 * understand with gotos. I am assuming N>1. 7156 * understand with gotos. I am assuming N>1.
7157 * 7157 *
7158 * i = 0; j = 1; 7158 * i = 0; j = 1;
7159 * 7159 *
7160 * loop: j=2*j; i=2*i+RANBIT; 7160 * loop: j=2*j; i=2*i+RANBIT;
7161 * if (j < N) goto loop; 7161 * if (j < N) goto loop;
7162 * if (i >= N) { 7162 * if (i >= N) {
@@ -7164,14 +7164,14 @@ static unsigned long long rand_llu(lua_State *L) {
7164 * j = j - N; 7164 * j = j - N;
7165 * goto loop:} 7165 * goto loop:}
7166 * else return (i); 7166 * else return (i);
7167 * 7167 *
7168 * The algorithm works because at each stage i is uniform 7168 * The algorithm works because at each stage i is uniform
7169 * between 0 and j-1. 7169 * between 0 and j-1.
7170 * 7170 *
7171 * Another possibility is to generate k bits, where 2^k >= N. 7171 * Another possibility is to generate k bits, where 2^k >= N.
7172 * If 2^k = c*N + remainder, generate the appropriate value 7172 * If 2^k = c*N + remainder, generate the appropriate value
7173 * if a k-bit random number is less than c*N. 7173 * if a k-bit random number is less than c*N.
7174 * 7174 *
7175 * For N = 17 (numbers just larger than powers of 2 are "bad"), 7175 * For N = 17 (numbers just larger than powers of 2 are "bad"),
7176 * the amount of information is about 4.09 bits, the best 7176 * the amount of information is about 4.09 bits, the best
7177 * algorithm to generate one random number takes about 5.765 7177 * algorithm to generate one random number takes about 5.765
@@ -7349,7 +7349,7 @@ static int mt_init(void) {
7349 int i; 7349 int i;
7350 7350
7351 mt_state.nlock = CRYPTO_num_locks(); 7351 mt_state.nlock = CRYPTO_num_locks();
7352 7352
7353 if (!(mt_state.lock = malloc(mt_state.nlock * sizeof *mt_state.lock))) { 7353 if (!(mt_state.lock = malloc(mt_state.nlock * sizeof *mt_state.lock))) {
7354 error = errno; 7354 error = errno;
7355 goto epilog; 7355 goto epilog;