Skip to content

Commit d544506

Browse files
authored
Minor improvements. (#3169)
1 parent d0f077f commit d544506

23 files changed

+30
-30
lines changed

CMake/GetGitRevisionDescription.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
3535
# function returns an empty string via _git_dir_var.
3636
#
3737
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
38-
# neither foo nor bar contain a file/directory .git. This wil return
38+
# neither foo nor bar contain a file/directory .git. This will return
3939
# C:/bla/.git
4040
#
4141
function(_git_find_closest_git_dir _start_dir _git_dir_var)

CMake/iOS.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ endif()
154154

155155
set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fapplication-extension")
156156
set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}")
157-
# Hidden visibilty is required for cxx on iOS
157+
# Hidden visibility is required for cxx on iOS
158158
set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden")
159159

160160
set (CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")

benchmark/check_tls.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ td::Result<TlsInfo> test_tls(const td::string &url) {
199199
if (random_id ==
200200
"\xcf\x21\xad\x74\xe5\x9a\x61\x11\xbe\x1d\x8c\x02\x1e\x65\xb8\x91\xc2\xa2\x11\x16\x7a\xbb\x8c\x5e\x07"
201201
"\x9e\x09\xe2\xc8\xa8\x33\x9c") {
202-
return td::Status::Error("TLS 1.3 servers returning HelloRetryRequest are not supprted");
202+
return td::Status::Error("TLS 1.3 servers returning HelloRetryRequest are not supported");
203203
}
204204
if (result[43] == '\x00') {
205205
return td::Status::Error("TLS <= 1.2: empty session_id");

example/web/tdweb/src/worker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ class TdClient {
884884
}
885885

886886
async close(last_update) {
887-
// close db and cancell all timers
887+
// close db and cancel all timers
888888
this.isClosing = true;
889889
if (this.isStarted) {
890890
log.debug('close worker: start');

memprof/memprof.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void *realloc(void *ptr, std::size_t size) {
285285
return new_ptr;
286286
}
287287

288-
void *memalign(std::size_t aligment, std::size_t size) {
288+
void *memalign(std::size_t alignment, std::size_t size) {
289289
my_assert(false && "Memalign is unsupported");
290290
return nullptr;
291291
}

td/mtproto/SessionConnection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace mtproto {
117117
* BadMsgNotification;
118118
*
119119
* error codes:
120-
* 16: msg_id is too low. -- lite resend. It will be automatially packed in a container. I hope.
120+
* 16: msg_id is too low. -- lite resend. It will be automatically packed in a container. I hope.
121121
* 17: msg_id is too high. -- fail connection.
122122
* 18: msg_id % 4 != 0. -- Error and fail connection.
123123
* 19: container msg_id is the same as msg_id of a previously received message. MUST NEVER HAPPENS. Error and fail

td/telegram/AuthManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class AuthManager final : public NetActor {
129129
ActorShared<> parent_;
130130

131131
// STATE
132-
// from contructor
132+
// from constructor
133133
int32 api_id_;
134134
string api_hash_;
135135

td/telegram/BusinessConnectedBot.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bool operator==(const BusinessConnectedBot &lhs, const BusinessConnectedBot &rhs
3939
}
4040

4141
StringBuilder &operator<<(StringBuilder &string_builder, const BusinessConnectedBot &connected_bot) {
42-
return string_builder << "coneected bot " << connected_bot.user_id_ << ' ' << connected_bot.recipients_ << ' '
42+
return string_builder << "connected bot " << connected_bot.user_id_ << ' ' << connected_bot.recipients_ << ' '
4343
<< (connected_bot.can_reply_ ? " that can reply" : " read-only");
4444
}
4545

td/telegram/GroupCallManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4376,7 +4376,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
43764376
if (!group_call->is_active) {
43774377
// never update ended calls
43784378
} else if (!call.is_active) {
4379-
// always update to an ended call, droping also is_joined, is_speaking and other local flags
4379+
// always update to an ended call, dropping also is_joined, is_speaking and other local flags
43804380
fail_promises(group_call->after_join, Status::Error(400, "Group call ended"));
43814381
*group_call = std::move(call);
43824382
need_update = true;

td/telegram/GroupCallParticipant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ GroupCallParticipant::GroupCallParticipant(const tl_object_ptr<telegram_api::gro
7272
}
7373

7474
bool GroupCallParticipant::is_versioned_update(const tl_object_ptr<telegram_api::groupCallParticipant> &participant) {
75-
// updates about new and left participants must be applyed as versioned, even they don't increase version
75+
// updates about new and left participants must be applied as versioned, even they don't increase version
7676
return participant->just_joined_ || participant->left_ || participant->versioned_;
7777
}
7878

td/telegram/MessageEntity.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4235,7 +4235,7 @@ static std::pair<size_t, int32> remove_invalid_entities(const string &text, vect
42354235
return {last_non_whitespace_pos, last_non_whitespace_utf16_offset};
42364236
}
42374237

4238-
// enitities must contain only splittable entities
4238+
// entities must contain only splittable entities
42394239
static void split_entities(vector<MessageEntity> &entities, const vector<MessageEntity> &other_entities) {
42404240
check_is_sorted(entities);
42414241
check_is_sorted(other_entities);

td/telegram/MessagesManager.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -6009,7 +6009,7 @@ void MessagesManager::skip_old_pending_pts_update(tl_object_ptr<telegram_api::Up
60096009
return;
60106010
}
60116011

6012-
// very old or unuseful update
6012+
// very old or useless update
60136013
LOG_IF(WARNING, new_pts == old_pts && pts_count == 0 && !is_allowed_useless_update(update))
60146014
<< "Receive useless update " << oneline(to_string(update)) << " from " << source;
60156015
}
@@ -7154,7 +7154,7 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p
71547154
}
71557155
} else {
71567156
int32 old_pts = d->pts;
7157-
if (new_pts <= old_pts) { // very old or unuseful update
7157+
if (new_pts <= old_pts) { // very old or useless update
71587158
if (update->get_id() == telegram_api::updateNewChannelMessage::ID) {
71597159
auto update_new_channel_message = static_cast<telegram_api::updateNewChannelMessage *>(update.get());
71607160
auto message_id = MessageId::get_message_id(update_new_channel_message->message_, false);
@@ -9640,7 +9640,7 @@ void MessagesManager::on_get_scheduled_server_messages(DialogId dialog_id, uint3
96409640
d->scheduled_messages_sync_generation = generation;
96419641

96429642
if (is_not_modified) {
9643-
LOG(INFO) << "Scheduled messages are mot modified in " << dialog_id;
9643+
LOG(INFO) << "Scheduled messages are not modified in " << dialog_id;
96449644
return;
96459645
}
96469646

@@ -10700,7 +10700,7 @@ void MessagesManager::delete_dialog_messages_by_sender(DialogId dialog_id, Dialo
1070010700
}
1070110701
channel_status = td_->chat_manager_->get_channel_permissions(channel_id);
1070210702
if (!channel_status.can_delete_messages()) {
10703-
return promise.set_error(Status::Error(400, "Need delete messages administator right in the supergroup chat"));
10703+
return promise.set_error(Status::Error(400, "Need delete messages administrator right in the supergroup chat"));
1070410704
}
1070510705
channel_id = dialog_id.get_channel_id();
1070610706
break;
@@ -26464,7 +26464,7 @@ void MessagesManager::register_message_reply(DialogId dialog_id, const Message *
2646426464
}
2646526465

2646626466
void MessagesManager::reregister_message_reply(DialogId dialog_id, const Message *m) {
26467-
// reply itself wan't changed, so there is nothing to reregister
26467+
// reply itself wasn't changed, so there is nothing to reregister
2646826468
if (!can_register_message_reply(m)) {
2646926469
return;
2647026470
}
@@ -32784,7 +32784,7 @@ MessagesManager::Message *MessagesManager::on_get_message_from_database(Dialog *
3278432784
// data in the database is always outdated, so return a message from the memory
3278532785
if (dialog_id.get_type() == DialogType::SecretChat) {
3278632786
CHECK(!is_scheduled);
32787-
// just in case restore random_id to message_id corespondence
32787+
// just in case restore random_id to message_id correspondence
3278832788
// can be needed if there was newer unloaded message with the same random_id
3278932789
add_random_id_to_message_id_correspondence(d, old_message->random_id, old_message->message_id);
3279032790
}

td/telegram/MessagesManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ class MessagesManager final : public Actor {
16651665
static constexpr int32 AUTH_NOTIFICATION_ID_CACHE_TIME = 7 * 86400;
16661666
static constexpr size_t MAX_SAVED_AUTH_NOTIFICATION_IDS = 100;
16671667

1668-
static constexpr int32 MAX_RESEND_DELAY = 86400; // seconds, some resonable limit
1668+
static constexpr int32 MAX_RESEND_DELAY = 86400; // seconds, some reasonable limit
16691669

16701670
static constexpr int32 SCHEDULE_WHEN_ONLINE_DATE = 2147483646;
16711671

td/telegram/NotificationSettingsManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ void NotificationSettingsManager::load_saved_ringtones(Promise<Unit> &&promise)
13581358
on_saved_ringtones_updated(true);
13591359
}
13601360

1361-
// the promis must not be set synchronously
1361+
// the promise must not be set synchronously
13621362
send_closure_later(actor_id(this), &NotificationSettingsManager::on_load_saved_ringtones, std::move(promise));
13631363
reload_saved_ringtones(Auto());
13641364
} else {

td/telegram/SecretChatActor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ Status SecretChatActor::do_inbound_message_decrypted(unique_ptr<log_event::Inbou
13101310
state.message_id = message->message_id;
13111311
TRY_STATUS(on_inbound_action(*action, message->message_id));
13121312
} else {
1313-
LOG(ERROR) << "INGORE MESSAGE: " << to_string(message->decrypted_message_layer);
1313+
LOG(ERROR) << "IGNORE MESSAGE: " << to_string(message->decrypted_message_layer);
13141314
save_message_finish.set_value(Unit());
13151315
}
13161316

td/telegram/SecretChatActor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ class SecretChatActor final : public NetQueryCallback {
476476
// We may accept some other change during that time, and there goes our problem
477477
// The reason for the change may already be invalid. So we should somehow recheck change, that
478478
// is already written to binlog, and apply it only if necessary.
479-
// This is completly flawed.
479+
// This is completely flawed.
480480
// (A-start_save_to_binlog ----> B-start_save_to_binlog+change_memory ----> A-finish_save_to_binlog+surprise)
481481
//
482482
// Instead, I suggest general solution that is already used with SeqNoState and QTS

td/telegram/Td.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ void Td::init(Parameters parameters, Result<TdDb::OpenedDatabase> r_opened_datab
834834

835835
// we need to process td_api::getOption along with td_api::setOption for consistency
836836
// we need to process td_api::setOption before managers and MTProto header are created,
837-
// because their initialiation may be affected by the options
837+
// because their initialization may be affected by the options
838838
complete_pending_preauthentication_requests([](int32 id) {
839839
switch (id) {
840840
case td_api::getOption::ID:

td/telegram/files/FileDownloader.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ Result<bool> FileDownloader::should_restart_part(Part part, const NetQueryPtr &n
103103
case QueryType::ReuploadCDN: {
104104
TRY_RESULT(file_hashes, fetch_result<telegram_api::upload_reuploadCdnFile>(net_query->ok()));
105105
add_hash_info(file_hashes);
106-
LOG(DEBUG) << "Part " << part.id << " was reuplaoded to CDN";
106+
LOG(DEBUG) << "Part " << part.id << " was reuploaded to CDN";
107107
return true;
108108
}
109109
case QueryType::CDN: {
110110
if (net_query->ok_tl_constructor() == telegram_api::upload_cdnFileReuploadNeeded::ID) {
111111
TRY_RESULT(file_base, fetch_result<telegram_api::upload_getCdnFile>(net_query->ok()));
112112
CHECK(file_base->get_id() == telegram_api::upload_cdnFileReuploadNeeded::ID);
113113
auto file = move_tl_object_as<telegram_api::upload_cdnFileReuploadNeeded>(file_base);
114-
LOG(DEBUG) << "Part " << part.id << " must be reuplaoded to " << oneline(to_string(file));
114+
LOG(DEBUG) << "Part " << part.id << " must be reuploaded to " << oneline(to_string(file));
115115
cdn_part_reupload_token_[part.id] = file->request_token_.as_slice().str();
116116
return true;
117117
}

td/telegram/files/FileManager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ static int merge_choose_generate_location(const unique_ptr<FullGenerateFileLocat
20972097
}
20982098
return x->conversion_ >= y->conversion_
20992099
? 0
2100-
: 1; // the bigger conversion, the bigger mtime or at least more stable choise
2100+
: 1; // the bigger conversion, the bigger mtime or at least more stable choice
21012101
}
21022102
return 2;
21032103
}
@@ -3320,7 +3320,7 @@ void FileManager::run_download(FileNodePtr node, bool force_update_priority) {
33203320
node->download_id_ = query_id;
33213321
node->is_download_started_ = false;
33223322
LOG(INFO) << "Run download of file " << file_id << " of size " << node->size_ << " from "
3323-
<< node->remote_.full.value() << " with suggested name " << node->suggested_path() << " and encyption key "
3323+
<< node->remote_.full.value() << " with suggested name " << node->suggested_path() << " and encryption key "
33243324
<< node->encryption_key_;
33253325
auto download_offset = node->download_offset_;
33263326
auto download_limit = node->get_download_limit();

tdactor/td/actor/impl/Event.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Actor;
2222
// Small structure (up to 16 bytes) used to send events between actors.
2323
//
2424
// There are some predefined types of events:
25-
// NoType -- unitialized event
25+
// NoType -- uninitialized event
2626
// Start -- start actor
2727
// Stop -- stop actor
2828
// Yield -- wake up actor

tdutils/td/utils/HazardPointers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class HazardPointers {
7878
}
7979
}
8080

81-
// old inteface
81+
// old interface
8282
T *protect(size_t thread_id, size_t pos, std::atomic<T *> &ptr) {
8383
return do_protect(get_hazard_ptr(thread_id, pos), ptr);
8484
}

tdutils/td/utils/MpmcWaiter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class MpmcSleepyWaiter {
281281
auto view = StateView(state_.load());
282282
//LOG(ERROR) << view.parked_count;
283283
if (view.searching_count > 0 || view.parked_count == 0) {
284-
VLOG(waiter) << "Ingore notify: " << view.searching_count << ' ' << view.parked_count;
284+
VLOG(waiter) << "Ignore notify: " << view.searching_count << ' ' << view.parked_count;
285285
return;
286286
}
287287

tdutils/td/utils/port/thread_local.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void add_thread_local_destructor(unique_ptr<Destructor> destructor) {
2323
} // namespace detail
2424

2525
void clear_thread_locals() {
26-
// ensure that no destructors were added during destructors invokation
26+
// ensure that no destructors were added during destructors invocation
2727
auto to_delete = detail::thread_local_destructors;
2828
detail::thread_local_destructors = nullptr;
2929
delete to_delete;

0 commit comments

Comments
 (0)