diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-03-06 10:18:54 -0800 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-03-06 10:18:54 -0800 |
commit | 3de3716f7196a5f34963d85c882837c449ecf676 (patch) | |
tree | ec265cc8ff82df819d8c6acf49902f2be9317b1b /src/base/output.cpp | |
parent | e2d714a0839fb80d9a40e9b6fdd8a6fe325a1664 (diff) |
Remove printf from output utilities (#1629)
This commit removes the unused printf functions from the output utilities. It also adds `const` keywords where possible. Finally, it removes overloaded `const char*` functions if the same function existed for `const std::string&` and the `const char*` version was only casting the `const char*` to an `std::string`. This conversion happens implicitly, so the `const char*` version is not needed.
Diffstat (limited to 'src/base/output.cpp')
-rw-r--r-- | src/base/output.cpp | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/src/base/output.cpp b/src/base/output.cpp index b89e5cff5..27eae5a03 100644 --- a/src/base/output.cpp +++ b/src/base/output.cpp @@ -41,154 +41,4 @@ TraceC TraceChannel CVC4_PUBLIC (&cout); std::ostream DumpOutC::dump_cout(cout.rdbuf());// copy cout stream buffer DumpOutC DumpOutChannel CVC4_PUBLIC (&DumpOutC::dump_cout); -#ifndef CVC4_MUZZLE - -# if defined(CVC4_DEBUG) && defined(CVC4_TRACING) - -int DebugC::printf(const char* tag, const char* fmt, ...) { - if(d_tags.find(string(tag)) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int DebugC::printf(std::string tag, const char* fmt, ...) { - if(d_tags.find(tag) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -# endif /* CVC4_DEBUG && CVC4_TRACING */ - -int WarningC::printf(const char* fmt, ...) { - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int MessageC::printf(const char* fmt, ...) { - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int NoticeC::printf(const char* fmt, ...) { - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int ChatC::printf(const char* fmt, ...) { - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -# ifdef CVC4_TRACING - -int TraceC::printf(const char* tag, const char* fmt, ...) { - if(d_tags.find(string(tag)) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int TraceC::printf(std::string tag, const char* fmt, ...) { - if(d_tags.find(tag) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -# endif /* CVC4_TRACING */ - -# ifdef CVC4_DUMPING - -int DumpOutC::printf(const char* tag, const char* fmt, ...) { - if(d_tags.find(string(tag)) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -int DumpOutC::printf(std::string tag, const char* fmt, ...) { - if(d_tags.find(tag) == d_tags.end()) { - return 0; - } - - // chop off output after 1024 bytes - char buf[1024]; - va_list vl; - va_start(vl, fmt); - int retval = vsnprintf(buf, sizeof(buf), fmt, vl); - va_end(vl); - *d_os << buf; - return retval; -} - -# endif /* CVC4_DUMPING */ - -#endif /* ! CVC4_MUZZLE */ - }/* CVC4 namespace */ |