From cafaccc9d12f0f456f8b2fd9963850b7b373975a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 5 Apr 2020 02:27:42 -0700 Subject: [PATCH] util: c++-ify usage printing in the m5 utility. Change-Id: Ice8641d490fa9a510a6f1e246530ca5c82ef8170 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27555 Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Tested-by: kokoro --- util/m5/src/usage.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/util/m5/src/usage.cc b/util/m5/src/usage.cc index 60ceedf2f..bbcf36af3 100644 --- a/util/m5/src/usage.cc +++ b/util/m5/src/usage.cc @@ -38,9 +38,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include #include "call_type.hh" #include "commands.hh" @@ -51,16 +50,16 @@ std::string progname; void usage() { - fprintf(stderr, "Usage: %s [call type] [arguments]\n", - progname.c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "Call types:\n"); - fprintf(stderr, CallType::usageSummary().c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "Commands:\n"); - fprintf(stderr, Command::usageSummary().c_str()); - fprintf(stderr, "\n"); - fprintf(stderr, "All times in nanoseconds!\n"); + std::cerr << "Usage: " << progname << + "[call type] [arguments]" << std::endl << + std::endl << + "Call types:" << std::endl << + CallType::usageSummary() << + std::endl << + "Commands:" << std::endl << + Command::usageSummary() << + std::endl << + "All times in nanoseconds!" << std::endl; exit(1); } -- 2.30.2