1
0
Fork 0
forked from len0rd/rockbox

sbtools: more code refactoring

Factor all printf method with a unique one defined in misc.h

Change-Id: I58fbf8916b76e873a2e6678506d2c8aece7834ec
This commit is contained in:
Amaury Pouly 2013-08-21 22:20:53 +02:00
parent 1357e0a4f1
commit 99f3ca174e
12 changed files with 69 additions and 123 deletions

View file

@ -316,6 +316,18 @@ void color(color_t c)
printf("%s", (char *)c);
}
void generic_std_printf(void *u, bool err, color_t c, const char *f, ...)
{
(void)u;
if(!g_debug && !err)
return;
va_list args;
va_start(args, f);
color(c);
vprintf(f, args);
va_end(args);
}
enum sb_version_guess_t guess_sb_version(const char *filename)
{
#define ret(x) do { if(f) fclose(f); return x; } while(0)