From 77ef4a7013ae601066ad1d48092d223f15e91164 Mon Sep 17 00:00:00 2001
From: marcobaye <marcobaye@4df02467-bbd4-4a76-a152-e7ce94205b78>
Date: Wed, 13 Mar 2024 01:08:45 +0000
Subject: [PATCH] small change to prepare for new feature

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@361 4df02467-bbd4-4a76-a152-e7ce94205b78
---
 src/acme.c    | 5 +++--
 src/global.h  | 1 +
 src/version.h | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/acme.c b/src/acme.c
index a69450c..f69020a 100644
--- a/src/acme.c
+++ b/src/acme.c
@@ -344,6 +344,7 @@ static void perform_pass(void)
 	// init variables
 	pass.undefined_count = 0;
 	//pass.needvalue_count = 0;	FIXME - use
+	pass.changed_count = 0;
 	pass.error_count = 0;
 	pass.warning_count = 0;
 	// Process toplevel files
@@ -362,7 +363,7 @@ static void perform_pass(void)
 	// in the future to two general expressions, this is the point where
 	// they would need to be evaluated.
 	if (config.process_verbosity >= 8)
-		printf("Found %d undefined expressions.\n", pass.undefined_count);
+		printf("Undefined expressions: %d. Symbol updates: %d.\n", pass.undefined_count, pass.changed_count);
 	if (pass.error_count)
 		exit(ACME_finalize(EXIT_FAILURE));
 }
@@ -387,7 +388,7 @@ static void do_actual_work(void)
 	undefs_before = pass.undefined_count + 1;
 	// keep doing passes as long as the number of undefined results keeps decreasing.
 	// stop on zero (FIXME - zero-check pass.needvalue_count instead!)
-	while (pass.undefined_count && (pass.undefined_count < undefs_before)) {
+	while ((pass.undefined_count && (pass.undefined_count < undefs_before)) || pass.changed_count) {
 		undefs_before = pass.undefined_count;
 		perform_pass();
 		if (--sanity.passes_left < 0) {
diff --git a/src/global.h b/src/global.h
index 98016fc..26692bd 100644
--- a/src/global.h
+++ b/src/global.h
@@ -112,6 +112,7 @@ struct pass {
 	int	number;	// counts up from zero
 	int	undefined_count;	// counts undefined expression results (if this stops decreasing, next pass must list them as errors)
 	//int	needvalue_count;	// counts undefined expression results actually needed for output (when this hits zero, we're done)	FIXME - use
+	int	changed_count;	// count symbol changes (if nonzero, another pass is needed)
 	int	error_count;
 	int	warning_count;
 	boolean	complain_about_undefined;	// will be FALSE until error pass is needed
diff --git a/src/version.h b/src/version.h
index 12283dc..fd1e90e 100644
--- a/src/version.h
+++ b/src/version.h
@@ -9,7 +9,7 @@
 
 #define RELEASE		"0.97"		// update before release	FIXME
 #define CODENAME	"Zem"		// update before release
-#define CHANGE_DATE	"4 Mar"	// update before release	FIXME
+#define CHANGE_DATE	"5 Mar"	// update before release	FIXME
 #define CHANGE_YEAR	"2024"		// update before release
 //#define HOME_PAGE	"http://home.pages.de/~mac_bacon/smorbrod/acme/"
 #define HOME_PAGE	"http://sourceforge.net/p/acme-crossass/"	// FIXME