tqdm / tqdm.cpp

C++ port of tqdm
Other
312 stars 28 forks source link

static_cast for print with PRIu64 #56

Closed tdegeus closed 3 years ago

tdegeus commented 3 years ago

Building tests on my machine results on errors like

In file included from /Users/tdegeus/data/prog/forks/tqdm.cpp/test/test-example.cpp:4:
/Users/tdegeus/data/prog/forks/tqdm.cpp/include/tqdm/tqdm.h:122:55: error: format specifies type 'unsigned long long' but the argument has
      type 'size_t' (aka 'unsigned long') [-Werror,-Wformat]
      printf("\nfinished: %" PRIu64 "/%" PRIu64 "\n", self.total, self.total);
                          ~~~~~~~~~                   ^~~~~~~~~~
/Users/tdegeus/data/prog/forks/tqdm.cpp/test/test-example.cpp:15:17: note: in instantiation of member function 'tqdm::Tqdm<int *>::_incr'
      requested here
  for (auto i = tqdm::tqdm(a, a + N); i != i.end(); ++i)
                ^

This should fix it