Skip to content

Commit

Permalink
Minor improvements.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 157e77d244b24f3c5af56539d434096f7440e2e8
  • Loading branch information
levlam committed Sep 5, 2019
1 parent 2fa2e96 commit 6cbc02e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions td/telegram/SecretChatsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ ActorId<SecretChatActor> SecretChatsManager::create_chat_actor_impl(int32 id, bo
return it_flag.first->second.get();
}
}

void SecretChatsManager::on_qts_ack(PtsManager::PtsId qts_ack_token) {
auto old_qts = qts_manager_.db_pts();
auto new_qts = qts_manager_.finish(qts_ack_token);
Expand Down
2 changes: 1 addition & 1 deletion td/tl/tl_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ inline Status from_json(int32 &to, JsonValue &from) {

inline Status from_json(bool &to, JsonValue &from) {
if (from.type() != JsonValue::Type::Boolean) {
int32 x;
int32 x = 0;
auto status = from_json(x, from);
if (status.is_ok()) {
to = x != 0;
Expand Down
2 changes: 1 addition & 1 deletion tdactor/test/actors_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class XContext : public ActorContext {
class WithXContext : public Actor {
public:
void start_up() override {
set_context(std::make_shared<XContext>());
auto old_context = set_context(std::make_shared<XContext>());
}
void f(unique_ptr<Guard> guard) {
}
Expand Down
2 changes: 1 addition & 1 deletion tdutils/td/utils/ConcurrentHashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ConcurrentHashMap {
ConcurrentHashMap(ConcurrentHashMap &&) = delete;
ConcurrentHashMap &operator=(ConcurrentHashMap &&) = delete;
~ConcurrentHashMap() {
unique_ptr<HashMap>(hash_map_.load());
unique_ptr<HashMap>(hash_map_.load()).reset();
}

static std::string get_name() {
Expand Down
3 changes: 2 additions & 1 deletion tdutils/td/utils/tl_parsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ class TlParser {
data += sizeof(int32);
} else {
check_len(sizeof(int32));
auto result_len_uint64 = data[1] + (data[2] << 8) + (data[3] << 16) + (data[4] << 24) +
auto result_len_uint64 = static_cast<uint64>(data[1]) + (static_cast<uint64>(data[2]) << 8) +
(static_cast<uint64>(data[3]) << 16) + (static_cast<uint64>(data[4]) << 24) +
(static_cast<uint64>(data[5]) << 32) + (static_cast<uint64>(data[6]) << 40) +
(static_cast<uint64>(data[7]) << 48);
if (result_len_uint64 > std::numeric_limits<size_t>::max() - 3) {
Expand Down
4 changes: 2 additions & 2 deletions tdutils/test/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TEST(Log, TsLogger) {
class FileLog : public td::LogInterface {
public:
FileLog() {
file_log_.init("tmplog", std::numeric_limits<td::int64>::max(), false);
file_log_.init("tmplog", std::numeric_limits<td::int64>::max(), false).ensure();
ts_log_.init(&file_log_);
}
~FileLog() {
Expand Down Expand Up @@ -108,7 +108,7 @@ TEST(Log, TsLogger) {
class FileLog : public td::LogInterface {
public:
FileLog() {
file_log_.init("tmplog", std::numeric_limits<td::int64>::max(), false);
file_log_.init("tmplog", std::numeric_limits<td::int64>::max(), false).ensure();
}
~FileLog() {
}
Expand Down
2 changes: 1 addition & 1 deletion test/secret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ class Master : public Actor {
return get_by_id(3 - get_link_token());
}
void start_up() override {
set_context(std::make_shared<Global>());
auto old_context = set_context(std::make_shared<Global>());
alice_ = create_actor<SecretChatProxy>("SecretChatProxy alice", "alice", actor_shared(this, 1));
bob_ = create_actor<SecretChatProxy>("SecretChatProxy bob", "bob", actor_shared(this, 2));
send_closure(alice_->get_actor_unsafe()->actor_, &SecretChatActor::create_chat, 2, 0, 123,
Expand Down
2 changes: 1 addition & 1 deletion test/tdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class TestClient : public Actor {

void start_up() override {
rmrf(name_).ignore();
set_context(std::make_shared<td::ActorContext>());
auto old_context = set_context(std::make_shared<td::ActorContext>());
set_tag(name_);
LOG(INFO) << "START UP!";

Expand Down

0 comments on commit 6cbc02e

Please sign in to comment.