From 27e04e9dbfbd69f850504835e9253862df2db680 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 13 Nov 2022 19:27:58 -0800 Subject: [PATCH] Fix up style in `parseComments` This does the following: - Wrap lines that are too long (around 80 columns) - Place the asterisk with the type instead of the variable name --- desktop_version/src/Music.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 67de4947..fa0513c3 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -477,14 +477,15 @@ end: } /* Lifted from SDL_mixer, we used it in 2.3 and previous */ - static void parseComments(MusicTrack* t, char** comments, int comment_list_length) - { + static void parseComments( + MusicTrack* t, char** comments, const int comment_list_length + ) { int loopend = 0; for (int i = 0; i < comment_list_length; i++) { - char *param = SDL_strdup(comments[i]); - char *argument = param; - char *value = SDL_strchr(param, '='); + char* param = SDL_strdup(comments[i]); + char* argument = param; + char* value = SDL_strchr(param, '='); if (value == NULL) { value = param + SDL_strlen(param); @@ -498,7 +499,8 @@ end: * string if it is present at position 4. */ char buf[5]; SDL_strlcpy(buf, argument, sizeof(buf)); - if (SDL_strcasecmp(buf, "LOOP") == 0 && ((argument[4] == '_') || (argument[4] == '-'))) + if (SDL_strcasecmp(buf, "LOOP") == 0 + && ((argument[4] == '_') || (argument[4] == '-'))) { SDL_memmove(argument + 4, argument + 5, SDL_strlen(argument) - 4); }