summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-03-21 13:56:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-03-21 13:56:22 -0700
commit7b1123d824e51d40496c242e7a7f173de8936100 (patch)
tree0aaafb8bc660f02c35516227bfde2fef344d318a /src/editfns.c
parentd6723bf7e58e17c889e354bc429f3f134281953a (diff)
downloademacs-7b1123d824e51d40496c242e7a7f173de8936100.tar.gz
Use functions and constants to manipulate Lisp_Save_Value objects.
This replaces code that used macros and strings and token-pasting. The change makes the C source a bit easier to follow, and shrinks the Emacs executable a bit. * alloc.c: Verify some properties of Lisp_Save_Value's representation. (make_save_value): Change 1st arg from string to enum. All callers changed. (INTX): Remove. (mark_object): Use if, not #if, for GC_MARK_STACK. * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER) (XSAVE_OBJECT): Now functions, not macros. (STRING_BYTES_BOUND): Now just a macro, not a constant too; the constant was never used. (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT) (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ) (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ) (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY): New constants. (struct Lisp_Save_Value): Replace members area, type0, type1, type2, type3 with a single member save_type. All uses changed. (save_type, set_save_pointer, set_save_integer): New functions. * print.c (PRINTX): Remove.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c
index f34c574cae3..6357a28e8ea 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -839,7 +839,7 @@ Lisp_Object
save_excursion_save (void)
{
return make_save_value
- ("oooo",
+ (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ,
Fpoint_marker (),
/* Do not copy the mark if it points to nowhere. */
(XMARKER (BVAR (current_buffer, mark))->buffer
@@ -4241,7 +4241,10 @@ usage: (format STRING &rest OBJECTS) */)
memcpy (buf, initial_buffer, used);
}
else
- XSAVE_POINTER (buf_save_value, 0) = buf = xrealloc (buf, bufsize);
+ {
+ buf = xrealloc (buf, bufsize);
+ set_save_pointer (buf_save_value, 0, buf);
+ }
p = buf + used;
}