Fix compile error/warnings with gcc-4.7

This commit is contained in:
Tatsuhiro Tsujikawa 2015-07-19 20:50:14 +09:00
parent 5c96ecd77d
commit ca3444c34c
2 changed files with 5 additions and 4 deletions

View File

@ -630,7 +630,8 @@ void renew_ticket_key_cb(struct ev_loop *loop, ev_timer *w, int revents) {
new_key.hmac = EVP_sha256(); new_key.hmac = EVP_sha256();
new_key.hmac_keylen = EVP_MD_size(new_key.hmac); new_key.hmac_keylen = EVP_MD_size(new_key.hmac);
assert(EVP_CIPHER_key_length(new_key.cipher) <= sizeof(new_key.data.enc_key)); assert(static_cast<size_t>(EVP_CIPHER_key_length(new_key.cipher)) <=
sizeof(new_key.data.enc_key));
assert(new_key.hmac_keylen <= sizeof(new_key.data.hmac_key)); assert(new_key.hmac_keylen <= sizeof(new_key.data.hmac_key));
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {

View File

@ -171,7 +171,7 @@ read_tls_ticket_key_file(const std::vector<std::string> &files,
return nullptr; return nullptr;
} }
if (fst.st_size != expectedlen) { if (static_cast<size_t>(fst.st_size) != expectedlen) {
LOG(ERROR) << "tls-ticket-key-file: the expected file size is " LOG(ERROR) << "tls-ticket-key-file: the expected file size is "
<< expectedlen << ", the actual file size is " << fst.st_size; << expectedlen << ", the actual file size is " << fst.st_size;
return nullptr; return nullptr;
@ -184,7 +184,7 @@ read_tls_ticket_key_file(const std::vector<std::string> &files,
} }
f.read(buf, expectedlen); f.read(buf, expectedlen);
if (f.gcount() != expectedlen) { if (static_cast<size_t>(f.gcount()) != expectedlen) {
LOG(ERROR) << "tls-ticket-key-file: want to read " << expectedlen LOG(ERROR) << "tls-ticket-key-file: want to read " << expectedlen
<< " bytes but only read " << f.gcount() << " bytes from " << " bytes but only read " << f.gcount() << " bytes from "
<< file; << file;
@ -1836,7 +1836,7 @@ int parse_config(const char *opt, const char *optarg,
return -1; return -1;
} }
included_set.emplace(optarg); included_set.insert(optarg);
auto rv = load_config(optarg, included_set); auto rv = load_config(optarg, included_set);
included_set.erase(optarg); included_set.erase(optarg);