diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/constraints.c | 18 |
2 files changed, 16 insertions, 11 deletions
@@ -1,5 +1,14 @@ 2005-11-18 Elijah Newren <newren@gmail.com> + Uh, I was pretty sure I had tested the last patch. I must have + forgotten the last part I added--the ConstraintFunc consolidation. + How embarrassing. + + * src/constraints.c (do_all_constraints): fix up pointer + arithmetic and make it actually work + +2005-11-18 Elijah Newren <newren@gmail.com> + Do the cleanups requested by Havoc in his review. * constraints-ideas.txt: Update for the recent changes diff --git a/src/constraints.c b/src/constraints.c index a4616b41..4e880280 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -219,18 +219,15 @@ do_all_constraints (MetaWindow *window, ConstraintPriority priority, gboolean check_only) { - const ConstraintFunc *constraint; - const char *constraint_name; - gboolean satisfied; - - constraint = &all_constraints[0].func; - constraint_name = all_constraints[0].name; + const Constraint *constraint; + gboolean satisfied; + constraint = &all_constraints[0]; satisfied = TRUE; - while (*constraint) + while (constraint->func != NULL) { satisfied = satisfied && - (*constraint) (window, info, priority, check_only); + (*constraint->func) (window, info, priority, check_only); if (!check_only) { @@ -239,18 +236,17 @@ do_all_constraints (MetaWindow *window, "info->current is %d,%d +%d,%d after %s\n", info->current.x, info->current.y, info->current.width, info->current.height, - constraint_name); + constraint->name); } else if (!satisfied) { /* Log which constraint was not satisfied */ meta_topic (META_DEBUG_GEOMETRY, "constraint %s not satisfied.\n", - constraint_name); + constraint->name); return FALSE; } ++constraint; - ++constraint_name; } return TRUE; |