citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 1dadb6863e588fc1803bcbc751bd9992cabaa220
parent 1dec415d8030ff981cfa9dd606fcd3bae56cf8eb
Author: Kyle Milz <kyle@0x30.net>
Date:   Thu,  1 Dec 2016 20:45:16 -0700

src: stop casting citrun_{major,minor} to unsigned

Diffstat:
Msrc/inst_action.cc | 8++++----
Msrc/inst_main.cc | 4+---
Mt/inst_preamble.sh | 4++--
3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/inst_action.cc b/src/inst_action.cc @@ -84,10 +84,10 @@ InstrumentAction::EndSourceFileAction() << " \"" << m_compiler_file_name << "\",\n" << " \"" << getCurrentFile().str() << "\",\n"; preamble << "};\n"; - preamble << "__attribute__((constructor))\n" - << "static void citrun_constructor() {\n" - << " citrun_node_add(" << unsigned(citrun_major) << ", " - << unsigned(citrun_minor) << ", &_citrun);\n" + preamble << "__attribute__((constructor)) static void\n" + << "citrun_constructor() {\n" + << " citrun_node_add(" << citrun_major << ", " + << citrun_minor << ", &_citrun);\n" << "}\n"; preamble << "#ifdef __cplusplus\n" << "}\n" diff --git a/src/inst_main.cc b/src/inst_main.cc @@ -67,9 +67,7 @@ print_toolinfo(InstrumentLogger &llog) { struct utsname utsname; - llog << "citrun-inst " - << unsigned(citrun_major) << "." - << unsigned(citrun_minor) << " "; + llog << "citrun-inst " << citrun_major << "." << citrun_minor << " "; if (uname(&utsname) == -1) llog << "(Unknown OS) "; else { diff --git a/t/inst_preamble.sh b/t/inst_preamble.sh @@ -38,8 +38,8 @@ static struct citrun_node _citrun = { "", "", }; -__attribute__((constructor)) -static void citrun_constructor() { +__attribute__((constructor)) static void +citrun_constructor() { citrun_node_add(0, 0, &_citrun); } #ifdef __cplusplus