comparison src/symbols.c @ 3017:1e7cc382eb16

[xemacs-hg @ 2005-10-24 10:07:26 by ben] refactor mc-alloc dependencies next-error.el, occur.el: Fix some byte-compile warnings. alloc.c, buffer.c, buffer.h, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, console-impl.h, console-msw-impl.h, console.c, data.c, database.c, device-impl.h, device-msw.c, device.c, dialog-msw.c, elhash.c, events.h, extents-impl.h, extents.c, faces.c, faces.h, file-coding.c, file-coding.h, frame-impl.h, frame.c, glyphs.c, glyphs.h, gui.c, gui.h, keymap.c, lisp.h, lrecord.h, lstream.c, lstream.h, mule-charset.c, objects-impl.h, objects.c, opaque.c, opaque.h, print.c, process.c, procimpl.h, rangetab.c, rangetab.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, specifier.c, specifier.h, symbols.c, symeval.h, toolbar.c, toolbar.h, tooltalk.c, ui-gtk.c, ui-gtk.h, unicode.c, window-impl.h, window.c: Eliminate the majority of #ifdef MC_ALLOC occurrences through macros LCRECORD_HEADER, ALLOC_LCRECORD_TYPE, MALLOCED_STORAGE_SIZE, etc. (defined in lrecord.h).
author ben
date Mon, 24 Oct 2005 10:07:42 +0000
parents ec5f23ea6d2e
children b7f26b2f78bd
comparison
equal deleted inserted replaced
3016:f252275fb013 3017:1e7cc382eb16
2185 } 2185 }
2186 } 2186 }
2187 2187
2188 { 2188 {
2189 struct symbol_value_buffer_local *bfwd 2189 struct symbol_value_buffer_local *bfwd
2190 #ifdef MC_ALLOC 2190 = ALLOC_LCRECORD_TYPE (struct symbol_value_buffer_local,
2191 = alloc_lrecord_type (struct symbol_value_buffer_local,
2192 &lrecord_symbol_value_buffer_local);
2193 #else /* not MC_ALLOC */
2194 = alloc_lcrecord_type (struct symbol_value_buffer_local,
2195 &lrecord_symbol_value_buffer_local); 2191 &lrecord_symbol_value_buffer_local);
2196 #endif /* not MC_ALLOC */
2197 Lisp_Object foo; 2192 Lisp_Object foo;
2198 bfwd->magic.type = SYMVAL_BUFFER_LOCAL; 2193 bfwd->magic.type = SYMVAL_BUFFER_LOCAL;
2199 2194
2200 bfwd->default_value = find_symbol_value (variable); 2195 bfwd->default_value = find_symbol_value (variable);
2201 bfwd->current_value = valcontents; 2196 bfwd->current_value = valcontents;
2298 ABORT (); 2293 ABORT ();
2299 } 2294 }
2300 } 2295 }
2301 2296
2302 /* Make sure variable is set up to hold per-buffer values */ 2297 /* Make sure variable is set up to hold per-buffer values */
2303 #ifdef MC_ALLOC 2298 bfwd = ALLOC_LCRECORD_TYPE (struct symbol_value_buffer_local,
2304 bfwd = alloc_lrecord_type (struct symbol_value_buffer_local,
2305 &lrecord_symbol_value_buffer_local);
2306 #else /* not MC_ALLOC */
2307 bfwd = alloc_lcrecord_type (struct symbol_value_buffer_local,
2308 &lrecord_symbol_value_buffer_local); 2299 &lrecord_symbol_value_buffer_local);
2309 #endif /* not MC_ALLOC */
2310 bfwd->magic.type = SYMVAL_SOME_BUFFER_LOCAL; 2300 bfwd->magic.type = SYMVAL_SOME_BUFFER_LOCAL;
2311 2301
2312 bfwd->current_buffer = Qnil; 2302 bfwd->current_buffer = Qnil;
2313 bfwd->current_alist_element = Qnil; 2303 bfwd->current_alist_element = Qnil;
2314 bfwd->current_value = valcontents; 2304 bfwd->current_value = valcontents;
3023 CHECK_SYMBOL (handler_type); 3013 CHECK_SYMBOL (handler_type);
3024 htype = decode_magic_handler_type (handler_type); 3014 htype = decode_magic_handler_type (handler_type);
3025 valcontents = XSYMBOL (variable)->value; 3015 valcontents = XSYMBOL (variable)->value;
3026 if (!SYMBOL_VALUE_LISP_MAGIC_P (valcontents)) 3016 if (!SYMBOL_VALUE_LISP_MAGIC_P (valcontents))
3027 { 3017 {
3028 #ifdef MC_ALLOC 3018 bfwd = ALLOC_LCRECORD_TYPE (struct symbol_value_lisp_magic,
3029 bfwd = alloc_lrecord_type (struct symbol_value_lisp_magic,
3030 &lrecord_symbol_value_lisp_magic);
3031 #else /* MC_ALLOC */
3032 bfwd = alloc_lcrecord_type (struct symbol_value_lisp_magic,
3033 &lrecord_symbol_value_lisp_magic); 3019 &lrecord_symbol_value_lisp_magic);
3034 #endif /* not MC_ALLOC */
3035 bfwd->magic.type = SYMVAL_LISP_MAGIC; 3020 bfwd->magic.type = SYMVAL_LISP_MAGIC;
3036 for (i = 0; i < MAGIC_HANDLER_MAX; i++) 3021 for (i = 0; i < MAGIC_HANDLER_MAX; i++)
3037 { 3022 {
3038 bfwd->handler[i] = Qnil; 3023 bfwd->handler[i] = Qnil;
3039 bfwd->harg[i] = Qnil; 3024 bfwd->harg[i] = Qnil;
3164 if (SYMBOL_VALUE_MAGIC_P (valcontents) 3149 if (SYMBOL_VALUE_MAGIC_P (valcontents)
3165 && !UNBOUNDP (valcontents)) 3150 && !UNBOUNDP (valcontents))
3166 invalid_change ("Variable is magic and cannot be aliased", variable); 3151 invalid_change ("Variable is magic and cannot be aliased", variable);
3167 reject_constant_symbols (variable, Qunbound, 0, Qt); 3152 reject_constant_symbols (variable, Qunbound, 0, Qt);
3168 3153
3169 #ifdef MC_ALLOC 3154 bfwd = ALLOC_LCRECORD_TYPE (struct symbol_value_varalias,
3170 bfwd = alloc_lrecord_type (struct symbol_value_varalias,
3171 &lrecord_symbol_value_varalias);
3172 #else /* not MC_ALLOC */
3173 bfwd = alloc_lcrecord_type (struct symbol_value_varalias,
3174 &lrecord_symbol_value_varalias); 3155 &lrecord_symbol_value_varalias);
3175 #endif /* not MC_ALLOC */
3176 bfwd->magic.type = SYMVAL_VARALIAS; 3156 bfwd->magic.type = SYMVAL_VARALIAS;
3177 bfwd->aliasee = alias; 3157 bfwd->aliasee = alias;
3178 bfwd->shadowed = valcontents; 3158 bfwd->shadowed = valcontents;
3179 3159
3180 valcontents = wrap_symbol_value_magic (bfwd); 3160 valcontents = wrap_symbol_value_magic (bfwd);