From 90bb6f057d117e809d981afb06bedbe08e9ff654 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 25 Apr 2024 14:05:05 +1200 Subject: [PATCH] Report previous "already fixed" location for Compass MAK --- src/datain.c | 5 +++++ tests/badmak.out | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/datain.c b/src/datain.c index 9246564e..ab3f78cd 100644 --- a/src/datain.c +++ b/src/datain.c @@ -909,6 +909,10 @@ data_file_compass_mak(void) POS(stn, 1) = y; POS(stn, 2) = z; fix(stn); + + // Make the station's file:line location reflect this fix. + name->filename = file.filename; + name->line = file.line; } else { filepos fp; get_pos(&fp); @@ -921,6 +925,7 @@ data_file_compass_mak(void) compile_diagnostic(DIAG_WARN|DIAG_WORD, /*Station already fixed at the same coordinates*/55); } set_pos(&fp); + compile_diagnostic_pfx(DIAG_INFO, name, /*Previously fixed or equated here*/493); } while (ch != ']' && ch != EOF) nextch_handling_eol(); if (ch == ']') { diff --git a/tests/badmak.out b/tests/badmak.out index 0525ce14..175d3b8d 100644 --- a/tests/badmak.out +++ b/tests/badmak.out @@ -7,9 +7,11 @@ ./badmak.mak:4:29: warning: Station already fixed at the same coordinates C2 [n,10.23,20.47,1234.56], C3 [m,10.23,20.47,1234.56], ^~ +./badmak.mak:3: info: Previously fixed or equated here ./badmak.mak:5:1: error: Station already fixed or equated to a fixed point C3 [f,10.23,20.47,1234.56]; ^~ +./badmak.mak:3: info: Previously fixed or equated here Removing trailing traverses... -- 2.11.4.GIT