# HG changeset patch # User Matti Hamalainen # Date 1579574509 -7200 # Node ID 4978ff445572918a521d605a6126022b24c348a4 # Parent d541123858453f310b208f14ec9f0470e9b71c48 Add lowercase versions of the STIL field names array as sidlib_stil_fields_lc[]. Rename the uppercase array as sidlib_stil_fields_uc[]. diff -r d54112385845 -r 4978ff445572 sidinfo.c --- a/sidinfo.c Mon Jan 20 17:13:32 2020 +0200 +++ b/sidinfo.c Tue Jan 21 04:41:49 2020 +0200 @@ -945,12 +945,12 @@ if (nsubtune > 0) { snprintf(tmp, sizeof(tmp), "STIL#%d/%s", - subtune->tune, sidlib_stil_fields[nfield]); + subtune->tune, sidlib_stil_fields_uc[nfield]); } else { snprintf(tmp, sizeof(tmp), "STIL/%s", - sidlib_stil_fields[nfield]); + sidlib_stil_fields_uc[nfield]); } siPrintFieldPrefixName(outfh, tmp, TRUE); diff -r d54112385845 -r 4978ff445572 sidlib.c --- a/sidlib.c Mon Jan 20 17:13:32 2020 +0200 +++ b/sidlib.c Tue Jan 21 04:41:49 2020 +0200 @@ -8,6 +8,32 @@ #include "th_string.h" +const char *sidlib_stil_fields_uc[STF_LAST] = +{ + "NAME", + "AUTHOR", + "TITLE", + "INFO", + "ARTIST", + "COMMENT", + + // STF_LAST +}; + + +const char *sidlib_stil_fields_lc[STF_LAST] = +{ + "name", + "author", + "title", + "info", + "artist", + "comment", + + // STF_LAST +}; + + static char *sidlib_strdup_convert(SIDLibChConvCtx *chconv, const char *str) { if (chconv != NULL) @@ -752,19 +778,6 @@ }; -const char *sidlib_stil_fields[STF_LAST] = -{ - "NAME", - "AUTHOR", - "TITLE", - "INFO", - "ARTIST", - "COMMENT", - - // STF_LAST -}; - - typedef struct { size_t lineNum; @@ -774,11 +787,11 @@ } SIDLibSTILParserCtx; -static int sidlib_stildb_get_field(const char *name) +static int sidlib_stildb_get_field(const char *field) { for (int n = 0; n < STF_LAST; n++) { - if (strcmp(sidlib_stil_fields[n], name) == 0) + if (strcmp(field, sidlib_stil_fields_uc[n]) == 0) return n; } diff -r d54112385845 -r 4978ff445572 sidlib.h --- a/sidlib.h Mon Jan 20 17:13:32 2020 +0200 +++ b/sidlib.h Tue Jan 21 04:41:49 2020 +0200 @@ -161,7 +161,8 @@ // // Globals // -const char * sidlib_stil_fields[STF_LAST]; +const char * sidlib_stil_fields_uc[STF_LAST]; +const char * sidlib_stil_fields_lc[STF_LAST]; //