[gnumeric] Dependends: kill warnings.



commit 310c6bbbc2cf22cbf9450b47178a188ea631e82b
Author: Morten Welinder <terra gnome org>
Date:   Fri Jul 27 21:48:12 2012 -0400

    Dependends: kill warnings.
    
    Things have been rearranged so that the assert that we be on top of the
    compute stack isn't right anymore.  So don't complain when we're not.

 ChangeLog       |    7 +++++++
 src/dependent.c |   15 +++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 279c3c0..729205c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-27  Morten Welinder  <terra gnome org>
+
+	* src/dependent.c (cell_dep_eval): Don't complain if we're not
+	finished with the eval.  That can and will happen with circular
+	dependents.  (It didn't use to because we had two different ways
+	into this code.)
+
 2012-07-26  Jean Brefort  <jean brefort normalesup org>
 
 	* component/gnumeric.c (go_gnm_component_get_data),
diff --git a/src/dependent.c b/src/dependent.c
index 577d739..32e2f66 100644
--- a/src/dependent.c
+++ b/src/dependent.c
@@ -1157,10 +1157,8 @@ static void
 cell_dep_eval (GnmDependent *dep)
 {
 	gboolean finished = gnm_cell_eval_content (GNM_DEP_TO_CELL (dep));
+	(void)finished; /* We don't currently care */
 	dep->flags &= ~GNM_CELL_HAS_NEW_EXPR;
-
-	/* This should always be the top of the stack */
-	g_return_if_fail (finished);
 }
 
 static void
@@ -1557,6 +1555,10 @@ dependent_eval (GnmDependent *dep)
 		dependent_clear_dynamic_deps (dep);
 		dep->flags &= ~DEPENDENT_HAS_DYNAMIC_DEPS;
 	}
+
+	/*
+	 * Problem: this really should be a tail call.
+	 */
 	klass->eval (dep);
 
 	/* Don't clear flag until after in case we iterate */
@@ -1566,8 +1568,13 @@ dependent_eval (GnmDependent *dep)
 void
 gnm_cell_eval (GnmCell *cell)
 {
-	if (gnm_cell_needs_recalc (cell))
+	if (gnm_cell_needs_recalc (cell)) {
+		/*
+		 * This should be a tail call so the stack frame can be
+		 * eliminated before the call.
+		 */
 		dependent_eval (GNM_CELL_TO_DEP (cell));
+	}
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]