Fix all sign/unsigned warnings with Clang and GCC.
Change-Id: If2a83698236f7b0dcd46701ccd257a85463d6ce5
Reviewed-on: https://boringssl-review.googlesource.com/4992
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 1acb3ce..4d550e9 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -399,7 +399,7 @@
while (frag_len > 0) {
size_t chunk = frag_len < sizeof(discard) ? frag_len : sizeof(discard);
int ret = dtls1_read_bytes(s, SSL3_RT_HANDSHAKE, discard, chunk, 0);
- if (ret != chunk) {
+ if (ret != (int) chunk) {
return 0;
}
frag_len -= chunk;
@@ -525,7 +525,7 @@
/* Read the body of the fragment. */
ret = dtls1_read_bytes(s, SSL3_RT_HANDSHAKE, frag->fragment + frag_off,
frag_len, 0);
- if (ret != frag_len) {
+ if (ret != (int) frag_len) {
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
return -1;
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c
index 2fcc1ea..628bb29 100644
--- a/ssl/d1_srtp.c
+++ b/ssl/d1_srtp.c
@@ -171,7 +171,8 @@
const SRTP_PROTECTION_PROFILE *p;
col = strchr(ptr, ':');
- if (find_profile_by_name(ptr, &p, col ? col - ptr : strlen(ptr))) {
+ if (find_profile_by_name(ptr, &p,
+ col ? (size_t)(col - ptr) : strlen(ptr))) {
sk_SRTP_PROTECTION_PROFILE_push(profiles, p);
} else {
OPENSSL_PUT_ERROR(SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE);
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index 9e61fb6..0ad4a11 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -130,7 +130,7 @@
* compressionMethod [11] OCTET STRING OPTIONAL,
* srpUsername [12] OCTET STRING OPTIONAL, */
-static const int kVersion = 1;
+static const unsigned kVersion = 1;
static const int kTimeTag =
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1;