summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-11-19 01:17:15 +0000
committerElijah Newren <newren@src.gnome.org>2005-11-19 01:17:15 +0000
commit861f81961584b94d9af2cc67dd4c04b1accdfbca (patch)
treef5da26c359cc17d779e328de3cac195b3b12ca3b
parent4455df299c2e11a761c735e6e10daaa4ddc2ffdd (diff)
downloadmetacity-861f81961584b94d9af2cc67dd4c04b1accdfbca.tar.gz
Uh, I was pretty sure I had tested the last patch. I must have forgotten
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
-rw-r--r--ChangeLog9
-rw-r--r--src/constraints.c18
2 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index b3a6b7f1..2e75c923 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;