Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
finish, leaving behind a supposedly "global" variable that is actually a
confusing global pointer to a struct local to the main() function.
This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive
because the main()'s stack lifespan is the same as a global but let's
simplify things anyway.
Also stop using 'extern' in .c files, use a proper .h file instead.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Newer gcc compilers 9.1+ issue a W-char-subscripts warning when argument
type passed to isspace is not explicitly int. Added cast to int.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Rename asprintf and vasprintf into log_asprintf and log_vasprintf as the
names could clash with the standard libc ones. These functions are there
originally done because of windows compatibility, but the naming was not
thought through carefully.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Learned the hard way. Will help refactoring or duplicated
"reverse-engineering" effort.
Zero code change, pure comments: no functional change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Most functions in logger depend on values stored in conver_config struct
which are passed to almost all function calls. This patch moves pointer
to the config to global context and allows each function to derive
necessary values from there. This reduces needless parameters passed
to function calls and allows for more flexible access to data in nested
functions.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
They will be needed during trace filering command parsing,
to skip whitespaces. As generic functions, their are placed
in misc file instead of any feature-related file.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
A few, general usage functions where implemented in converter file.
They should be moved to separate file, to make it easily accessible
form any source file. Moreover removing it from converter file, is a
part of this file cleanup.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>