summaryrefslogtreecommitdiffstats
path: root/dimension/utility.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-12-19 19:16:33 -0500
committerTavian Barnes <tavianator@gmail.com>2009-12-19 19:27:26 -0500
commit970ecabc1ad30fa74e58f3d4ad9ccf41baffb8b0 (patch)
treefd2d4eb68391a5b911d5a158a5506487d04a6298 /dimension/utility.c
parent51fda684667044e2fe3e56f28137ef5397ef03ee (diff)
downloaddimension-970ecabc1ad30fa74e58f3d4ad9ccf41baffb8b0.tar.xz
Implement a symbol table.
Diffstat (limited to 'dimension/utility.c')
-rw-r--r--dimension/utility.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/dimension/utility.c b/dimension/utility.c
index 1961d3e..012e704 100644
--- a/dimension/utility.c
+++ b/dimension/utility.c
@@ -22,13 +22,17 @@
#include <stdio.h>
void
-dmnsn_diagnostic(const char *filename, unsigned int line, unsigned int col,
- const char *format, ...)
+dmnsn_diagnostic(const char *filename, int line, int col, const char *format,
+ ...)
{
va_list ap;
va_start(ap, format);
- fprintf(stderr, "%s:%u:%u: ", filename, line, col);
+ if (line >= 0 && col >= 0) {
+ fprintf(stderr, "%s:%d:%d: ", filename, line, col);
+ } else {
+ fprintf(stderr, "%s: ", filename);
+ }
vfprintf(stderr, format, ap);
fprintf(stderr, "\n");