From: Andrea Corallo Date: Sun, 22 Dec 2019 07:12:27 +0000 (+0100) Subject: some rename on compilation unit struct X-Git-Tag: emacs-28.0.90~2727^2~902 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c8b46514d87856e5e2044bce804ad0156097d04;p=emacs.git some rename on compilation unit struct --- diff --git a/src/alloc.c b/src/alloc.c index 547990c7a9e..d47f9c8a574 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3026,8 +3026,8 @@ cleanup_vector (struct Lisp_Vector *vector) #ifdef HAVE_NATIVE_COMP else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_NATIVE_COMP_UNIT)) { - struct Lisp_Native_Compilation_Unit *cu = - PSEUDOVEC_STRUCT (vector, Lisp_Native_Compilation_Unit); + struct Lisp_Native_Comp_Unit *cu = + PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); eassert (cu->handle); dynlib_close (cu->handle); } @@ -6576,7 +6576,7 @@ mark_object (Lisp_Object arg) case PVEC_NATIVE_COMP_UNIT: set_vector_marked (ptr); /* FIXME see comp.h. */ - mark_object (XCOMPILATION_UNIT (obj)->data_vec); + mark_object (XNATIVE_COMP_UNIT (obj)->data_vec); #endif break; case PVEC_FREE: diff --git a/src/comp.c b/src/comp.c index 71d4d79f9e7..c74e5cf2e6c 100644 --- a/src/comp.c +++ b/src/comp.c @@ -3227,7 +3227,7 @@ load_static_obj (dynlib_handle_ptr handle, const char *name) static void load_comp_unit (Lisp_Object comp_u_obj, Lisp_Object file) { - struct Lisp_Native_Compilation_Unit *comp_u = XCOMPILATION_UNIT (comp_u_obj); + struct Lisp_Native_Comp_Unit *comp_u = XNATIVE_COMP_UNIT (comp_u_obj); dynlib_handle_ptr handle = comp_u->handle; struct thread_state ***current_thread_reloc = dynlib_sym (handle, CURRENT_THREAD_RELOC_SYM); @@ -3271,7 +3271,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec) { Lisp_Object comp_u = XCAR (load_handle_stack); - dynlib_handle_ptr handle = XCOMPILATION_UNIT (comp_u)->handle; + dynlib_handle_ptr handle = XNATIVE_COMP_UNIT (comp_u)->handle; if (!handle) xsignal0 (Qwrong_register_subr_call); @@ -3313,7 +3313,7 @@ DEFUN ("native-elisp-load", Fnative_elisp_load, Snative_elisp_load, 1, 1, 0, /* FIXME non portable. */ /* We copy the content of the file to be loaded in a memory mapped file. We then keep track of this in the struct - Lisp_Native_Compilation_Unit. In case this will be overwritten + Lisp_Native_Comp_Unit. In case this will be overwritten or delete we'll dump the right data. */ int fd_in = emacs_open (SSDATA (file), O_RDONLY, 0); int fd_out = memfd_create (SSDATA (file), 0); diff --git a/src/comp.h b/src/comp.h index 876615e8dd4..04c57278667 100644 --- a/src/comp.h +++ b/src/comp.h @@ -23,7 +23,7 @@ along with GNU Emacs. If not, see . */ #include -struct Lisp_Native_Compilation_Unit +struct Lisp_Native_Comp_Unit { union vectorlike_header header; /* Compilation unit file descriptor and handle. */ @@ -33,16 +33,16 @@ struct Lisp_Native_Compilation_Unit }; INLINE bool -COMPILATIONP_UNITP (Lisp_Object a) +NATIVE_COMP_UNITP (Lisp_Object a) { return PSEUDOVECTORP (a, PVEC_NATIVE_COMP_UNIT); } -INLINE struct Lisp_Native_Compilation_Unit * -XCOMPILATION_UNIT (Lisp_Object a) +INLINE struct Lisp_Native_Comp_Unit * +XNATIVE_COMP_UNIT (Lisp_Object a) { - eassert (COMPILATIONP_UNITP (a)); - return XUNTAG (a, Lisp_Vectorlike, struct Lisp_Native_Compilation_Unit); + eassert (NATIVE_COMP_UNITP (a)); + return XUNTAG (a, Lisp_Vectorlike, struct Lisp_Native_Comp_Unit); } /* Defined in comp.c. */ diff --git a/src/lisp.h b/src/lisp.h index 3d467a84d18..2e4a6c89846 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4772,11 +4772,11 @@ SUBRP_NATIVE_COMPILEDP (Lisp_Object a) INLINE Lisp_Object make_native_comp_u (int fd, dynlib_handle_ptr handle) { - struct Lisp_Native_Compilation_Unit *x = - (struct Lisp_Native_Compilation_Unit *) allocate_pseudovector ( - VECSIZE (struct Lisp_Native_Compilation_Unit), - 0, VECSIZE (struct Lisp_Native_Compilation_Unit), - PVEC_NATIVE_COMP_UNIT); + struct Lisp_Native_Comp_Unit *x = + (struct Lisp_Native_Comp_Unit *) allocate_pseudovector ( + VECSIZE (struct Lisp_Native_Comp_Unit), + 0, VECSIZE (struct Lisp_Native_Comp_Unit), + PVEC_NATIVE_COMP_UNIT); x->fd = fd; x->handle = handle; Lisp_Object cu; diff --git a/src/print.c b/src/print.c index e7ddafbbbbd..4d7932a81d7 100644 --- a/src/print.c +++ b/src/print.c @@ -1829,7 +1829,7 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, case PVEC_NATIVE_COMP_UNIT: { print_c_string ("#fd); + int len = sprintf (buf, "%d", XNATIVE_COMP_UNIT (obj)->fd); strout (buf, len, len, printcharfun); printchar ('>', printcharfun); }