comparison src/xfaces.c @ 55982:de4c259f651b

Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385 src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected
author Miles Bader <miles@gnu.org>
date Tue, 08 Jun 2004 07:06:19 +0000
parents b9f354f2c61f
children 109c0a603543 8e09aff3715a
comparison
equal deleted inserted replaced
55981:92b7aae8907e 55982:de4c259f651b
3167 }; 3167 };
3168 3168
3169 3169
3170 /* If a face merging cycle is detected for FACE_NAME, return 0, 3170 /* If a face merging cycle is detected for FACE_NAME, return 0,
3171 otherwise add NEW_NAMED_MERGE_POINT, which is initialized using 3171 otherwise add NEW_NAMED_MERGE_POINT, which is initialized using
3172 FACE_NAME, as the head of the linked list 3172 FACE_NAME, as the head of the linked list pointed to by
3173 pointed to by NAMED_MERGE_POINTS, and return 1. */ 3173 NAMED_MERGE_POINTS, and return 1. */
3174 3174
3175 static INLINE int 3175 static INLINE int
3176 push_named_merge_point (struct named_merge_point *new_named_merge_point, 3176 push_named_merge_point (struct named_merge_point *new_named_merge_point,
3177 Lisp_Object face_name, 3177 Lisp_Object face_name,
3178 struct named_merge_point **named_merge_points) 3178 struct named_merge_point **named_merge_points)
3179 { 3179 {
3180 struct named_merge_point *prev; 3180 struct named_merge_point *prev;
3181 3181
3182 for (prev = *named_merge_points; prev; prev = prev->prev) 3182 for (prev = *named_merge_points; prev; prev = prev->prev)
3183 if (EQ (face_name, prev->face_name)) 3183 if (EQ (face_name, prev->face_name))
3184 break; 3184 return 0;
3185 3185
3186 new_named_merge_point->face_name = face_name; 3186 new_named_merge_point->face_name = face_name;
3187 new_named_merge_point->prev = *named_merge_points; 3187 new_named_merge_point->prev = *named_merge_points;
3188 3188
3189 *named_merge_points = new_named_merge_point; 3189 *named_merge_points = new_named_merge_point;