Mercurial > hg > sidinfo
diff sidinfo.c @ 155:de75385f75e2
Simplify by removing few lines of duplicate code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Oct 2017 00:22:36 +0300 |
parents | e3be2ae6120e |
children | 717d143612e2 |
line wrap: on
line diff
--- a/sidinfo.c Wed Oct 25 23:42:04 2017 +0300 +++ b/sidinfo.c Thu Oct 26 00:22:36 2017 +0300 @@ -697,7 +697,7 @@ static void siPrintPSIDInfoLine(FILE *outFile, BOOL *shown, const PSFStackItem *item, const char *d_str, const int d_int) { const PSFOption *opt = &optPSOptions[item->cmd]; - char *fmt, *str = NULL; + char *fmt, *str; switch (opt->type) { @@ -706,8 +706,6 @@ fmt = item->fmt; else fmt = optHexadecimal ? "$%04x" : "%d"; - - str = siItemFormatStrPrint(fmt, opt, d_str, d_int); break; case OTYPE_STR: @@ -715,13 +713,15 @@ fmt = item->fmt; else fmt = "%s"; + break; - str = siItemFormatStrPrint(fmt, opt, d_str, d_int); - break; + default: + return; } siPrintFieldPrefix(outFile, opt); + str = siItemFormatStrPrint(fmt, opt, d_str, d_int); if (str != NULL) fputs(str, outFile);