Convert the rest of the codebase to C89.

Update build system to enforce -std=c89 -pedantic.
This commit is contained in:
Gregory Maxwell
2015-01-25 17:32:08 +00:00
parent bf2e1ac7cd
commit f735446c4d
15 changed files with 279 additions and 196 deletions

View File

@@ -21,9 +21,10 @@ typedef struct {
} benchmark_verify_t;
static void benchmark_verify(void* arg) {
int i;
benchmark_verify_t* data = (benchmark_verify_t*)arg;
for (int i=0; i<20000; i++) {
for (i = 0; i < 20000; i++) {
data->sig[data->siglen - 1] ^= (i & 0xFF);
data->sig[data->siglen - 2] ^= ((i >> 8) & 0xFF);
data->sig[data->siglen - 3] ^= ((i >> 16) & 0xFF);
@@ -35,12 +36,13 @@ static void benchmark_verify(void* arg) {
}
int main(void) {
secp256k1_start(SECP256K1_START_VERIFY | SECP256K1_START_SIGN);
int i;
benchmark_verify_t data;
for (int i = 0; i < 32; i++) data.msg[i] = 1 + i;
for (int i = 0; i < 32; i++) data.key[i] = 33 + i;
secp256k1_start(SECP256K1_START_VERIFY | SECP256K1_START_SIGN);
for (i = 0; i < 32; i++) data.msg[i] = 1 + i;
for (i = 0; i < 32; i++) data.key[i] = 33 + i;
data.siglen = 72;
secp256k1_ecdsa_sign(data.msg, data.sig, &data.siglen, data.key, NULL, NULL);
data.pubkeylen = 33;