Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-09-05 19:47:25 +0300
committerCQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>2016-09-12 22:44:24 +0300
commit54091230cda42d62f50af20185dfb8b6bbc5bd1d (patch)
treed2fd5537b2d59030c8be4f730ad78cb0ee9f6aac /ssl/d1_both.c
parentc763a401014191090edf68faa48a56fc9b75f3c7 (diff)
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>
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r--ssl/d1_both.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 712c63b7..5ea29da4 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -217,7 +217,6 @@ static uint8_t bit_range(size_t start, size_t end) {
* and |frag->reassembly| must not be NULL. */
static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start,
size_t end) {
- size_t i;
size_t msg_len = frag->msg_len;
if (frag->reassembly == NULL || start > end || end > msg_len) {
@@ -231,7 +230,7 @@ static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start,
frag->reassembly[start >> 3] |= bit_range(start & 7, end & 7);
} else {
frag->reassembly[start >> 3] |= bit_range(start & 7, 8);
- for (i = (start >> 3) + 1; i < (end >> 3); i++) {
+ for (size_t i = (start >> 3) + 1; i < (end >> 3); i++) {
frag->reassembly[i] = 0xff;
}
if ((end & 7) != 0) {
@@ -240,7 +239,7 @@ static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start,
}
/* Check if the fragment is complete. */
- for (i = 0; i < (msg_len >> 3); i++) {
+ for (size_t i = 0; i < (msg_len >> 3); i++) {
if (frag->reassembly[i] != 0xff) {
return;
}
@@ -681,8 +680,7 @@ err:
}
void dtls_clear_outgoing_messages(SSL *ssl) {
- size_t i;
- for (i = 0; i < ssl->d1->outgoing_messages_len; i++) {
+ for (size_t i = 0; i < ssl->d1->outgoing_messages_len; i++) {
OPENSSL_free(ssl->d1->outgoing_messages[i].data);
ssl->d1->outgoing_messages[i].data = NULL;
}
@@ -816,8 +814,7 @@ int dtls1_retransmit_outgoing_messages(SSL *ssl) {
assert(ssl_is_wbio_buffered(ssl));
int ret = -1;
- size_t i;
- for (i = 0; i < ssl->d1->outgoing_messages_len; i++) {
+ for (size_t i = 0; i < ssl->d1->outgoing_messages_len; i++) {
if (dtls1_retransmit_message(ssl, &ssl->d1->outgoing_messages[i]) <= 0) {
goto err;
}