Skip to content

Commit

Permalink
Fix clang warnings.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: f96c46f526330b6857578689d624d8858380e121
  • Loading branch information
levlam committed Apr 12, 2018
1 parent d8c3c2c commit 00590f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
17 changes: 8 additions & 9 deletions td/telegram/PasswordManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,14 @@ void PasswordManager::do_get_secure_secret(bool recursive, string password, opti
return promise.set_error(Status::Error(400, "Failed to get secure secret"));
}

auto new_promise =
PromiseCreator::lambda([recursive, password, hash = std::move(hash), promise = std::move(promise),
actor_id = actor_id](Result<bool> r_ok) mutable {
if (r_ok.is_error()) {
return promise.set_error(r_ok.move_as_error());
}
send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password),
std::move(hash), std::move(promise));
});
auto new_promise = PromiseCreator::lambda([password, hash = std::move(hash), promise = std::move(promise),
actor_id = actor_id](Result<bool> r_ok) mutable {
if (r_ok.is_error()) {
return promise.set_error(r_ok.move_as_error());
}
send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password), std::move(hash),
std::move(promise));
});

UpdateSettings update_settings;
update_settings.current_password = password;
Expand Down
1 change: 0 additions & 1 deletion tdactor/test/actors_impl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ TEST(Actor2, locker_stress) {
std::atomic<int> begin{0};
std::atomic<int> ready{0};
std::atomic<int> check{0};
std::atomic<int> finish{0};
std::vector<td::thread> threads;
for (size_t i = 0; i < threads_n; i++) {
threads.push_back(td::thread([&, id = i] {
Expand Down
6 changes: 4 additions & 2 deletions tdutils/td/utils/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ Result<BufferSlice> rsa_encrypt_pkcs1_oaep(Slice public_key, Slice data) {
RSA *rsa = pkey->pkey.rsa;
int outlen = RSA_size(rsa);
BufferSlice res(outlen);
if (RSA_public_encrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) {
if (RSA_public_encrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()),
res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) {
#else
EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(pkey, nullptr);
if (!ctx) {
Expand Down Expand Up @@ -520,7 +521,8 @@ Result<BufferSlice> rsa_decrypt_pkcs1_oaep(Slice private_key, Slice data) {
RSA *rsa = pkey->pkey.rsa;
size_t outlen = RSA_size(rsa);
BufferSlice res(outlen);
auto inlen = RSA_private_decrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING);
auto inlen = RSA_private_decrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()),
res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING);
if (inlen == -1) {
return Status::Error("Cannot decrypt");
}
Expand Down
2 changes: 1 addition & 1 deletion test/tdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class DoAuthentication : public Task {
default:
CHECK(false) << "Unexpected authorization state " << to_string(authorization_state);
}
send_query(std::move(function), [this](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); });
send_query(std::move(function), [](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); });
}
void on_authorization_ready() {
LOG(INFO) << "GOT AUTHORIZED";
Expand Down

0 comments on commit 00590f1

Please sign in to comment.