From: Gerhard Sittig Date: Sat, 25 Dec 2021 18:53:11 +0000 (+0100) Subject: type_decoder: eliminate explicit string length spec for literals X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=487890c822762d9886dfd022ed599c9909ceaab9;p=libsigrokdecode.git type_decoder: eliminate explicit string length spec for literals Rephrase the 'names[]' array declaration in output_type_name() to avoid the necessity of guessing what the maximum length of the literals might be during future maintenance. Developers need not care when the compiler can handle this detail. --- diff --git a/type_decoder.c b/type_decoder.c index 38e0a03..0a92a45 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -33,7 +33,7 @@ typedef struct { /* This is only used for nicer srd_dbg() output. */ SRD_PRIV const char *output_type_name(unsigned int idx) { - static const char names[][16] = { + static const char *names[] = { "OUTPUT_ANN", "OUTPUT_PYTHON", "OUTPUT_BINARY",