Use C99 for size_t loops.
This was done just by grepping for 'size_t i;' and 'size_t j;'. I left
everything in crypto/x509 and friends alone.
There's some instances in gcm.c that are non-trivial and pulled into a
separate CL for ease of review.
Change-Id: I6515804e3097f7e90855f1e7610868ee87117223
Reviewed-on: https://boringssl-review.googlesource.com/10801
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index bdc1074..04a1411 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2533,13 +2533,12 @@
static int cbb_add_hex(CBB *cbb, const uint8_t *in, size_t in_len) {
static const char hextable[] = "0123456789abcdef";
uint8_t *out;
- size_t i;
if (!CBB_add_space(cbb, &out, in_len * 2)) {
return 0;
}
- for (i = 0; i < in_len; i++) {
+ for (size_t i = 0; i < in_len; i++) {
*(out++) = (uint8_t)hextable[in[i] >> 4];
*(out++) = (uint8_t)hextable[in[i] & 0xf];
}
@@ -2708,9 +2707,8 @@
* as a min/max range by picking the lowest contiguous non-empty range of
* enabled protocols. Note that this means it is impossible to set a maximum
* version of the higest supported TLS version in a future-proof way. */
- size_t i;
int any_enabled = 0;
- for (i = 0; i < kVersionsLen; i++) {
+ for (size_t i = 0; i < kVersionsLen; i++) {
/* Only look at the versions already enabled. */
if (min_version > kVersions[i].version) {
continue;