Skip to content

Commit

Permalink
Apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
oir committed Nov 16, 2023
1 parent 68dd2eb commit 09467bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
5 changes: 1 addition & 4 deletions demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ int main(int /*argc*/, char** /*argv*/) {

for (auto speed : {Speed::None, Speed::Overall, Speed::Last, Speed::Both}) {
unsigned long long work{677};
auto c = Counter(work)
.message("Decreasing")
.speed_unit("")
.speed(speed);
auto c = Counter(work).message("Decreasing").speed_unit("").speed(speed);
c.show();
while (work > 0) {
std::this_thread::sleep_for(13ms);
Expand Down
7 changes: 4 additions & 3 deletions meanwhile/meanwhile.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class Speedometer {
private:
Progress& progress_; // Current amount of work done
Speed speed_ = Speed::None; // Time interval to compute speed over
std::string speed_unit_; // unit (message) to display alongside speed
std::string speed_unit_; // unit (message) to display alongside speed

using Clock = std::chrono::system_clock;
using Time = std::chrono::time_point<Clock>;
Expand Down Expand Up @@ -539,8 +539,9 @@ class ProgressBar : public AsyncDisplay {
ValueType progress_copy =
progress_; // to avoid progress_ changing during computations below
int on = int(ValueType(width_) * progress_copy / total_);
size_t partial = size_t(ValueType(partials_.size()) * ValueType(width_) * progress_copy / total_ -
ValueType(partials_.size()) * ValueType(on));
size_t partial = size_t(ValueType(partials_.size()) * ValueType(width_) *
progress_copy / total_ -
ValueType(partials_.size()) * ValueType(on));
if (on >= int(width_)) {
on = width_;
partial = 0;
Expand Down
14 changes: 7 additions & 7 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ TEST_CASE("Composite bar-counter", "[composite]") {
std::stringstream out;

std::atomic<size_t> sents{0}, toks{0};
auto bar = ProgressBar(sents, out)
.total(505)
.message("Sents")
.style(Bars)
.interval(0.01) |
Counter(toks, out).message("Toks").speed_unit("tok/s").speed(
Speed::Last);
auto bar =
ProgressBar(sents, out)
.total(505)
.message("Sents")
.style(Bars)
.interval(0.01) |
Counter(toks, out).message("Toks").speed_unit("tok/s").speed(Speed::Last);
bar.show();
for (int i = 0; i < 505; i++) {
std::this_thread::sleep_for(0.13ms);
Expand Down

0 comments on commit 09467bc

Please sign in to comment.