From 0268f130800c07231a8ffa34f5674bd5d58cdf68 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Fri, 7 Apr 2017 16:17:27 -0700 Subject: [PATCH] common: include newline in debug logger So it isn't necessary to add it each time. Signed-off-by: Max Regan --- src/common.h | 1 + src/gbasm/assemble.c | 4 ++-- src/gbasm/parser.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common.h b/src/common.h index 540b19b..aca5ad1 100644 --- a/src/common.h +++ b/src/common.h @@ -47,6 +47,7 @@ void downcase(char *str); __FILE__, __LINE__, \ __func__); \ printf(__VA_ARGS__); \ + printf("\n"); \ } \ } while (0) diff --git a/src/gbasm/assemble.c b/src/gbasm/assemble.c index 21b8720..8cc6dd1 100644 --- a/src/gbasm/assemble.c +++ b/src/gbasm/assemble.c @@ -21,10 +21,10 @@ int gbasm_assemble(char *program, struct emitter *emitter) return num_insts; } - DEBUG_LOG("parsed %d instructions\n", num_insts); + DEBUG_LOG("parsed %d instructions", num_insts); for (int i = 0; i < num_insts; i++) { - DEBUG_LOG("emitting %s\n", insts[i].opcode); + DEBUG_LOG("emitting %s", insts[i].opcode); const struct gbasm_op_info *info = gbasm_get_opcode_info(insts[i].opcode); if (info == NULL) { gbasm_unknown_opcode_error(&insts[i]); diff --git a/src/gbasm/parser.c b/src/gbasm/parser.c index c40d866..a52a262 100644 --- a/src/gbasm/parser.c +++ b/src/gbasm/parser.c @@ -104,7 +104,7 @@ int gbasm_parse_buffer(char *buffer, gbasm_parse_tokens(&insts[inst_num], (const char **)line_tokens, num_tokens); - DEBUG_LOG("token: %s\n", insts[inst_num].opcode); + DEBUG_LOG("token: %s", insts[inst_num].opcode); insts[inst_num].line_num = line_num; /* TODO: Fill these out */