lorid

convert chordpro to pdf
git clone git://git.relim.de/lorid.git
Log | Files | Refs | README | LICENSE

commit 78d4be4302a623b81db0ccb4f09831964dc2a690
parent 1339f74798fa7251bdee3d219a993ef2dbd6dacb
Author: nibo <nibo@relim.de>
Date:   Thu, 20 Feb 2025 15:25:22 +0100

Remove unnecessary statements setting variables to NULL

Diffstat:
Msrc/chordpro.c | 12+-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/chordpro.c b/src/chordpro.c @@ -5579,24 +5579,14 @@ cho_songs_parse(const char *str, const char *chordpro_filepath, struct Config *c ctx.so++; ctx.songs = erealloc(ctx.songs, (ctx.so+1) * sizeof(struct ChoSong *)); ctx.songs[ctx.so] = NULL; - ctx.current_ttype = TT_TEXT; - ctx.prev_ttype = TT_TEXT; - ctx.config = NULL; - ctx.chordpro_filepath = NULL; free(ctx.transpose_history); - ctx.transpose_history = NULL; - ctx.transpose = NULL; - ctx.line_number = 1; for (e = 0; e<ctx.ia; e++) { cho_image_free(ctx.image_assets[e]); } free(ctx.image_assets); - ctx.image_assets = NULL; - ctx.ia = 0; bool exist_title = false; for (ctx.so = 0; ctx.songs[ctx.so]; ctx.so++) { for (ctx.m = 0; ctx.songs[ctx.so]->metadata[ctx.m]; ctx.m++) { - printf("so: %d, %s = %s\n", ctx.so, ctx.songs[ctx.so]->metadata[ctx.m]->name, ctx.songs[ctx.so]->metadata[ctx.m]->value); if ( !strcmp(ctx.songs[ctx.so]->metadata[ctx.m]->name, "title") && ctx.songs[ctx.so]->metadata[ctx.m]->value && @@ -5606,8 +5596,8 @@ cho_songs_parse(const char *str, const char *chordpro_filepath, struct Config *c } } if (!exist_title) { + /* INFO: This cho_log() is not line specific. It's a workaround. */ ctx.line_number = 0; - /* INFO: This cho_log(ctx, ) is not line specific. It's a workaround. */ cho_log(&ctx, LOG_ERR, "Song has no title."); return NULL; }