You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/04/14 14:48:55 UTC
[trafficserver] branch master updated: BufferWriterFormat: add
handling for 'p'/'P' pointer type override.
This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 251ec79 BufferWriterFormat: add handling for 'p'/'P' pointer type override.
251ec79 is described below
commit 251ec7955588ff3fd220ca6b8846361f1f16767e
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Sat Apr 7 10:49:40 2018 -0500
BufferWriterFormat: add handling for 'p'/'P' pointer type override.
---
lib/ts/BufferWriter.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/ts/BufferWriter.h b/lib/ts/BufferWriter.h
index b9fcbe6..e0b9484 100644
--- a/lib/ts/BufferWriter.h
+++ b/lib/ts/BufferWriter.h
@@ -636,8 +636,11 @@ bwformat(BufferWriter &w, BWFSpec const &spec, const void *ptr)
{
BWFSpec ptr_spec{spec};
ptr_spec._radix_lead_p = true;
- if (ptr_spec._type == BWFSpec::DEFAULT_TYPE)
- ptr_spec._type = 'x'; // if default, switch to hex.
+ if (ptr_spec._type == BWFSpec::DEFAULT_TYPE || ptr_spec._type == 'p') {
+ ptr_spec._type = 'x'; // if default or 'p;, switch to lower hex.
+ } else if (ptr_spec._type == 'P') {
+ ptr_spec._type = 'X'; // P means upper hex, overriding other specializations.
+ }
return bw_fmt::Format_Integer(w, ptr_spec, reinterpret_cast<intptr_t>(ptr), false);
}
--
To stop receiving notification emails like this one, please contact
amc@apache.org.