scripts: logging/dictionary: replace %#llx too

Python does not really support long long double, so %llx cannot
be formatted correctly, so we replace it with a simple %lx.
There is another variant %#llx and we also need replace it to
%#lx.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2024-05-17 13:39:19 -07:00 committed by Alberto Escolar
parent ecc642b2df
commit 0e33c7a976

View file

@ -37,6 +37,9 @@ def formalize_fmt_string(fmt_str):
# Python doesn't support %ll for integer specifiers, so remove extra 'l'
new_str = new_str.replace("%ll" + spec, "%l" + spec)
if spec in ['x', 'X']:
new_str = new_str.replace("%#ll" + spec, "%#l" + spec)
# Python doesn't support %hh for integer specifiers, so remove extra 'h'
new_str = new_str.replace("%hh" + spec, "%h" + spec)