From c72d972c5dee96489a3fd881b239f3f7d0db2385 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Thu, 3 Apr 2014 13:46:04 -0700 Subject: [PATCH] Rename EARRAYSIZE to ARRAYELTS --- src/ChangeLog | 4 ++-- src/alloc.c | 10 +++++----- src/chartab.c | 4 ++-- src/dired.c | 2 +- src/dosfns.c | 4 ++-- src/emacs.c | 4 ++-- src/fileio.c | 2 +- src/frame.c | 8 ++++---- src/fringe.c | 2 +- src/image.c | 2 +- src/keyboard.c | 30 +++++++++++++++--------------- src/lisp.h | 2 +- src/macfont.m | 12 ++++++------ src/msdos.c | 4 ++-- src/nsfns.m | 2 +- src/nsterm.m | 2 +- src/sysdep.c | 2 +- src/term.c | 2 +- src/unexcw.c | 2 +- src/w32.c | 6 +++--- src/w32fns.c | 2 +- src/xfaces.c | 2 +- src/xfns.c | 2 +- src/xterm.c | 2 +- 24 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a628148bbd..b160668dc2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,7 @@ 2014-04-03 Daniel Colascione In all places below, change expressions of the form sizeof(arr) / - sizeof(arr[0]) to EARRAYSIZE(arr). + sizeof(arr[0]) to ARRAYELTS(arr). * xterm.c (x_term_init): See above. @@ -64,7 +64,7 @@ * data.c (Ffset): Abort if we're trying to set a function call to a dead lisp object. - * lisp.h (EARRAYSIZE): New macro. + * lisp.h (ARRAYELTS): New macro. * alloc.c: Include execinfo.h if available. (SUSPICIOUS_OBJECT_CHECKING): New macro; define unconditionally. diff --git a/src/alloc.c b/src/alloc.c index 46b4f5021d..9740afe2ab 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6835,7 +6835,7 @@ find_suspicious_object_in_range (void* begin, void* end) char* end_a = end; int i; - for (i = 0; i < EARRAYSIZE (suspicious_objects); ++i) { + for (i = 0; i < ARRAYELTS (suspicious_objects); ++i) { char* suspicious_object = suspicious_objects[i]; if (begin_a <= suspicious_object && suspicious_object < end_a) return suspicious_object; @@ -6852,12 +6852,12 @@ detect_suspicious_free (void* ptr) eassert (ptr != NULL); - for (i = 0; i < EARRAYSIZE (suspicious_objects); ++i) + for (i = 0; i < ARRAYELTS (suspicious_objects); ++i) if (suspicious_objects[i] == ptr) { rec = &suspicious_free_history[suspicious_free_history_index++]; if (suspicious_free_history_index == - EARRAYSIZE (suspicious_free_history)) + ARRAYELTS (suspicious_free_history)) { suspicious_free_history_index = 0; } @@ -6865,7 +6865,7 @@ detect_suspicious_free (void* ptr) memset (rec, 0, sizeof (*rec)); rec->suspicious_object = ptr; #ifdef HAVE_EXECINFO_H - backtrace (&rec->backtrace[0], EARRAYSIZE (rec->backtrace)); + backtrace (&rec->backtrace[0], ARRAYELTS (rec->backtrace)); #endif suspicious_objects[i] = NULL; } @@ -6884,7 +6884,7 @@ garbage collection bugs. Otherwise, do nothing and return OBJ. */) /* Right now, we care only about vectors. */ if (VECTORLIKEP (obj)) { suspicious_objects[suspicious_object_index++] = XVECTOR (obj); - if (suspicious_object_index == EARRAYSIZE (suspicious_objects)) + if (suspicious_object_index == ARRAYELTS (suspicious_objects)) suspicious_object_index = 0; } #endif diff --git a/src/chartab.c b/src/chartab.c index 56a6f54874..4d4e6381b1 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -1221,7 +1221,7 @@ uniprop_decode_value_run_length (Lisp_Object table, Lisp_Object value) static uniprop_decoder_t uniprop_decoder [] = { uniprop_decode_value_run_length }; -static const int uniprop_decoder_count = EARRAYSIZE (uniprop_decoder); +static const int uniprop_decoder_count = ARRAYELTS (uniprop_decoder); /* Return the decoder of char-table TABLE or nil if none. */ @@ -1299,7 +1299,7 @@ static uniprop_encoder_t uniprop_encoder[] = uniprop_encode_value_run_length, uniprop_encode_value_numeric }; -static const int uniprop_encoder_count = EARRAYSIZE (uniprop_encoder); +static const int uniprop_encoder_count = ARRAYELTS (uniprop_encoder); /* Return the encoder of char-table TABLE or nil if none. */ diff --git a/src/dired.c b/src/dired.c index 5d99314fde..d8da45bf77 100644 --- a/src/dired.c +++ b/src/dired.c @@ -984,7 +984,7 @@ file_attributes (int fd, char const *name, Lisp_Object id_format) values[10] = INTEGER_TO_CONS (s.st_ino); values[11] = INTEGER_TO_CONS (s.st_dev); - return Flist (EARRAYSIZE (values), values); + return Flist (ARRAYELTS (values), values); } DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0, diff --git a/src/dosfns.c b/src/dosfns.c index b98e3cd8f2..baa0358d72 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -402,7 +402,7 @@ msdos_stdcolor_idx (const char *name) { int i; - for (i = 0; i < EARRAYSIZE (vga_colors); i++) + for (i = 0; i < ARRAYELTS (vga_colors); i++) if (xstrcasecmp (name, vga_colors[i]) == 0) return i; @@ -422,7 +422,7 @@ msdos_stdcolor_name (int idx) return build_string (unspecified_fg); else if (idx == FACE_TTY_DEFAULT_BG_COLOR) return build_string (unspecified_bg); - else if (idx >= 0 && idx < EARRAYSIZE (vga_colors)) + else if (idx >= 0 && idx < ARRAYELTS (vga_colors)) return build_string (vga_colors[idx]); else return Qunspecified; /* meaning the default */ diff --git a/src/emacs.c b/src/emacs.c index a481a9c3d7..75498dce50 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1817,7 +1817,7 @@ sort_args (int argc, char **argv) } /* Look for a match with a known old-fashioned option. */ - for (i = 0; i < EARRAYSIZE (standard_args); i++) + for (i = 0; i < ARRAYELTS (standard_args); i++) if (!strcmp (argv[from], standard_args[i].name)) { options[from] = standard_args[i].nargs; @@ -1839,7 +1839,7 @@ sort_args (int argc, char **argv) match = -1; - for (i = 0; i < EARRAYSIZE (standard_args); i++) + for (i = 0; i < ARRAYELTS (standard_args); i++) if (standard_args[i].longname && !strncmp (argv[from], standard_args[i].longname, thislen)) diff --git a/src/fileio.c b/src/fileio.c index d317e169c2..5659b6555d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2909,7 +2909,7 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */) } #endif - return Flist (EARRAYSIZE (values), values); + return Flist (ARRAYELTS (values), values); } DEFUN ("set-file-selinux-context", Fset_file_selinux_context, diff --git a/src/frame.c b/src/frame.c index 3784e99875..08d0efb6ea 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2867,7 +2867,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) param_index = Fget (prop, Qx_frame_parameter); if (NATNUMP (param_index) - && XFASTINT (param_index) < EARRAYSIZE (frame_parms) + && XFASTINT (param_index) < ARRAYELTS (frame_parms) && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)]) (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); } @@ -2915,7 +2915,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) param_index = Fget (prop, Qx_frame_parameter); if (NATNUMP (param_index) - && XFASTINT (param_index) < EARRAYSIZE (frame_parms) + && XFASTINT (param_index) < ARRAYELTS (frame_parms) && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)]) (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); } @@ -3226,7 +3226,7 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu { Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter); if (NATNUMP (parm_index) - && XFASTINT (parm_index) < EARRAYSIZE (frame_parms) + && XFASTINT (parm_index) < ARRAYELTS (frame_parms) && FRAME_RIF (f)->frame_parm_handlers[XFASTINT (parm_index)]) (*FRAME_RIF (f)->frame_parm_handlers[XFASTINT (parm_index)]) (f, bgcolor, Qnil); @@ -4560,7 +4560,7 @@ syms_of_frame (void) { int i; - for (i = 0; i < EARRAYSIZE (frame_parms); i++) + for (i = 0; i < ARRAYELTS (frame_parms); i++) { Lisp_Object v = intern_c_string (frame_parms[i].name); if (frame_parms[i].variable) diff --git a/src/fringe.c b/src/fringe.c index 1dd9534185..1eae6b1849 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -474,7 +474,7 @@ static struct fringe_bitmap standard_bitmaps[] = #define NO_FRINGE_BITMAP 0 #define UNDEF_FRINGE_BITMAP 1 -#define MAX_STANDARD_FRINGE_BITMAPS EARRAYSIZE (standard_bitmaps) +#define MAX_STANDARD_FRINGE_BITMAPS ARRAYELTS (standard_bitmaps) static struct fringe_bitmap **fringe_bitmaps; static Lisp_Object *fringe_faces; diff --git a/src/image.c b/src/image.c index 64bd41b52a..bfbdfbc86b 100644 --- a/src/image.c +++ b/src/image.c @@ -3955,7 +3955,7 @@ xpm_str_to_color_key (const char *s) { int i; - for (i = 0; i < EARRAYSIZE (xpm_color_key_strings); i++) + for (i = 0; i < ARRAYELTS (xpm_color_key_strings); i++) if (strcmp (xpm_color_key_strings[i], s) == 0) return i; return -1; diff --git a/src/keyboard.c b/src/keyboard.c index ccdb469bbb..6de537085f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1446,7 +1446,7 @@ command_loop_1 (void) Vthis_command_keys_shift_translated = Qnil; /* Read next key sequence; i gets its length. */ - i = read_key_sequence (keybuf, EARRAYSIZE (keybuf), + i = read_key_sequence (keybuf, ARRAYELTS (keybuf), Qnil, 0, 1, 1, 0); /* A filter may have run while we were reading the input. */ @@ -1694,7 +1694,7 @@ read_menu_command (void) menus. */ specbind (Qecho_keystrokes, make_number (0)); - i = read_key_sequence (keybuf, EARRAYSIZE (keybuf), + i = read_key_sequence (keybuf, ARRAYELTS (keybuf), Qnil, 0, 1, 1, 1); unbind_to (count, Qnil); @@ -5484,7 +5484,7 @@ make_lispy_event (struct input_event *event) event->modifiers, Qfunction_key, Qnil, lispy_accent_keys, &accent_key_syms, - EARRAYSIZE (lispy_accent_keys)); + ARRAYELTS (lispy_accent_keys)); #if 0 #ifdef XK_kana_A @@ -5493,7 +5493,7 @@ make_lispy_event (struct input_event *event) event->modifiers & ~shift_modifier, Qfunction_key, Qnil, lispy_kana_keys, &func_key_syms, - EARRAYSIZE (lispy_kana_keys)); + ARRAYELTS (lispy_kana_keys)); #endif /* XK_kana_A */ #endif /* 0 */ @@ -5504,7 +5504,7 @@ make_lispy_event (struct input_event *event) event->modifiers, Qfunction_key, Qnil, iso_lispy_function_keys, &func_key_syms, - EARRAYSIZE (iso_lispy_function_keys)); + ARRAYELTS (iso_lispy_function_keys)); #endif /* Handle system-specific or unknown keysyms. */ @@ -5530,17 +5530,17 @@ make_lispy_event (struct input_event *event) event->modifiers, Qfunction_key, Qnil, lispy_function_keys, &func_key_syms, - EARRAYSIZE (lispy_function_keys)); + ARRAYELTS (lispy_function_keys)); #ifdef HAVE_NTGUI case MULTIMEDIA_KEY_EVENT: - if (event->code < EARRAYSIZE (lispy_multimedia_keys) + if (event->code < ARRAYELTS (lispy_multimedia_keys) && event->code > 0 && lispy_multimedia_keys[event->code]) { return modify_event_symbol (event->code, event->modifiers, Qfunction_key, Qnil, lispy_multimedia_keys, &func_key_syms, - EARRAYSIZE (lispy_multimedia_keys)); + ARRAYELTS (lispy_multimedia_keys)); } return Qnil; #endif @@ -6262,7 +6262,7 @@ static const char *const modifier_names[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "alt", "super", "hyper", "shift", "control", "meta" }; -#define NUM_MOD_NAMES EARRAYSIZE (modifier_names) +#define NUM_MOD_NAMES ARRAYELTS (modifier_names) static Lisp_Object modifier_symbols; @@ -9752,7 +9752,7 @@ read_key_sequence_vs (Lisp_Object prompt, Lisp_Object continue_echo, memset (keybuf, 0, sizeof keybuf); GCPRO1 (keybuf[0]); - gcpro1.nvars = EARRAYSIZE (keybuf); + gcpro1.nvars = ARRAYELTS (keybuf); if (NILP (continue_echo)) { @@ -9766,7 +9766,7 @@ read_key_sequence_vs (Lisp_Object prompt, Lisp_Object continue_echo, cancel_hourglass (); #endif - i = read_key_sequence (keybuf, EARRAYSIZE (keybuf), + i = read_key_sequence (keybuf, ARRAYELTS (keybuf), prompt, ! NILP (dont_downcase_last), ! NILP (can_return_switch_frame), 0, 0); @@ -10669,7 +10669,7 @@ The elements of this list correspond to the arguments of } XSETFASTINT (val[3], quit_char); - return Flist (EARRAYSIZE (val), val); + return Flist (ARRAYELTS (val), val); } DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, @@ -11037,7 +11037,7 @@ syms_of_keyboard (void) { int i; - int len = EARRAYSIZE (head_table); + int len = ARRAYELTS (head_table); for (i = 0; i < len; i++) { @@ -11053,13 +11053,13 @@ syms_of_keyboard (void) staticpro (&button_down_location); mouse_syms = Fmake_vector (make_number (5), Qnil); staticpro (&mouse_syms); - wheel_syms = Fmake_vector (make_number (EARRAYSIZE (lispy_wheel_names)), + wheel_syms = Fmake_vector (make_number (ARRAYELTS (lispy_wheel_names)), Qnil); staticpro (&wheel_syms); { int i; - int len = EARRAYSIZE (modifier_names); + int len = ARRAYELTS (modifier_names); modifier_symbols = Fmake_vector (make_number (len), Qnil); for (i = 0; i < len; i++) diff --git a/src/lisp.h b/src/lisp.h index b8c909ab60..a697e39a20 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -59,7 +59,7 @@ INLINE_HEADER_BEGIN #define min(a, b) ((a) < (b) ? (a) : (b)) /* Find number of elements in array */ -#define EARRAYSIZE(arr) (sizeof (arr) / sizeof ((arr)[0])) +#define ARRAYELTS(arr) (sizeof (arr) / sizeof ((arr)[0])) /* EMACS_INT - signed integer wide enough to hold an Emacs value EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if diff --git a/src/macfont.m b/src/macfont.m index 447b08c723..7aa1d40b33 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -237,7 +237,7 @@ mac_font_get_glyph_for_cid (FontRef font, CharacterCollection collection, unichar characters[] = {0xfffd}; NSString *string = [NSString stringWithCharacters:characters - length:EARRAYSIZE (characters)]; + length:ARRAYELTS (characters)]; NSGlyphInfo *glyphInfo = [NSGlyphInfo glyphInfoWithCharacterIdentifier:cid collection:collection @@ -825,7 +825,7 @@ macfont_store_descriptor_attributes (FontDescriptorRef desc, {{0, 100}, {1, 200}, {CGFLOAT_MAX, CGFLOAT_MAX}}}}; int i; - for (i = 0; i < EARRAYSIZE (numeric_traits); i++) + for (i = 0; i < ARRAYELTS (numeric_traits); i++) { num = CFDictionaryGetValue (dict, numeric_traits[i].trait); if (num && CFNumberGetValue (num, kCFNumberCGFloatType, &floatval)) @@ -1907,7 +1907,7 @@ macfont_create_attributes_with_spec (Lisp_Object spec) if (! traits) goto err; - for (i = 0; i < EARRAYSIZE (numeric_traits); i++) + for (i = 0; i < ARRAYELTS (numeric_traits); i++) { tmp = AREF (spec, numeric_traits[i].index); if (INTEGERP (tmp)) @@ -3583,7 +3583,7 @@ mac_ctfont_create_line_with_string_and_font (CFStringRef string, { attributes = CFDictionaryCreate (NULL, (const void **) keys, (const void **) values, - EARRAYSIZE (keys), + ARRAYELTS (keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease (values[1]); @@ -3794,7 +3794,7 @@ mac_ctfont_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection, CTLineRef ctline = NULL; string = CFStringCreateWithCharacters (NULL, characters, - EARRAYSIZE (characters)); + ARRAYELTS (characters)); if (string) { @@ -3810,7 +3810,7 @@ mac_ctfont_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection, attributes = CFDictionaryCreate (NULL, (const void **) keys, (const void **) values, - EARRAYSIZE (keys), + ARRAYELTS (keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease (glyph_info); diff --git a/src/msdos.c b/src/msdos.c index 2b636977f6..6b677bb2f0 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -564,7 +564,7 @@ dos_set_window_size (int *rows, int *cols) }; int i = 0; - while (i < EARRAYSIZE (std_dimension)) + while (i < ARRAYELTS (std_dimension)) { if (std_dimension[i].need_vga <= have_vga && std_dimension[i].rows >= *rows) @@ -3465,7 +3465,7 @@ init_environment (int argc, char **argv, int skip_args) static const char * const tempdirs[] = { "$TMPDIR", "$TEMP", "$TMP", "c:/" }; - const int imax = EARRAYSIZE (tempdirs); + const int imax = ARRAYELTS (tempdirs); /* Make sure they have a usable $TMPDIR. Many Emacs functions use temporary files and assume "/tmp" if $TMPDIR is unset, which diff --git a/src/nsfns.m b/src/nsfns.m index d1692915bc..4c3f7f34c0 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1024,7 +1024,7 @@ get_geometry_from_preferences (struct ns_display_info *dpyinfo, }; int i; - for (i = 0; i < EARRAYSIZE (r); ++i) + for (i = 0; i < ARRAYELTS (r); ++i) { if (NILP (Fassq (r[i].tem, parms))) { diff --git a/src/nsterm.m b/src/nsterm.m index fb4d402814..842ff194c4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2012,7 +2012,7 @@ ns_convert_key (unsigned code) Internal call used by NSView-keyDown. -------------------------------------------------------------------------- */ { - const unsigned last_keysym = EARRAYSIZE (convert_ns_to_X_keysym); + const unsigned last_keysym = ARRAYELTS (convert_ns_to_X_keysym); unsigned keysym; /* An array would be faster, but less easy to read. */ for (keysym = 0; keysym < last_keysym; keysym += 2) diff --git a/src/sysdep.c b/src/sysdep.c index f1608c4ab2..964dc419d2 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -255,7 +255,7 @@ init_baud_rate (int fd) #endif /* not DOS_NT */ } - baud_rate = (emacs_ospeed < EARRAYSIZE (baud_convert) + baud_rate = (emacs_ospeed < ARRAYELTS (baud_convert) ? baud_convert[emacs_ospeed] : 9600); if (baud_rate == 0) baud_rate = 1200; diff --git a/src/term.c b/src/term.c index 600c16ba82..6512f12fca 100644 --- a/src/term.c +++ b/src/term.c @@ -1339,7 +1339,7 @@ term_get_fkeys_1 (void) if (!KEYMAPP (KVAR (kboard, Vinput_decode_map))) kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil)); - for (i = 0; i < EARRAYSIZE (keys); i++) + for (i = 0; i < ARRAYELTS (keys); i++) { char *sequence = tgetstr (keys[i].cap, address); if (sequence) diff --git a/src/unexcw.c b/src/unexcw.c index 1809961a80..7636b05a12 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -81,7 +81,7 @@ read_exe_header (int fd, exe_header_t * exe_header_buffer) #endif assert (exe_header_buffer->file_header.f_nscns > 0); assert (exe_header_buffer->file_header.f_nscns <= - EARRAYSIZE (exe_header_buffer->section_header)); + ARRAYELTS (exe_header_buffer->section_header)); assert (exe_header_buffer->file_header.f_opthdr > 0); ret = diff --git a/src/w32.c b/src/w32.c index e0fd60b1d2..ca7d1869b6 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1707,7 +1707,7 @@ static unsigned num_of_processors; /* We maintain 1-sec samples for the last 16 minutes in a circular buffer. */ static struct load_sample samples[16*60]; static int first_idx = -1, last_idx = -1; -static int max_idx = EARRAYSIZE (samples); +static int max_idx = ARRAYELTS (samples); static int buf_next (int from) @@ -2511,7 +2511,7 @@ init_environment (char ** argv) int i; - const int imax = EARRAYSIZE (tempdirs); + const int imax = ARRAYELTS (tempdirs); /* Implementation note: This function explicitly works with ANSI file names, not with UTF-8 encoded file names. This is because @@ -2584,7 +2584,7 @@ init_environment (char ** argv) {"LANG", NULL}, }; -#define N_ENV_VARS EARRAYSIZE (dflt_envvars) +#define N_ENV_VARS ARRAYELTS (dflt_envvars) /* We need to copy dflt_envvars[] and work on the copy because we don't want the dumped Emacs to inherit the values of diff --git a/src/w32fns.c b/src/w32fns.c index 3c36602277..77476757c2 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -723,7 +723,7 @@ w32_default_color_map (void) cmap = Qnil; - for (i = 0; i < EARRAYSIZE (w32_color_map); pc++, i++) + for (i = 0; i < ARRAYELTS (w32_color_map); pc++, i++) cmap = Fcons (Fcons (build_string (pc->name), make_number (pc->colorref)), cmap); diff --git a/src/xfaces.c b/src/xfaces.c index bae315b281..7a630704fc 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -515,7 +515,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0, fputc ('\n', stderr); - for (i = n = 0; i < EARRAYSIZE (color_count); ++i) + for (i = n = 0; i < ARRAYELTS (color_count); ++i) if (color_count[i]) { fprintf (stderr, "%3d: %5d", i, color_count[i]); diff --git a/src/xfns.c b/src/xfns.c index ef827b5525..13b4c6e787 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1944,7 +1944,7 @@ static XIMStyle best_xim_style (XIMStyles *xim) { int i, j; - int nr_supported = EARRAYSIZE (supported_xim_styles); + int nr_supported = ARRAYELTS (supported_xim_styles); for (i = 0; i < nr_supported; ++i) for (j = 0; j < xim->count_styles; ++j) diff --git a/src/xterm.c b/src/xterm.c index ee8fce047d..a04f2fef05 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10103,7 +10103,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) }; int i; - const int atom_count = EARRAYSIZE (atom_refs); + const int atom_count = ARRAYELTS (atom_refs); /* 1 for _XSETTINGS_SN */ const int total_atom_count = 1 + atom_count; Atom *atoms_return = xmalloc (total_atom_count * sizeof *atoms_return); -- 2.20.1