diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2026-05-26 17:51:44 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2026-05-26 21:57:20 -0700 |
| commit | 225876e97999664a075eb6f1489b4b4c8e515ded (patch) | |
| tree | 87ef4401231a27883205d68c05b8abf76986436d /lwlib | |
| parent | 834ff524f98024cbf30771df3849a5d9241ab2e2 (diff) | |
ARRAYELTS → countof
C2y will standardize countof as the macro that Emacs uses the name
ARRAYELTS for. Switch to the standard name, which is supported
by GCC 16+, by Clang 21, and by the Gnulib stdcountof-h module already
in use for compilers that do not support countof.
Also, use countof in a few places where we missed using ARRAYELTS.
* admin/coccinelle/arrayelts.cocci: Suggest countof, not ARRAYELTS.
* admin/merge-gnulib (GNULIB_MODULES): Add stdcountof-h,
as it is now a direct rather than an indirect dependency.
* exec/trace.c, src/lisp.h, src/sfnt.c: Include <stdcountof.h>.
(ARRAYELTS): Remove. All uses replaced by countof.
* lib-src/ebrowse.c, lib-src/etags.c, lib-src/make-docfile.c:
* lib-src/seccomp-filter.c, lwlib/lwlib-Xaw.c:
Prefer <stdcountof.h> and countof to doing things by hand.
Diffstat (limited to 'lwlib')
| -rw-r--r-- | lwlib/lwlib-Xaw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 0699410cc82..72e7b23c654 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> +#include <stdcountof.h> #include <stdio.h> #include <setjmp.h> @@ -527,11 +528,9 @@ make_dialog (char* name, if (! actions_initted) { XtAppContext app = XtWidgetToApplicationContext (parent); - XtAppAddActions (app, xaw_actions, - sizeof (xaw_actions) / sizeof (xaw_actions[0])); + XtAppAddActions (app, xaw_actions, countof (xaw_actions)); #if defined USE_CAIRO || defined HAVE_XFT - XtAppAddActions (app, button_actions, - sizeof (button_actions) / sizeof (button_actions[0])); + XtAppAddActions (app, button_actions, countof (button_actions)); #endif actions_initted = True; } |
