comparison src/specifier.c @ 5198:bc3ede8f29a8

fix spacing in some files -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-04-09 Ben Wing <ben@xemacs.org> * fileio.c (check_writable): * fileio.c (Fdo_auto_save): * redisplay-xlike-inc.c (separate_textual_runs_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_mule): * redisplay-xlike-inc.c (separate_textual_runs_mule): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay-xlike-inc.c (XLIKE_output_vertical_divider): * redisplay.c (create_text_block): * redisplay.c (regenerate_window): * redisplay.c (redisplay_window): * redisplay.c (redisplay_device): * redisplay.c (window_line_number): * redisplay.c (point_would_be_visible): * redisplay.c (compute_display_line_dynarr_usage): * specifier.c (prune_specifiers): * specifier.c (finalize_specifier): * specifier.c (make_magic_specifier): * specifier.c (charset_matches_specifier_tag_set_p): * specifier.c (Fdefine_specifier_tag): * specifier.c (setup_device_initial_specifier_tags): * specifier.c (bodily_specifier): * specifier.c (add_spec_to_ghost_specifier): * specifier.c (remove_ghost_specifier): * specifier.c (set_specifier_fallback): * specifier.c (specifier_instance_from_inst_list): * specifier.c (set_specifier_caching): Fix coding style to correspond to GNU standard.
author Ben Wing <ben@xemacs.org>
date Fri, 09 Apr 2010 23:38:02 -0500
parents 71ee43b8a74d
children 1c615eb1e4b2
comparison
equal deleted inserted replaced
5197:ce8ffb95bbe3 5198:bc3ede8f29a8
255 if (! marked_p (rest)) 255 if (! marked_p (rest))
256 { 256 {
257 Lisp_Specifier* sp = XSPECIFIER (rest); 257 Lisp_Specifier* sp = XSPECIFIER (rest);
258 /* A bit of assertion that we're removing both parts of the 258 /* A bit of assertion that we're removing both parts of the
259 magic one altogether */ 259 magic one altogether */
260 assert (!MAGIC_SPECIFIER_P(sp) 260 assert (!MAGIC_SPECIFIER_P (sp)
261 || (BODILY_SPECIFIER_P(sp) && marked_p (sp->fallback)) 261 || (BODILY_SPECIFIER_P (sp) && marked_p (sp->fallback))
262 || (GHOST_SPECIFIER_P(sp) && marked_p (sp->magic_parent))); 262 || (GHOST_SPECIFIER_P (sp) && marked_p (sp->magic_parent)));
263 /* This specifier is garbage. Remove it from the list. */ 263 /* This specifier is garbage. Remove it from the list. */
264 if (NILP (prev)) 264 if (NILP (prev))
265 Vall_specifiers = sp->next_specifier; 265 Vall_specifiers = sp->next_specifier;
266 else 266 else
267 XSPECIFIER (prev)->next_specifier = sp->next_specifier; 267 XSPECIFIER (prev)->next_specifier = sp->next_specifier;
308 #ifndef NEW_GC 308 #ifndef NEW_GC
309 static void 309 static void
310 finalize_specifier (Lisp_Object obj) 310 finalize_specifier (Lisp_Object obj)
311 { 311 {
312 Lisp_Specifier *sp = XSPECIFIER (obj); 312 Lisp_Specifier *sp = XSPECIFIER (obj);
313 if (!GHOST_SPECIFIER_P(sp) && sp->caching) 313 if (!GHOST_SPECIFIER_P (sp) && sp->caching)
314 { 314 {
315 xfree (sp->caching); 315 xfree (sp->caching);
316 sp->caching = 0; 316 sp->caching = 0;
317 } 317 }
318 } 318 }
556 GCPRO1 (bodily); 556 GCPRO1 (bodily);
557 ghost = make_specifier_internal (meths, 0, 0); 557 ghost = make_specifier_internal (meths, 0, 0);
558 UNGCPRO; 558 UNGCPRO;
559 559
560 /* Connect guys together */ 560 /* Connect guys together */
561 XSPECIFIER(bodily)->magic_parent = Qt; 561 XSPECIFIER (bodily)->magic_parent = Qt;
562 XSPECIFIER(bodily)->fallback = ghost; 562 XSPECIFIER (bodily)->fallback = ghost;
563 XSPECIFIER(ghost)->magic_parent = bodily; 563 XSPECIFIER (ghost)->magic_parent = bodily;
564 564
565 return bodily; 565 return bodily;
566 } 566 }
567 567
568 DEFUN ("make-specifier", Fmake_specifier, 1, 1, 0, /* 568 DEFUN ("make-specifier", Fmake_specifier, 1, 1, 0, /*
979 stage) 979 stage)
980 { 980 {
981 Lisp_Object rest; 981 Lisp_Object rest;
982 int res = 0; 982 int res = 0;
983 983
984 assert(stage < NUM_MATCHSPEC_STAGES); 984 assert (stage < NUM_MATCHSPEC_STAGES);
985 985
986 LIST_LOOP (rest, tag_set) 986 LIST_LOOP (rest, tag_set)
987 { 987 {
988 Lisp_Object tag = XCAR (rest); 988 Lisp_Object tag = XCAR (rest);
989 Lisp_Object assoc; 989 Lisp_Object assoc;
1251 invalid_change ("Charset predicate must take one argument", 1251 invalid_change ("Charset predicate must take one argument",
1252 tag); 1252 tag);
1253 } 1253 }
1254 } 1254 }
1255 1255
1256 return define_specifier_tag(tag, device_predicate, charset_predicate); 1256 return define_specifier_tag (tag, device_predicate, charset_predicate);
1257 } 1257 }
1258 1258
1259 /* Called at device-creation time to initialize the user-defined 1259 /* Called at device-creation time to initialize the user-defined
1260 tag values for the newly-created device. */ 1260 tag values for the newly-created device. */
1261 1261
1274 XCDR (XCAR (rest)) = Qt; 1274 XCDR (XCAR (rest)) = Qt;
1275 1275
1276 for (rest = Vuser_defined_tags, rest2 = DEVICE_USER_DEFINED_TAGS (d); 1276 for (rest = Vuser_defined_tags, rest2 = DEVICE_USER_DEFINED_TAGS (d);
1277 !NILP (rest); rest = XCDR (rest), rest2 = XCDR (rest2)) 1277 !NILP (rest); rest = XCDR (rest), rest2 = XCDR (rest2))
1278 { 1278 {
1279 GET_LIST_LENGTH(XCAR(rest), list_len); 1279 GET_LIST_LENGTH (XCAR(rest), list_len);
1280 1280
1281 assert(3 == list_len); 1281 assert (3 == list_len);
1282 1282
1283 device_predicate = XCADR(XCAR (rest)); 1283 device_predicate = XCADR (XCAR (rest));
1284 1284
1285 if (NILP (device_predicate)) 1285 if (NILP (device_predicate))
1286 { 1286 {
1287 XCDR (XCAR (rest2)) = Qt; 1287 XCDR (XCAR (rest2)) = Qt;
1288 } 1288 }
1639 */ 1639 */
1640 static Lisp_Object 1640 static Lisp_Object
1641 bodily_specifier (Lisp_Object spec) 1641 bodily_specifier (Lisp_Object spec)
1642 { 1642 {
1643 return (GHOST_SPECIFIER_P (XSPECIFIER (spec)) 1643 return (GHOST_SPECIFIER_P (XSPECIFIER (spec))
1644 ? XSPECIFIER(spec)->magic_parent : spec); 1644 ? XSPECIFIER (spec)->magic_parent : spec);
1645 } 1645 }
1646 1646
1647 /* Signal error if (specifier SPEC is read-only. 1647 /* Signal error if (specifier SPEC is read-only.
1648 Read only are ghost specifiers unless Vunlock_ghost_specifiers is 1648 Read only are ghost specifiers unless Vunlock_ghost_specifiers is
1649 non-nil. All other specifiers are read-write. 1649 non-nil. All other specifiers are read-write.
2317 add_spec_to_ghost_specifier (Lisp_Object specifier, Lisp_Object instantiator, 2317 add_spec_to_ghost_specifier (Lisp_Object specifier, Lisp_Object instantiator,
2318 Lisp_Object locale, Lisp_Object tag_set, 2318 Lisp_Object locale, Lisp_Object tag_set,
2319 Lisp_Object how_to_add) 2319 Lisp_Object how_to_add)
2320 { 2320 {
2321 int depth = unlock_ghost_specifiers_protected (); 2321 int depth = unlock_ghost_specifiers_protected ();
2322 Fadd_spec_to_specifier (XSPECIFIER(specifier)->fallback, 2322 Fadd_spec_to_specifier (XSPECIFIER (specifier)->fallback,
2323 instantiator, locale, tag_set, how_to_add); 2323 instantiator, locale, tag_set, how_to_add);
2324 unbind_to (depth); 2324 unbind_to (depth);
2325 } 2325 }
2326 2326
2327 struct specifier_spec_list_closure 2327 struct specifier_spec_list_closure
2515 void 2515 void
2516 remove_ghost_specifier (Lisp_Object specifier, Lisp_Object locale, 2516 remove_ghost_specifier (Lisp_Object specifier, Lisp_Object locale,
2517 Lisp_Object tag_set, Lisp_Object exact_p) 2517 Lisp_Object tag_set, Lisp_Object exact_p)
2518 { 2518 {
2519 int depth = unlock_ghost_specifiers_protected (); 2519 int depth = unlock_ghost_specifiers_protected ();
2520 Fremove_specifier (XSPECIFIER(specifier)->fallback, 2520 Fremove_specifier (XSPECIFIER (specifier)->fallback,
2521 locale, tag_set, exact_p); 2521 locale, tag_set, exact_p);
2522 unbind_to (depth); 2522 unbind_to (depth);
2523 } 2523 }
2524 2524
2525 struct copy_specifier_closure 2525 struct copy_specifier_closure
2703 assert (SPECIFIERP (fallback) || 2703 assert (SPECIFIERP (fallback) ||
2704 !NILP (Fvalid_inst_list_p (fallback, Fspecifier_type (specifier)))); 2704 !NILP (Fvalid_inst_list_p (fallback, Fspecifier_type (specifier))));
2705 if (SPECIFIERP (fallback)) 2705 if (SPECIFIERP (fallback))
2706 assert (EQ (Fspecifier_type (specifier), Fspecifier_type (fallback))); 2706 assert (EQ (Fspecifier_type (specifier), Fspecifier_type (fallback)));
2707 if (BODILY_SPECIFIER_P (sp)) 2707 if (BODILY_SPECIFIER_P (sp))
2708 GHOST_SPECIFIER(sp)->fallback = fallback; 2708 GHOST_SPECIFIER (sp)->fallback = fallback;
2709 else 2709 else
2710 sp->fallback = fallback; 2710 sp->fallback = fallback;
2711 /* call the after-change method */ 2711 /* call the after-change method */
2712 MAYBE_SPECMETH (sp, after_change, 2712 MAYBE_SPECMETH (sp, after_change,
2713 (bodily_specifier (specifier), Qfallback)); 2713 (bodily_specifier (specifier), Qfallback));
2793 stage = enumstage; \ 2793 stage = enumstage; \
2794 } 2794 }
2795 2795
2796 FROB (initial, STAGE_INITIAL) 2796 FROB (initial, STAGE_INITIAL)
2797 else FROB (final, STAGE_FINAL) 2797 else FROB (final, STAGE_FINAL)
2798 else assert(0); 2798 else assert (0);
2799 #undef FROB 2799 #undef FROB
2800 2800
2801 } 2801 }
2802 } 2802 }
2803 #endif /* MULE */ 2803 #endif /* MULE */
2804 2804
2805 LIST_LOOP(rest, inst_list) 2805 LIST_LOOP (rest, inst_list)
2806 { 2806 {
2807 Lisp_Object tagged_inst = XCAR (rest); 2807 Lisp_Object tagged_inst = XCAR (rest);
2808 Lisp_Object tag_set = XCAR (tagged_inst); 2808 Lisp_Object tag_set = XCAR (tagged_inst);
2809 Lisp_Object val, the_instantiator; 2809 Lisp_Object val, the_instantiator;
2810 2810
2814 } 2814 }
2815 2815
2816 val = XCDR (tagged_inst); 2816 val = XCDR (tagged_inst);
2817 the_instantiator = val; 2817 the_instantiator = val;
2818 2818
2819 if (!NILP(charset) && 2819 if (!NILP (charset) &&
2820 !(charset_matches_specifier_tag_set_p (charset, tag_set, stage))) 2820 !(charset_matches_specifier_tag_set_p (charset, tag_set, stage)))
2821 { 2821 {
2822 ++respected_charsets; 2822 ++respected_charsets;
2823 continue; 2823 continue;
2824 } 2824 }
3390 if (struct_frame_offset) 3390 if (struct_frame_offset)
3391 assert (value_changed_in_frame); 3391 assert (value_changed_in_frame);
3392 sp->caching->always_recompute = always_recompute; 3392 sp->caching->always_recompute = always_recompute;
3393 Vcached_specifiers = Fcons (specifier, Vcached_specifiers); 3393 Vcached_specifiers = Fcons (specifier, Vcached_specifiers);
3394 if (BODILY_SPECIFIER_P (sp)) 3394 if (BODILY_SPECIFIER_P (sp))
3395 GHOST_SPECIFIER(sp)->caching = sp->caching; 3395 GHOST_SPECIFIER (sp)->caching = sp->caching;
3396 recompute_cached_specifier_everywhere (specifier); 3396 recompute_cached_specifier_everywhere (specifier);
3397 } 3397 }
3398 3398
3399 static void 3399 static void
3400 recompute_one_cached_specifier_in_window (Lisp_Object specifier, 3400 recompute_one_cached_specifier_in_window (Lisp_Object specifier,