Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Mar 4, 2018
1 parent f1ede63 commit bb47109
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
11 changes: 3 additions & 8 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ class container_buffer : public basic_buffer<typename Container::value_type> {
container_(c) {}
};

// A helper function to suppress bogus "conditional expression is constant"
// warnings.
template <typename T>
inline T const_check(T value) { return value; }

struct error_handler {
FMT_CONSTEXPR error_handler() {}
FMT_CONSTEXPR error_handler(const error_handler &) {}
Expand Down Expand Up @@ -1136,9 +1131,9 @@ inline internal::named_arg<T, wchar_t> arg(wstring_view name, const T &arg) {
template <typename S, typename T, typename Char>
void arg(S, internal::named_arg<T, Char>) FMT_DELETED;

enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
enum color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };

FMT_API void vprint_colored(Color c, string_view format, format_args args);
FMT_API void vprint_colored(color c, string_view format, format_args args);

/**
Formats a string and prints it to stdout using ANSI escape sequences to
Expand All @@ -1147,7 +1142,7 @@ FMT_API void vprint_colored(Color c, string_view format, format_args args);
fmt::print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23);
*/
template <typename... Args>
inline void print_colored(Color c, string_view format_str,
inline void print_colored(color c, string_view format_str,
const Args & ... args) {
vprint_colored(c, format_str, make_args(args...));
}
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ FMT_FUNC void vprint(string_view format_str, format_args args) {
vprint(stdout, format_str, args);
}

FMT_FUNC void vprint_colored(Color c, string_view format, format_args args) {
FMT_FUNC void vprint_colored(color c, string_view format, format_args args) {
char escape[] = "\x1b[30m";
escape[3] = static_cast<char>('0' + c);
std::fputs(escape, stdout);
Expand Down
5 changes: 5 additions & 0 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ typename Allocator::value_type *allocate(Allocator& alloc, std::size_t n) {
return alloc.allocate(n);
#endif
}

// A helper function to suppress bogus "conditional expression is constant"
// warnings.
template <typename T>
inline T const_check(T value) { return value; }
} // namespace internal
} // namespace fmt

Expand Down

0 comments on commit bb47109

Please sign in to comment.