Skip to content

Commit 1bb9b7d

Browse files
committed
Update clang-format to 13.0.1.
1 parent 5a76413 commit 1bb9b7d

25 files changed

+77
-76
lines changed

‎memprof/memprof.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ extern void *__libc_stack_end;
4545
static void *get_bp() {
4646
void *bp;
4747
#if defined(__i386__)
48-
__asm__ volatile("movl %%ebp, %[r]" : [ r ] "=r"(bp));
48+
__asm__ volatile("movl %%ebp, %[r]" : [r] "=r"(bp));
4949
#elif defined(__x86_64__)
50-
__asm__ volatile("movq %%rbp, %[r]" : [ r ] "=r"(bp));
50+
__asm__ volatile("movq %%rbp, %[r]" : [r] "=r"(bp));
5151
#endif
5252
return bp;
5353
}

‎td/telegram/Td.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Td final : public Actor {
125125
void set_is_bot_online(bool is_bot_online);
126126

127127
template <class ActorT, class... ArgsT>
128-
ActorId<ActorT> create_net_actor(ArgsT &&... args) {
128+
ActorId<ActorT> create_net_actor(ArgsT &&...args) {
129129
LOG_CHECK(close_flag_ < 1) << close_flag_
130130
#if TD_CLANG || TD_GCC
131131
<< ' ' << __PRETTY_FUNCTION__
@@ -234,7 +234,7 @@ class Td final : public Actor {
234234
};
235235

236236
template <class HandlerT, class... Args>
237-
std::shared_ptr<HandlerT> create_handler(Args &&... args) {
237+
std::shared_ptr<HandlerT> create_handler(Args &&...args) {
238238
LOG_CHECK(close_flag_ < 2) << close_flag_
239239
#if TD_CLANG || TD_GCC
240240
<< ' ' << __PRETTY_FUNCTION__

‎td/telegram/cli.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ class CliClient final : public Actor {
711711
}
712712

713713
template <class FirstType, class SecondType, class... Types>
714-
static void get_args(string &args, FirstType &first_arg, SecondType &second_arg, Types &... other_args) {
714+
static void get_args(string &args, FirstType &first_arg, SecondType &second_arg, Types &...other_args) {
715715
string arg;
716716
std::tie(arg, args) = split(args);
717717
get_args(arg, first_arg);

‎td/tl/TlObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ using tl_object_ptr = tl::unique_ptr<Type>;
199199
* \return Wrapped pointer to the created TL-object.
200200
*/
201201
template <class Type, class... Args>
202-
tl_object_ptr<Type> make_tl_object(Args &&... args) {
202+
tl_object_ptr<Type> make_tl_object(Args &&...args) {
203203
return tl_object_ptr<Type>(new Type(std::forward<Args>(args)...));
204204
}
205205

‎tdactor/td/actor/ConcurrentScheduler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ConcurrentScheduler final : private Scheduler::Callback {
6262
void finish();
6363

6464
template <class ActorT, class... Args>
65-
ActorOwn<ActorT> create_actor_unsafe(int32 sched_id, Slice name, Args &&... args) {
65+
ActorOwn<ActorT> create_actor_unsafe(int32 sched_id, Slice name, Args &&...args) {
6666
#if TD_THREAD_UNSUPPORTED || TD_EVENTFD_UNSUPPORTED
6767
sched_id = 0;
6868
#endif

‎tdactor/td/actor/PromiseFuture.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ template <class PromiseT>
404404
class CancellablePromise final : public PromiseT {
405405
public:
406406
template <class... ArgsT>
407-
CancellablePromise(CancellationToken cancellation_token, ArgsT &&... args)
407+
CancellablePromise(CancellationToken cancellation_token, ArgsT &&...args)
408408
: PromiseT(std::forward<ArgsT>(args)...), cancellation_token_(std::move(cancellation_token)) {
409409
}
410410
bool is_cancellable() const final {
@@ -421,7 +421,7 @@ class CancellablePromise final : public PromiseT {
421421
template <class... ArgsT>
422422
class JoinPromise final : public PromiseInterface<Unit> {
423423
public:
424-
explicit JoinPromise(ArgsT &&... arg) : promises_(std::forward<ArgsT>(arg)...) {
424+
explicit JoinPromise(ArgsT &&...arg) : promises_(std::forward<ArgsT>(arg)...) {
425425
}
426426
void set_value(Unit &&) final {
427427
tuple_for_each(promises_, [](auto &promise) { promise.set_value(Unit()); });
@@ -438,7 +438,7 @@ class JoinPromise final : public PromiseInterface<Unit> {
438438
class SendClosure {
439439
public:
440440
template <class... ArgsT>
441-
void operator()(ArgsT &&... args) const {
441+
void operator()(ArgsT &&...args) const {
442442
send_closure(std::forward<ArgsT>(args)...);
443443
}
444444
};
@@ -453,7 +453,7 @@ class SendClosure {
453453
//}
454454

455455
template <class... ArgsT>
456-
auto promise_send_closure(ArgsT &&... args) {
456+
auto promise_send_closure(ArgsT &&...args) {
457457
return [t = std::make_tuple(std::forward<ArgsT>(args)...)](auto &&res) mutable {
458458
call_tuple(SendClosure(), std::tuple_cat(std::move(t), std::make_tuple(std::forward<decltype(res)>(res))));
459459
};
@@ -679,7 +679,7 @@ class PromiseFuture {
679679
template <ActorSendType send_type, class T, class ActorAT, class ActorBT, class ResultT, class... DestArgsT,
680680
class... ArgsT>
681681
FutureActor<T> send_promise(ActorId<ActorAT> actor_id, ResultT (ActorBT::*func)(PromiseActor<T> &&, DestArgsT...),
682-
ArgsT &&... args) {
682+
ArgsT &&...args) {
683683
PromiseFuture<T> pf;
684684
Scheduler::instance()->send_closure<send_type>(
685685
std::move(actor_id), create_immediate_closure(func, pf.move_promise(), std::forward<ArgsT>(args)...));
@@ -716,7 +716,7 @@ class PromiseCreator {
716716
}
717717

718718
template <class... ArgsT>
719-
static Promise<> join(ArgsT &&... args) {
719+
static Promise<> join(ArgsT &&...args) {
720720
return Promise<>(td::make_unique<detail::JoinPromise<ArgsT...>>(std::forward<ArgsT>(args)...));
721721
}
722722

‎tdactor/td/actor/impl/Actor-decl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class Actor : public ObserverBase {
9090
bool empty() const;
9191

9292
template <class FuncT, class... ArgsT>
93-
auto self_closure(FuncT &&func, ArgsT &&... args);
93+
auto self_closure(FuncT &&func, ArgsT &&...args);
9494

9595
template <class SelfT, class FuncT, class... ArgsT>
96-
auto self_closure(SelfT *self, FuncT &&func, ArgsT &&... args);
96+
auto self_closure(SelfT *self, FuncT &&func, ArgsT &&...args);
9797

9898
template <class LambdaT>
9999
auto self_lambda(LambdaT &&lambda);

‎tdactor/td/actor/impl/Actor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ ActorShared<SelfT> Actor::actor_shared(SelfT *self, uint64 id) {
146146
}
147147

148148
template <class FuncT, class... ArgsT>
149-
auto Actor::self_closure(FuncT &&func, ArgsT &&... args) {
149+
auto Actor::self_closure(FuncT &&func, ArgsT &&...args) {
150150
return self_closure(this, std::forward<FuncT>(func), std::forward<ArgsT>(args)...);
151151
}
152152

153153
template <class SelfT, class FuncT, class... ArgsT>
154-
auto Actor::self_closure(SelfT *self, FuncT &&func, ArgsT &&... args) {
154+
auto Actor::self_closure(SelfT *self, FuncT &&func, ArgsT &&...args) {
155155
return EventCreator::closure(actor_id(self), std::forward<FuncT>(func), std::forward<ArgsT>(args)...);
156156
}
157157

‎tdactor/td/actor/impl/Event.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ClosureEvent final : public CustomEvent {
6666
return new ClosureEvent<ClosureT>(closure_.clone());
6767
}
6868
template <class... ArgsT>
69-
explicit ClosureEvent(ArgsT &&... args) : closure_(std::forward<ArgsT>(args)...) {
69+
explicit ClosureEvent(ArgsT &&...args) : closure_(std::forward<ArgsT>(args)...) {
7070
}
7171

7272
void start_migrate(int32 sched_id) final {
@@ -152,7 +152,7 @@ class Event {
152152
new ClosureEvent<typename FromImmediateClosureT::Delayed>(std::forward<FromImmediateClosureT>(closure)));
153153
}
154154
template <class... ArgsT>
155-
static Event delayed_closure(ArgsT &&... args) {
155+
static Event delayed_closure(ArgsT &&...args) {
156156
using DelayedClosureT = decltype(create_delayed_closure(std::forward<ArgsT>(args)...));
157157
return custom(new ClosureEvent<DelayedClosureT>(std::forward<ArgsT>(args)...));
158158
}

‎tdactor/td/actor/impl/EventFull-decl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class EventFull {
5656
class EventCreator {
5757
public:
5858
template <class ActorIdT, class FunctionT, class... ArgsT>
59-
static EventFull closure(ActorIdT &&actor_id, FunctionT function, ArgsT &&... args) {
59+
static EventFull closure(ActorIdT &&actor_id, FunctionT function, ArgsT &&...args) {
6060
using ActorT = typename std::decay_t<ActorIdT>::ActorT;
6161
using FunctionClassT = member_function_class_t<FunctionT>;
6262
static_assert(std::is_base_of<FunctionClassT, ActorT>::value, "unsafe send_closure");

‎tdactor/td/actor/impl/Scheduler-decl.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class Scheduler {
8484
int32 sched_count() const;
8585

8686
template <class ActorT, class... Args>
87-
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor(Slice name, Args &&... args);
87+
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor(Slice name, Args &&...args);
8888
template <class ActorT, class... Args>
89-
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&... args);
89+
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&...args);
9090
template <class ActorT>
9191
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> register_actor(Slice name, ActorT *actor_ptr, int32 sched_id = -1);
9292
template <class ActorT>
@@ -244,9 +244,9 @@ class Scheduler {
244244

245245
/*** Interface to current scheduler ***/
246246
template <class ActorT, class... Args>
247-
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor(Slice name, Args &&... args);
247+
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor(Slice name, Args &&...args);
248248
template <class ActorT, class... Args>
249-
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&... args);
249+
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&...args);
250250
template <class ActorT>
251251
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> register_actor(Slice name, ActorT *actor_ptr, int32 sched_id = -1);
252252
template <class ActorT>
@@ -256,7 +256,7 @@ template <class ActorT>
256256
TD_WARN_UNUSED_RESULT ActorOwn<ActorT> register_existing_actor(unique_ptr<ActorT> actor_ptr);
257257

258258
template <class ActorIdT, class FunctionT, class... ArgsT>
259-
void send_closure(ActorIdT &&actor_id, FunctionT function, ArgsT &&... args) {
259+
void send_closure(ActorIdT &&actor_id, FunctionT function, ArgsT &&...args) {
260260
using ActorT = typename std::decay_t<ActorIdT>::ActorT;
261261
using FunctionClassT = member_function_class_t<FunctionT>;
262262
static_assert(std::is_base_of<FunctionClassT, ActorT>::value, "unsafe send_closure");
@@ -266,7 +266,7 @@ void send_closure(ActorIdT &&actor_id, FunctionT function, ArgsT &&... args) {
266266
}
267267

268268
template <class ActorIdT, class FunctionT, class... ArgsT>
269-
void send_closure_later(ActorIdT &&actor_id, FunctionT function, ArgsT &&... args) {
269+
void send_closure_later(ActorIdT &&actor_id, FunctionT function, ArgsT &&...args) {
270270
using ActorT = typename std::decay_t<ActorIdT>::ActorT;
271271
using FunctionClassT = member_function_class_t<FunctionT>;
272272
static_assert(std::is_base_of<FunctionClassT, ActorT>::value, "unsafe send_closure");
@@ -276,17 +276,17 @@ void send_closure_later(ActorIdT &&actor_id, FunctionT function, ArgsT &&... arg
276276
}
277277

278278
template <class... ArgsT>
279-
void send_lambda(ActorRef actor_ref, ArgsT &&... args) {
279+
void send_lambda(ActorRef actor_ref, ArgsT &&...args) {
280280
Scheduler::instance()->send_lambda<ActorSendType::Immediate>(actor_ref, std::forward<ArgsT>(args)...);
281281
}
282282

283283
template <class... ArgsT>
284-
void send_event(ActorRef actor_ref, ArgsT &&... args) {
284+
void send_event(ActorRef actor_ref, ArgsT &&...args) {
285285
Scheduler::instance()->send<ActorSendType::Immediate>(actor_ref, std::forward<ArgsT>(args)...);
286286
}
287287

288288
template <class... ArgsT>
289-
void send_event_later(ActorRef actor_ref, ArgsT &&... args) {
289+
void send_event_later(ActorRef actor_ref, ArgsT &&...args) {
290290
Scheduler::instance()->send<ActorSendType::Later>(actor_ref, std::forward<ArgsT>(args)...);
291291
}
292292

‎tdactor/td/actor/impl/Scheduler.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ inline int32 Scheduler::sched_count() const {
6969
}
7070

7171
template <class ActorT, class... Args>
72-
ActorOwn<ActorT> Scheduler::create_actor(Slice name, Args &&... args) {
72+
ActorOwn<ActorT> Scheduler::create_actor(Slice name, Args &&...args) {
7373
return register_actor_impl(name, new ActorT(std::forward<Args>(args)...), Actor::Deleter::Destroy, sched_id_);
7474
}
7575

7676
template <class ActorT, class... Args>
77-
ActorOwn<ActorT> Scheduler::create_actor_on_scheduler(Slice name, int32 sched_id, Args &&... args) {
77+
ActorOwn<ActorT> Scheduler::create_actor_on_scheduler(Slice name, int32 sched_id, Args &&...args) {
7878
return register_actor_impl(name, new ActorT(std::forward<Args>(args)...), Actor::Deleter::Destroy, sched_id);
7979
}
8080

@@ -334,12 +334,12 @@ inline void Scheduler::run(Timestamp timeout) {
334334

335335
/*** Interface to current scheduler ***/
336336
template <class ActorT, class... Args>
337-
ActorOwn<ActorT> create_actor(Slice name, Args &&... args) {
337+
ActorOwn<ActorT> create_actor(Slice name, Args &&...args) {
338338
return Scheduler::instance()->create_actor<ActorT>(name, std::forward<Args>(args)...);
339339
}
340340

341341
template <class ActorT, class... Args>
342-
ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&... args) {
342+
ActorOwn<ActorT> create_actor_on_scheduler(Slice name, int32 sched_id, Args &&...args) {
343343
return Scheduler::instance()->create_actor_on_scheduler<ActorT>(name, sched_id, std::forward<Args>(args)...);
344344
}
345345

‎tdutils/td/utils/Closure.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ImmediateClosure {
8383

8484
template <class ActorT, class ResultT, class... DestArgsT, class... SrcArgsT>
8585
ImmediateClosure<ActorT, ResultT (ActorT::*)(DestArgsT...), SrcArgsT &&...> create_immediate_closure(
86-
ResultT (ActorT::*func)(DestArgsT...), SrcArgsT &&... args) {
86+
ResultT (ActorT::*func)(DestArgsT...), SrcArgsT &&...args) {
8787
return ImmediateClosure<ActorT, ResultT (ActorT::*)(DestArgsT...), SrcArgsT &&...>(func,
8888
std::forward<SrcArgsT>(args)...);
8989
}
@@ -160,7 +160,7 @@ DelayedClosure<ArgsT...> to_delayed_closure(DelayedClosure<ArgsT...> &&other) {
160160
}
161161

162162
template <class ActorT, class ResultT, class... DestArgsT, class... SrcArgsT>
163-
auto create_delayed_closure(ResultT (ActorT::*func)(DestArgsT...), SrcArgsT &&... args) {
163+
auto create_delayed_closure(ResultT (ActorT::*func)(DestArgsT...), SrcArgsT &&...args) {
164164
return DelayedClosure<ActorT, ResultT (ActorT::*)(DestArgsT...), SrcArgsT &&...>(func,
165165
std::forward<SrcArgsT>(args)...);
166166
}

‎tdutils/td/utils/ObjectPool.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class ObjectPool {
156156
};
157157

158158
template <class... ArgsT>
159-
OwnerPtr create(ArgsT &&... args) {
159+
OwnerPtr create(ArgsT &&...args) {
160160
Storage *storage = get_storage();
161161
storage->init_data(std::forward<ArgsT>(args)...);
162162
return OwnerPtr(storage, this);
@@ -201,7 +201,7 @@ class ObjectPool {
201201
std::atomic<int32> generation{1};
202202

203203
template <class... ArgsT>
204-
void init_data(ArgsT &&... args) {
204+
void init_data(ArgsT &&...args) {
205205
// new (&data) DataT(std::forward<ArgsT>(args)...);
206206
data = DataT(std::forward<ArgsT>(args)...);
207207
}

‎tdutils/td/utils/SharedObjectPool.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SharedPtrRaw
4949
CHECK(option_magic_ == Magic);
5050
}
5151
template <class... ArgsT>
52-
void init_data(ArgsT &&... args) {
52+
void init_data(ArgsT &&...args) {
5353
new (&option_data_) DataT(std::forward<ArgsT>(args)...);
5454
}
5555
void destroy_data() {
@@ -158,13 +158,13 @@ class SharedPtr {
158158
}
159159

160160
template <class... ArgsT>
161-
static SharedPtr<T, DeleterT> create(ArgsT &&... args) {
161+
static SharedPtr<T, DeleterT> create(ArgsT &&...args) {
162162
auto raw = make_unique<Raw>(DeleterT());
163163
raw->init_data(std::forward<ArgsT>(args)...);
164164
return SharedPtr<T, DeleterT>(raw.release());
165165
}
166166
template <class D, class... ArgsT>
167-
static SharedPtr<T, DeleterT> create_with_deleter(D &&d, ArgsT &&... args) {
167+
static SharedPtr<T, DeleterT> create_with_deleter(D &&d, ArgsT &&...args) {
168168
auto raw = make_unique<Raw>(std::forward<D>(d));
169169
raw->init_data(std::forward<ArgsT>(args)...);
170170
return SharedPtr<T, DeleterT>(raw.release());
@@ -201,7 +201,7 @@ class SharedObjectPool {
201201
}
202202

203203
template <class... ArgsT>
204-
Ptr alloc(ArgsT &&... args) {
204+
Ptr alloc(ArgsT &&...args) {
205205
auto *raw = alloc_raw();
206206
raw->init_data(std::forward<ArgsT>(args)...);
207207
return Ptr(raw);

‎tdutils/td/utils/Status.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class Result {
416416
}
417417
struct emplace_t {};
418418
template <class... ArgsT>
419-
Result(emplace_t, ArgsT &&... args) : status_(), value_(std::forward<ArgsT>(args)...) {
419+
Result(emplace_t, ArgsT &&...args) : status_(), value_(std::forward<ArgsT>(args)...) {
420420
}
421421
Result(Status &&status) : status_(std::move(status)) {
422422
CHECK(status_.is_error());
@@ -451,7 +451,7 @@ class Result {
451451
return *this;
452452
}
453453
template <class... ArgsT>
454-
void emplace(ArgsT &&... args) {
454+
void emplace(ArgsT &&...args) {
455455
if (status_.is_ok()) {
456456
value_.~T();
457457
}

‎tdutils/td/utils/VectorQueue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class VectorQueue {
2222
}
2323

2424
template <class... Args>
25-
void emplace(Args &&... args) {
25+
void emplace(Args &&...args) {
2626
vector_.emplace_back(std::forward<Args>(args)...);
2727
}
2828

‎tdutils/td/utils/format.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ StringBuilder &operator<<(StringBuilder &sb, const Concat<T> &concat) {
301301
}
302302

303303
template <class... ArgsT>
304-
auto concat(const ArgsT &... args) {
304+
auto concat(const ArgsT &...args) {
305305
return Concat<decltype(std::tie(args...))>{std::tie(args...)};
306306
}
307307

0 commit comments

Comments
 (0)