aboutsummaryrefslogtreecommitdiff
path: root/src/warnings.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-20 16:09:00 +0200
committerMarvin Borner2021-04-20 16:09:00 +0200
commitfbf9cfee0d22a2750b894c2ddb19dff2a50810b4 (patch)
tree035f30ad32e4302c32b8c6a6641f017747e36f0b /src/warnings.c
parent2415600bb755885154072f28a86d784b32567920 (diff)
All right
Diffstat (limited to 'src/warnings.c')
-rw-r--r--src/warnings.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/warnings.c b/src/warnings.c
index fd11264..d9c7be6 100644
--- a/src/warnings.c
+++ b/src/warnings.c
@@ -11,18 +11,18 @@
struct warning {
u8 exists;
- u32 line;
+ struct context *ctx;
char text[WARNING_LENGTH];
};
static struct warning warnings[WARNING_COUNT] = { 0 };
static u32 warning_index = 0;
-void warnings_add(u32 line, const char *fmt, ...)
+void warnings_add(struct context *ctx, const char *fmt, ...)
{
assert(warning_index + 1 < WARNING_COUNT);
warnings[warning_index].exists = 1;
- warnings[warning_index].line = line;
+ warnings[warning_index].ctx = ctx;
va_list ap;
va_start(ap, fmt);
@@ -40,7 +40,8 @@ void warnings_print(void)
continue;
/* gui_show_warning(warnings[i].text); */
- printf("Line %d: %s\n", warnings[i].line, warnings[i].text);
+ printf("Line %d:%d: %s\n", warnings[i].ctx->line, warnings[i].ctx->column,
+ warnings[i].text);
}
}