HomePhorge

Correct calls to printf functions

Description

Correct calls to printf functions

The existing calls often used incorrect specifiers for the argument types.

The PRIx64 style specifiers and z length modifiers for uint64_t style and
size_t integer types are portable between architectures while manual length
modifiers are not.

Drop casts from arguments where a length modifier should be used instead.

Add casts to arguments where needed to change types to what printf expects.

Correct types or signedness of variables when printf specifier is better.

Switch from printing pointers as integers to printing them as pointers.

Drop a format string macro that was used with two different types.

Also ensure a space is present before and after PRIx64 style specifiers,
which are macros, for readability and compatibility with C++11.

Suggested-by: https://github.com/csutils/csmock
See-also: https://github.com/pst-format/libpst/issues/6

Details

Provenance
Paul Wise <pabs3@bonedaddy.net>Authored on May 9 2022, 11:57 AM
mollekopfPushed on Sep 3 2024, 2:20 PM
Parents
rLIBPST8dadf5bbc260: Add spaces between macros and strings
Branches
Unknown
Tags
Unknown
Build Status
Buildable 50133