summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorhunt <hunt>2006-04-10 04:53:03 +0000
committerhunt <hunt>2006-04-10 04:53:03 +0000
commitdc0b623a28b4185e155f16a9cf63a8f22c528b5f (patch)
tree335e23bf57e912c02660c7b185d6688fc8058bcb /translate.cxx
parente06d0f85845165d3d9333fe9e98deade672cd4c8 (diff)
downloadsystemtap-steved-dc0b623a28b4185e155f16a9cf63a8f22c528b5f.tar.gz
systemtap-steved-dc0b623a28b4185e155f16a9cf63a8f22c528b5f.tar.xz
systemtap-steved-dc0b623a28b4185e155f16a9cf63a8f22c528b5f.zip
2006-04-09 Martin Hunt <hunt@redhat.com>
Add binary printf support. * elaborate.cxx (visit_print_format): Don't include conv_literal or conv_size in components vector. Add conv_binary to switch statement. * translate.cxx (visit_print_format): Eliminate special cast to (long long) for pe_long because new vsnprintf uses int64_t. * staptree.h (struct print_format): Add conv_binary and conv_size. * staptree.cxx (components_to_string): Add conv_binary case. Add conv_size case. (string_to_components): Add cases for 'b' and 'n'
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx16
1 files changed, 1 insertions, 15 deletions
diff --git a/translate.cxx b/translate.cxx
index 35a17c23..d1f4ca6a 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -3516,21 +3516,7 @@ c_unparser::visit_print_format (print_format* e)
o->line() << lex_cast_qstring(print_format::components_to_string(components));
for (unsigned i = 0; i < tmp.size(); ++i)
- {
- // We must cast our pe_long type (which is int64_t) to "long
- // long" here, because the format string type we are using
- // is %ll. We use this format string because, at the back
- // end of vsnprintf, linux actually implements it using the
- // "long long" type as well, not a particular 32 or 64 bit
- // width, and it *also* fails to provide any inttype.h-like
- // macro machinery to figure out how many bits exist in a
- // long long. Using %ll and always casting the argument is
- // the most portable target-sensitive solution.
- if (tmp[i].type() == pe_long)
- o->line() << ", ((long long)(" << tmp[i].qname() << "))";
- else
- o->line() << ", " << tmp[i].qname();
- }
+ o->line() << ", " << tmp[i].qname();
o->line() << ");";
o->newline() << res.qname() << ";";
}