aboutsummaryrefslogtreecommitdiffstats
path: root/admin/coccinelle (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prefer 'list (...)' to 'listn (N, ...)'Stefan Kangas2025-01-191-0/+7
| | | | | | | | | | * src/androidfns.c (Fandroid_query_battery): * src/buffer.c (make_lispy_itree_node): * src/keyboard.c (init_while_no_input_ignore_events): * src/window.c (Fset_window_configuration): * src/xterm.c (x_dnd_send_unsupported_drop): Prefer 'list (...)' to 'listn (N, ...)'. * admin/coccinelle/listn.cocci: New file.
* Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'Stefan Kangas2025-01-151-0/+21
| | | | | | | | | | | * src/comp.c (emit_limple_insn): * src/msdos.c (dos_set_keyboard, dos_rawgetc): * src/sysdep.c (convert_speed, list_system_processes): * src/w32fns.c (deliver_wm_chars, Fx_file_dialog): * src/w32term.c (record_event, w32_read_socket): Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'. * admin/coccinelle/arrayelts.cocci: New file.
* Use calln instead of calling Ffuncall directlyStefan Kangas2025-01-141-0/+21
| | | | | | | | | | | * src/bytecode.c (bcall0): * src/comp.c (bcall0): * src/eval.c (apply1): * src/lisp.h (call0): * src/thread.c (invoke_thread_function): Use calln instead of calling Ffuncall directly. * admin/coccinelle/calln.cocci: New semantic patch.
* Delete obsolete coccinelle filesStefan Kangas2025-01-132-369/+0
| | | | | | | | These files relates to a 13 year old attempt at a generational GC that was never merged. * admin/coccinelle/frame.cocci: * admin/coccinelle/window.cocci: Delete files.
* Delete obsolete file process.cocciStefan Kangas2024-06-231-110/+0
| | | | | | * admin/coccinelle/process.cocci: Delete file. This semantic patch was converting code to use the PVAR macro, which was removed by Paul Eggert on 2012-08-17 (commit 6a09a33b5551).
* Update Coccinelle URLStefan Kangas2024-06-181-2/+4
| | | | * admin/coccinelle/README: Update URL.
* Remove redundant casts from void* with malloc functionsStefan Kangas2024-01-101-0/+6
| | | | | | | | | | * src/msdos.c (IT_menu_make_room): * src/pgtkterm.c (pgtk_define_fringe_bitmap): * src/w16select.c (set_clipboard_data): * src/w32term.c (w32_define_fringe_bitmap): * src/w32uniscribe.c (uniscribe_shape): Remove redundant cast from void* with xrealloc. * admin/coccinelle/alloc_cast.cocci: New semantic patch.
* Support string literals in build_string.cocciStefan Kangas2024-01-081-0/+6
| | | | * admin/coccinelle/build_string.cocci: Support string literals.
* Remove semantic patch for adjusting `XSAVE_*`Stefan Kangas2024-01-041-11/+0
| | | | | * admin/coccinelle/xsave.cocci: Delete file. The corresponding macros were removed in 4139c98eb5f 2018-06-14 "Remove Lisp_Misc_Save_Value".
* Prefer build_unibyte_string where applicableStefan Kangas2024-01-041-0/+6
| | | | | | | * src/fns.c (syms_of_fns): * src/image.c (slurp_image): Prefer build_unibyte_string (str) to make_unibyte_string (str, strlen (str)). * admin/coccinelle/unibyte_string.cocci: Support string literals.
* Prefer NILP (x) to EQ (x, Qnil)Stefan Kangas2024-01-041-0/+6
| | | | | | * src/image.c (anim_prune_animation_cache): Prefer NILP (x) to EQ (x, Qnil). * admin/coccinelle/nilp.cocci: Semantic patch for above change.
* Delete redisplay-end-trigger-functions and related defunsStefan Kangas2022-07-311-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This variable and related functions have been obsolete since 23.1. The last things to depend on this (fast-lock.el and lazy-lock.el) were recently removed. * src/dispextern.h (struct it): Delete field 'redisplay_end_trigger_charpos'. * src/window.c (Fwindow_redisplay_end_trigger) (Fset_window_redisplay_end_trigger): Delete defuns and corresponding defsubrs for functions obsolete since 23.1. * src/window.h (wset_redisplay_end_trigger): Delete function. (GCALIGNED_STRUCT): Delete 'redisplay_end_trigger'. * src/xdisp.c (run_redisplay_end_trigger_hook): Delete function. (syms_of_xdisp) <redisplay_end_trigger_functions>: Delete variable obsolete since 23.1. (init_iterator, next_element_from_buffer): Don't run or set above deleted hook variable. * lisp/subr.el: Delete obsoletion definitions for above deleted defuns and variable. * doc/lispref/hooks.texi (Standard Hooks): * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): * lisp/loadhist.el (unload-feature-special-hooks): Don't mention above deleted variable. * admin/coccinelle/window.cocci: Adjust for above changes.
* Minor quoting fixes in scripts and docPaul Eggert2015-09-161-1/+1
| | | | | | Prefer straight quotes in random script files, as they are not converted. Prefer grave quotes in a couple of places in the manual that were missed earlier, as these quotes are converted.
* * src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extractionDmitry Antipov2013-01-151-0/+11
| | | | | | | | | from any Lisp_Save_Value slot. Add type checking. * src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c: * src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c: * src/xfns.c, src/xmenu.c, src/xselect.c: All users changed. * admin/coccinelle/xsave.cocci: Semantic patch to adjust users of XSAVE_POINTER and XSAVE_INTEGER macros.
* Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.Dmitry Antipov2012-08-072-60/+0
| | | | | | | | | | | | | | | | | | | * src/lisp.h (struct Lisp_Symbol): Change xname to meaningful name since all xname users are fixed long time ago. Do not use INTERNAL_FIELD. (set_symbol_name, set_symbol_function, set_symbol_plist): (set_symbol_next, set_overlay_plist): New function. (struct Lisp_Cons): Do not use INTERNAL_FIELD. (struct Lisp_Overlay): Likewise. (CVAR, MVAR, SVAR): Remove. * src/alloc.c, src/buffer.c, src/buffer.h, src/bytecode.c: * src/cmds.c, src/data.c, src/doc.c, src/eval.c, src/fns.c: * src/keyboard.c, src/lread.c, src/nsselect.m, src/xterm.c: Adjust users. * src/.gdbinit: Change to use name field of struct Lisp_Symbol where appropriate. * admin/coccinelle/overlay.cocci, admin/coccinelle/symbol.cocci: Remove.
* Use INTERNAL_FIELD for conses and overlays.Dmitry Antipov2012-08-011-0/+28
| | | | | | | | | | * src/lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD. Remove obsolete comment. (MVAR): New macro. (struct Lisp_Overlay): Use INTERNAL_FIELD. * src/alloc.c, src/buffer.c, src/buffer.h, src/fns.c: Adjust users. * admin/coccinelle/overlay.cocci: Semantic patch to replace direct access to Lisp_Object members of struct Lisp_Overlay to MVAR.
* Commit forgotten admin/coccinelle/symbol.cocci.Dmitry Antipov2012-08-011-0/+32
|
* Use INTERNAL_FIELD for processes.Dmitry Antipov2012-08-011-0/+110
| | | | | | | | | * src/process.h (PVAR): New macro. Adjust style. (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD. * src/print.c, src/process.c, src/sysdep.c, src/w32.c: * src/xdisp.c: Users changed. * admin/coccinelle/process.cocci: Semantic patch to replace direct access to Lisp_Object members of struct Lisp_Process to PVAR.
* Use INTERNAL_FIELD for windows.Dmitry Antipov2012-08-011-0/+242
| | | | | | | | | | | | | | * src/window.h (WVAR): New macro. (struct window): Change Lisp_Object members to INTERNAL_FIELD. * src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h: * src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c: * src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m: * src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c: * src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c: * src/xterm.c: Users changed. * admin/coccinelle/window.cocci: Semantic patch to replace direct access to Lisp_Object members of struct window to WVAR.
* Generalize INTERNAL_FIELD between buffers, keyboards and frames.Dmitry Antipov2012-07-311-0/+133
| | | | | | | | | | | | | | | | | * src/lisp.h (INTERNAL_FIELD): New macro. * src/buffer.h (BUFFER_INTERNAL_FIELD): Removed. (BVAR): Change to use INTERNAL_FIELD. * src/keyboard.h (KBOARD_INTERNAL_FIELD): Likewise. (KVAR): Change to use INTERNAL_FIELD. * src/frame.h (FVAR): New macro. (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields. * src/alloc.c, src/buffer.c, src/data.c, src/dispnew.c, src/dosfns.c * src/eval.c, src/frame.c, src/fringe.c, src/gtkutil.c, src/minibuf.c * src/nsfns.m, src/nsterm.m, src/print.c, src/term.c, src/w32fns.c * src/w32menu.c, src/w32term.c, src/window.c, src/window.h, src/xdisp.c * src/xfaces.c, src/xfns.c, src/xmenu.c, src/xterm.c: Users changed. * admin/coccinelle/frame.cocci: Semantic patch to replace direct access to Lisp_Object members of struct frame to FVAR.
* Simple wrapper for make_unibyte_string, adjust font_open_by_name.Dmitry Antipov2012-07-201-0/+6
| | | | | | | | | | | | * src/lisp.h (build_unibyte_string): New function. * src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c: * src/sysdep.c, src/w32fns.c, src/xfns.c: Use it. * src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg of type Lisp_Object to avoid redundant calls to make_unibyte_string. Adjust users accordingly. * src/font.h (font_open_by_name): Adjust prototype. * admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from make_unibyte_string to build_unibyte_string where appropriate.
* Use XCAR and XCDR instead of Fcar and Fcdr where possible.Dmitry Antipov2012-07-102-2/+21
| | | | | | | | | | | * admin/coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr to XCDR and consistently use CONSP in the list iteration loops. * admin/coccinelle/vector_contents.cocci: Fix indentation. * src/callint.c, src/coding.c, src/doc.c, src/editfns.c, src/eval.c, * src/font.c, src/fontset.c, src/frame.c, src/gnutls.c, src/minibuf.c, * src/msdos.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/window.c, * src/xmenu.c: Changed to use XCAR and XCDR where argument type is known to be a Lisp_Cons.
* Cleanup xmalloc.Dmitry Antipov2012-07-051-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/coccinelle/xzalloc.cocci: Semantic patch to convert calls to xmalloc with following memset to xzalloc. * src/lisp.h (xzalloc): New prototype. Omit needless casts. * src/alloc.c (xzalloc): New function. Omit needless casts. * src/charset.c: Omit needless casts. Convert all calls to malloc with following memset to xzalloc. * src/dispnew.c: Likewise. * src/fringe.c: Likewise. * src/image.c: Likewise. * src/sound.c: Likewise. * src/term.c: Likewise. * src/w32fns.c: Likewise. * src/w32font.c: Likewise. * src/w32term.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xterm.c: Likewise. * src/atimer.c: Omit needless casts. * src/buffer.c: Likewise. * src/callproc.c: Likewise. * src/ccl.c: Likewise. * src/coding.c: Likewise. * src/composite.c: Likewise. * src/doc.c: Likewise. * src/doprnt.c: Likewise. * src/editfns.c: Likewise. * src/emacs.c: Likewise. * src/eval.c: Likewise. * src/filelock.c: Likewise. * src/fns.c: Likewise. * src/gtkutil.c: Likewise. * src/keyboard.c: Likewise. * src/lisp.h: Likewise. * src/lread.c: Likewise. * src/minibuf.c: Likewise. * src/msdos.c: Likewise. * src/print.c: Likewise. * src/process.c: Likewise. * src/region-cache.c: Likewise. * src/search.c: Likewise. * src/sysdep.c: Likewise. * src/termcap.c: Likewise. * src/terminal.c: Likewise. * src/tparam.c: Likewise. * src/w16select.c: Likewise. * src/w32.c: Likewise. * src/w32reg.c: Likewise. * src/w32select.c: Likewise. * src/w32uniscribe.c: Likewise. * src/widget.c: Likewise. * src/xdisp.c: Likewise. * src/xmenu.c: Likewise. * src/xrdb.c: Likewise. * src/xselect.c: Likewise.
* * src/alloc.c: Remove build_string.Dmitry Antipov2012-06-261-0/+6
| | | | | | | | | | | * src/lisp.h: Define build_string as static inline. This provides a better opportunity to optimize away calls to strlen when the function is called with compile-time constant argument. * src/image.c (imagemagick_error): Convert to build_string. * src/w32proc.c (sys_spawnve): Likewise. * src/xterm.c (x_term_init): Likewise. * admin/coccinelle/build_string.cocci: Semantic patch to convert from make_string to build_string.
* First Coccinelle semantic patch.Dmitry Antipov2012-06-242-0/+19
* coccinelle: New subdirectory * coccinelle/README: Documentation stub. * coccinelle/vector_contents.cocci: Semantic patch to replace direct access to `contents' member of Lisp_Vector objects with AREF and ASET where appropriate.