------------------------------------------------------------ revno: 116947 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2014-04-07 02:51:52 +0200 message: lisp/ChangeLog, src/ChangeLog: Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-06 18:15:09 +0000 +++ lisp/ChangeLog 2014-04-07 00:51:52 +0000 @@ -9,15 +9,14 @@ 2014-04-04 João Távora - * elec-pair.el: - (electric-pair--syntax-ppss): When inside comments parse from - comment beginning. + * elec-pair.el (electric-pair--syntax-ppss): When inside comments + parse from comment beginning. (electric-pair--balance-info): Fix typo in comment. (electric-pair--in-unterminated-string-p): Delete. (electric-pair--unbalanced-strings-p): New function. (electric-pair-string-bound-function): New var. (electric-pair-inhibit-if-helps-balance): Decide quote pairing - according to `electric-pair--in-unterminated-string-p' + according to `electric-pair--in-unterminated-string-p'. 2014-04-04 Stefan Monnier @@ -303,7 +302,7 @@ Reported by Victor Lau. Fix parsing 'var' in AUTOs, msg1294. Reported by Dominique Chen. (verilog-auto-inout-module): Fix AUTOINOUTMODULE not inserting - interface-only modules, bug721. Reported by Dean Hoyt. + interface-only modules, bug721. Reported by Dean Hoyt. 2014-03-26 Glenn Morris @@ -349,9 +348,9 @@ (subword-mode-map): Hollow out. (capitalized-words-mode): Define as obsolete alias for `subword-mode'. - (subword-mode,superword-mode): Tweak documentation to reflect new + (subword-mode, superword-mode): Tweak documentation to reflect new implementation; call `subword-setup-buffer'. - (subword-forward,subword-capitalize): Add underscore to indicate + (subword-forward, subword-capitalize): Add underscore to indicate unused variable. (subword-find-word-boundary-function-table): New constant. (subword-empty-char-table): New constant. @@ -5300,7 +5299,7 @@ * rect.el (rectangle-mark-mode): Rename from rectangle-mark. Make it into a proper minor mode. - (rectangle--region): (implicitly) rename to rectangle-mark-mode. + (rectangle--region): (Implicitly) rename to rectangle-mark-mode. (rectangle-mark-mode-map): New keymap. (rectangle--highlight-for-redisplay): Fix some corner cases (bug#15796). @@ -5543,8 +5542,7 @@ 2013-10-28 Daiki Ueno - * epa-file.el - (epa-file-cache-passphrase-for-symmetric-encryption): + * epa-file.el (epa-file-cache-passphrase-for-symmetric-encryption): Document that this option has no effect with GnuPG 2.0 (bug#15552). 2013-10-27 Xue Fuqiao @@ -12356,9 +12354,8 @@ * textmodes/reftex-vars.el (reftex-ref-style-alist): Add cleveref macros. - * textmodes/reftex-parse.el - (reftex-locate-bibliography-files): Accept options for - bibliography commands. + * textmodes/reftex-parse.el (reftex-locate-bibliography-files): + Accept options for bibliography commands. * textmodes/reftex-vars.el (reftex-bibliography-commands): Add addbibresource. Basic Biblatex support. @@ -13828,8 +13825,7 @@ 2013-04-19 Fabián Ezequiel Gallina New faster Imenu implementation (bug#14058). - * progmodes/python.el: - (python-imenu-prev-index-position): + * progmodes/python.el (python-imenu-prev-index-position) (python-imenu-format-item-label-function) (python-imenu-format-parent-item-label-function) (python-imenu-format-parent-item-jump-label-function): === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-05 19:30:36 +0000 +++ src/ChangeLog 2014-04-07 00:51:52 +0000 @@ -43,7 +43,7 @@ * dired.c (file_attributes): * chartab.c (uniprop_decoder_count, uniprop_encode_count): Change expressions of the form sizeof(arr) / sizeof(arr[0]) - to ARRAYELTS(arr). + to ARRAYELTS (arr). 2014-04-02 Daniel Colascione @@ -55,10 +55,10 @@ * alloc.c: Include execinfo.h if available. (SUSPICIOUS_OBJECT_CHECKING): New macro; define unconditionally. (suspicious_free_record): New structure. - (suspicious_objects,suspicious_object_index) - (suspicious_free_history, suspicious_free_history_index): New - variables. - (find_suspicious_object_in_range,detect_suspicious_free) + (suspicious_objects, suspicious_object_index) + (suspicious_free_history, suspicious_free_history_index): + New variables. + (find_suspicious_object_in_range, detect_suspicious_free) (Fsuspicious_object): New functions. (cleanup_vector): Call find_suspicious_object_in_range. @@ -281,10 +281,10 @@ Split gc_sweep into discrete functions for legibility and better stack traces. - * alloc.c (sweep_strings,sweep_vectors): Add NO_INLINE + * alloc.c (sweep_strings, sweep_vectors): Add NO_INLINE (sweep_vectors): Fix typo in comment. - (sweep_conses,sweep_floats,sweep_intervals) - (sweep_symbols,sweep_misc,sweep_buffers): New functions. + (sweep_conses, sweep_floats, sweep_intervals) + (sweep_symbols, sweep_misc, sweep_buffers): New functions. (gc_sweep): Call new functions, to which existing functionality is moved. * fns.c (sweep_weak_hash_tables): Add NO_INLINE. @@ -346,7 +346,7 @@ * alloc.c (lisp_align_malloc, allocate_string_data) (allocate_vectorlike): Allow mmap allocation of lisp objects. - (pointers_fit_in_lispobj_p,mmap_lisp_allowed_p): New functions. + (pointers_fit_in_lispobj_p, mmap_lisp_allowed_p): New functions. 2014-03-21 Eli Zaretskii ------------------------------------------------------------ revno: 116946 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2014-04-06 14:25:34 -0400 message: * lisp/gnus/gnus-srvr.el (gnus-tmp-how, gnus-tmp-name, gnus-tmp-where) (gnus-tmp-status, gnus-tmp-agent, gnus-tmp-cloud) (gnus-tmp-news-server, gnus-tmp-news-method, gnus-tmp-user-defined): Silence compiler warnings. (gnus-server-insert-server-line): Don't use dyn-bind var as argument. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-03-24 01:56:03 +0000 +++ lisp/gnus/ChangeLog 2014-04-06 18:25:34 +0000 @@ -1,3 +1,11 @@ +2014-04-06 Stefan Monnier + + * gnus-srvr.el (gnus-tmp-how, gnus-tmp-name, gnus-tmp-where) + (gnus-tmp-status, gnus-tmp-agent, gnus-tmp-cloud) + (gnus-tmp-news-server, gnus-tmp-news-method, gnus-tmp-user-defined): + Silence compiler warnings. + (gnus-server-insert-server-line): Don't use dyn-bind var as argument. + 2014-03-24 Katsumi Yamaoka * mml.el: Require url when compiling. === modified file 'lisp/gnus/gnus-srvr.el' --- lisp/gnus/gnus-srvr.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/gnus-srvr.el 2014-04-06 18:25:34 +0000 @@ -78,6 +78,16 @@ ;;; Internal variables. +(defvar gnus-tmp-how) +(defvar gnus-tmp-name) +(defvar gnus-tmp-where) +(defvar gnus-tmp-status) +(defvar gnus-tmp-agent) +(defvar gnus-tmp-cloud) +(defvar gnus-tmp-news-server) +(defvar gnus-tmp-news-method) +(defvar gnus-tmp-user-defined) + (defvar gnus-inserted-opened-servers nil) (defvar gnus-server-line-format-alist @@ -276,8 +286,9 @@ '(gnus-server-font-lock-keywords t))) (gnus-run-mode-hooks 'gnus-server-mode-hook)) -(defun gnus-server-insert-server-line (gnus-tmp-name method) - (let* ((gnus-tmp-how (car method)) +(defun gnus-server-insert-server-line (name method) + (let* ((gnus-tmp-name name) + (gnus-tmp-how (car method)) (gnus-tmp-where (nth 1 method)) (elem (assoc method gnus-opened-servers)) (gnus-tmp-status ------------------------------------------------------------ revno: 116945 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2014-04-06 14:15:09 -0400 message: * lisp/dired-aux.el (dired-file-set-difference): Use lexical-scoping. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-05 02:33:36 +0000 +++ lisp/ChangeLog 2014-04-06 18:15:09 +0000 @@ -1,7 +1,11 @@ +2014-04-06 Stefan Monnier + + * dired-aux.el (dired-file-set-difference): Use lexical-scoping. + 2014-04-05 Leo Liu - * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add - define-compilation-mode. + * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): + Add define-compilation-mode. 2014-04-04 João Távora === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2014-04-02 15:14:50 +0000 +++ lisp/dired-aux.el 2014-04-06 18:15:09 +0000 @@ -215,19 +215,24 @@ (dolist (file1 list1) (unless (let ((list list2)) (while (and list - (not (let* ((file2 (car list)) - (fa1 (car (cddr file1))) - (fa2 (car (cddr file2))) - (size1 (nth 7 fa1)) - (size2 (nth 7 fa2)) - (mtime1 (float-time (nth 5 fa1))) - (mtime2 (float-time (nth 5 fa2)))) - (and - (equal (car file1) (car file2)) - (not (eval predicate)))))) + (let* ((file2 (car list)) + (fa1 (car (cddr file1))) + (fa2 (car (cddr file2)))) + (or + (not (equal (car file1) (car file2))) + (eval predicate + `((fa1 . ,fa1) + (fa2 . ,fa2) + (size1 . ,(nth 7 fa1)) + (size2 . ,(nth 7 fa2)) + (mtime1 + . ,(float-time (nth 5 fa1))) + (mtime2 + . ,(float-time (nth 5 fa2))) + ))))) (setq list (cdr list))) list) - (setq res (cons file1 res)))) + (push file1 res))) (nreverse res)))) (defun dired-files-attributes (dir) ------------------------------------------------------------ revno: 116944 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-04-05 12:30:36 -0700 message: Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'. * alloc.c (memory_full): * charset.c (syms_of_charset): * doc.c (Fsnarf_documentation): * emacs.c (main): * font.c (BUILD_STYLE_TABLE): * keyboard.c (make_lispy_event): * profiler.c (setup_cpu_timer): * xgselect.c (xg_select): * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG): Use ARRAYELTS. * font.c (FONT_PROPERTY_TABLE_SIZE): Remove. Replace the only use with ARRAYELTS (font_property_table). * xfaces.c (DIM): Remove. All uses replaced by ARRAYELTS. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-05 18:40:52 +0000 +++ src/ChangeLog 2014-04-05 19:30:36 +0000 @@ -1,3 +1,20 @@ +2014-04-05 Paul Eggert + + Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'. + * alloc.c (memory_full): + * charset.c (syms_of_charset): + * doc.c (Fsnarf_documentation): + * emacs.c (main): + * font.c (BUILD_STYLE_TABLE): + * keyboard.c (make_lispy_event): + * profiler.c (setup_cpu_timer): + * xgselect.c (xg_select): + * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG): + Use ARRAYELTS. + * font.c (FONT_PROPERTY_TABLE_SIZE): Remove. + Replace the only use with ARRAYELTS (font_property_table). + * xfaces.c (DIM): Remove. All uses replaced by ARRAYELTS. + 2014-04-03 Daniel Colascione * xterm.c (x_term_init): === modified file 'src/alloc.c' --- src/alloc.c 2014-04-03 20:46:04 +0000 +++ src/alloc.c 2014-04-05 19:30:36 +0000 @@ -208,19 +208,19 @@ #ifdef SUSPICIOUS_OBJECT_CHECKING struct suspicious_free_record { - void* suspicious_object; + void *suspicious_object; #ifdef HAVE_EXECINFO_H - void* backtrace[128]; + void *backtrace[128]; #endif }; -static void* suspicious_objects[32]; +static void *suspicious_objects[32]; static int suspicious_object_index; struct suspicious_free_record suspicious_free_history[64]; static int suspicious_free_history_index; /* Find the first currently-monitored suspicious pointer in range [begin,end) or NULL if no such pointer exists. */ -static void* find_suspicious_object_in_range (void* begin, void* end); -static void detect_suspicious_free (void* ptr); +static void *find_suspicious_object_in_range (void *begin, void *end); +static void detect_suspicious_free (void *ptr); #else #define find_suspicious_object_in_range(begin, end) NULL #define detect_suspicious_free(ptr) (void) @@ -3116,7 +3116,7 @@ mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); #endif - if (find_suspicious_object_in_range (p, (char*)p + nbytes)) + if (find_suspicious_object_in_range (p, (char *) p + nbytes)) emacs_abort (); consing_since_gc += nbytes; @@ -3765,7 +3765,7 @@ memory_full_cons_threshold = sizeof (struct cons_block); /* The first time we get here, free the spare memory. */ - for (i = 0; i < sizeof (spare_memory) / sizeof (char *); i++) + for (i = 0; i < ARRAYELTS (spare_memory); i++) if (spare_memory[i]) { if (i == 0) @@ -3818,7 +3818,6 @@ Vmemory_full = Qnil; #endif } - /************************************************************************ C Stack Marking @@ -6829,23 +6828,24 @@ #ifdef SUSPICIOUS_OBJECT_CHECKING static void* -find_suspicious_object_in_range (void* begin, void* end) +find_suspicious_object_in_range (void *begin, void *end) { - char* begin_a = begin; - char* end_a = end; + char *begin_a = begin; + char *end_a = end; int 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; - } + 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; + } return NULL; } static void -detect_suspicious_free (void* ptr) +detect_suspicious_free (void *ptr) { int i; struct suspicious_free_record* rec; @@ -6882,11 +6882,12 @@ { #ifdef SUSPICIOUS_OBJECT_CHECKING /* Right now, we care only about vectors. */ - if (VECTORLIKEP (obj)) { - suspicious_objects[suspicious_object_index++] = XVECTOR (obj); - if (suspicious_object_index == ARRAYELTS (suspicious_objects)) - suspicious_object_index = 0; - } + if (VECTORLIKEP (obj)) + { + suspicious_objects[suspicious_object_index++] = XVECTOR (obj); + if (suspicious_object_index == ARRAYELTS (suspicious_objects)) + suspicious_object_index = 0; + } #endif return obj; } === modified file 'src/charset.c' --- src/charset.c 2014-03-20 01:21:52 +0000 +++ src/charset.c 2014-04-05 19:30:36 +0000 @@ -2386,7 +2386,7 @@ } charset_table = charset_table_init; - charset_table_size = sizeof charset_table_init / sizeof *charset_table_init; + charset_table_size = ARRAYELTS (charset_table_init); charset_table_used = 0; defsubr (&Scharsetp); === modified file 'src/coding.c' --- src/coding.c 2014-01-29 13:21:25 +0000 +++ src/coding.c 2014-04-05 19:30:36 +0000 @@ -8443,11 +8443,11 @@ } Lisp_Object -from_unicode_buffer (const wchar_t* wstr) +from_unicode_buffer (const wchar_t *wstr) { return from_unicode ( make_unibyte_string ( - (char*) wstr, + (char *) wstr, /* we get one of the two final 0 bytes for free. */ 1 + sizeof (wchar_t) * wcslen (wstr))); } === modified file 'src/coding.h' --- src/coding.h 2014-01-29 13:21:25 +0000 +++ src/coding.h 2014-04-05 19:30:36 +0000 @@ -743,7 +743,7 @@ extern Lisp_Object from_unicode (Lisp_Object str); /* Convert WSTR to an Emacs string. */ -extern Lisp_Object from_unicode_buffer (const wchar_t* wstr); +extern Lisp_Object from_unicode_buffer (const wchar_t *wstr); #endif /* WINDOWSNT || CYGWIN */ === modified file 'src/doc.c' --- src/doc.c 2014-03-21 19:04:57 +0000 +++ src/doc.c 2014-04-05 19:30:36 +0000 @@ -595,7 +595,7 @@ { #include "buildobj.h" }; - int i = sizeof buildobj / sizeof *buildobj; + int i = ARRAYELTS (buildobj); while (0 <= --i) Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files); Vbuild_files = Fpurecopy (Vbuild_files); === modified file 'src/emacs.c' --- src/emacs.c 2014-04-03 20:46:04 +0000 +++ src/emacs.c 2014-04-05 19:30:36 +0000 @@ -136,7 +136,7 @@ /* From glibc, a routine that returns a copy of the malloc internal state. */ extern void *malloc_get_state (void); /* From glibc, a routine that overwrites the malloc internal state. */ -extern int malloc_set_state (void*); +extern int malloc_set_state (void *); /* True if the MALLOC_CHECK_ environment variable was set while dumping. Used to work around a bug in glibc's malloc. */ static bool malloc_using_checking; @@ -1008,7 +1008,7 @@ { int i; printf ("Usage: %s [OPTION-OR-FILENAME]...\n", argv[0]); - for (i = 0; i < sizeof usage_message / sizeof *usage_message; i++) + for (i = 0; i < ARRAYELTS (usage_message); i++) fputs (usage_message[i], stdout); exit (0); } === modified file 'src/font.c' --- src/font.c 2014-04-02 13:24:19 +0000 +++ src/font.c 2014-04-05 19:30:36 +0000 @@ -662,10 +662,6 @@ { &QCotf, font_prop_validate_otf } }; -/* Size (number of elements) of the above table. */ -#define FONT_PROPERTY_TABLE_SIZE \ - ((sizeof font_property_table) / (sizeof *font_property_table)) - /* Return an index number of font property KEY or -1 if KEY is not an already known property. */ @@ -674,7 +670,7 @@ { int i; - for (i = 0; i < FONT_PROPERTY_TABLE_SIZE; i++) + for (i = 0; i < ARRAYELTS (font_property_table); i++) if (EQ (key, *font_property_table[i].key)) return i; return -1; @@ -4935,8 +4931,7 @@ #endif -#define BUILD_STYLE_TABLE(TBL) \ - build_style_table ((TBL), sizeof TBL / sizeof (struct table_entry)) +#define BUILD_STYLE_TABLE(TBL) build_style_table (TBL, ARRAYELTS (TBL)) static Lisp_Object build_style_table (const struct table_entry *entry, int nelement) === modified file 'src/gnutls.c' --- src/gnutls.c 2014-03-17 21:29:56 +0000 +++ src/gnutls.c 2014-04-05 19:30:36 +0000 @@ -56,7 +56,7 @@ static Lisp_Object QCgnutls_bootprop_callbacks_verify; static void gnutls_log_function (int, const char *); -static void gnutls_log_function2 (int, const char*, const char*); +static void gnutls_log_function2 (int, const char *, const char *); #ifdef HAVE_GNUTLS3 static void gnutls_audit_log_function (gnutls_session_t, const char *); #endif @@ -267,7 +267,7 @@ #ifdef HAVE_GNUTLS3 /* Function to log a simple audit message. */ static void -gnutls_audit_log_function (gnutls_session_t session, const char* string) +gnutls_audit_log_function (gnutls_session_t session, const char *string) { if (global_gnutls_log_level >= 1) { @@ -278,21 +278,21 @@ /* Function to log a simple message. */ static void -gnutls_log_function (int level, const char* string) +gnutls_log_function (int level, const char *string) { message ("gnutls.c: [%d] %s", level, string); } /* Function to log a message and a string. */ static void -gnutls_log_function2 (int level, const char* string, const char* extra) +gnutls_log_function2 (int level, const char *string, const char *extra) { message ("gnutls.c: [%d] %s %s", level, string, extra); } /* Function to log a message and an integer. */ static void -gnutls_log_function2i (int level, const char* string, int extra) +gnutls_log_function2i (int level, const char *string, int extra) { message ("gnutls.c: [%d] %s %d", level, string, extra); } @@ -794,7 +794,7 @@ Lisp_Object global_init; char const *priority_string_ptr = "NORMAL"; /* default priority string. */ unsigned int peer_verification; - char* c_hostname; + char *c_hostname; /* Placeholders for the property list elements. */ Lisp_Object priority_string; === modified file 'src/keyboard.c' --- src/keyboard.c 2014-04-03 20:46:04 +0000 +++ src/keyboard.c 2014-04-05 19:30:36 +0000 @@ -5478,7 +5478,7 @@ case NON_ASCII_KEYSTROKE_EVENT: button_down_time = 0; - for (i = 0; i < sizeof (lispy_accent_codes) / sizeof (int); i++) + for (i = 0; i < ARRAYELTS (lispy_accent_codes); i++) if (event->code == lispy_accent_codes[i]) return modify_event_symbol (i, event->modifiers, @@ -5511,7 +5511,7 @@ if (event->code & (1 << 28) || event->code - FUNCTION_KEY_OFFSET < 0 || (event->code - FUNCTION_KEY_OFFSET - >= sizeof lispy_function_keys / sizeof *lispy_function_keys) + >= ARRAYELTS (lispy_function_keys)) || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET]) { /* We need to use an alist rather than a vector as the cache @@ -7282,7 +7282,7 @@ } -static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*); +static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void *); static Lisp_Object menu_bar_one_keymap_changed_items; /* These variables hold the vector under construction within @@ -7292,7 +7292,7 @@ static int menu_bar_items_index; -static const char* separator_names[] = { +static const char *separator_names[] = { "space", "no-line", "single-line", @@ -7900,7 +7900,8 @@ /* Function prototypes. */ static void init_tool_bar_items (Lisp_Object); -static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*); +static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, + void *); static bool parse_tool_bar_item (Lisp_Object, Lisp_Object); static void append_tool_bar_item (void); === modified file 'src/keymap.c' --- src/keymap.c 2014-01-01 07:43:34 +0000 +++ src/keymap.c 2014-04-05 19:30:36 +0000 @@ -1894,7 +1894,7 @@ static void accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *data) -/* Use void* data to be compatible with map_keymap_function_t. */ +/* Use void * data to be compatible with map_keymap_function_t. */ { struct accessible_keymaps_data *d = data; /* Cast! */ Lisp_Object maps = d->maps; === modified file 'src/keymap.h' --- src/keymap.h 2014-01-01 07:43:34 +0000 +++ src/keymap.h 2014-04-05 19:30:36 +0000 @@ -46,7 +46,7 @@ extern void keys_of_keymap (void); typedef void (*map_keymap_function_t) - (Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data); + (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data); extern void map_keymap (Lisp_Object, map_keymap_function_t, Lisp_Object, void *, bool); extern void map_keymap_canonical (Lisp_Object map, === modified file 'src/lisp.h' --- src/lisp.h 2014-04-03 20:46:04 +0000 +++ src/lisp.h 2014-04-05 19:30:36 +0000 @@ -58,8 +58,8 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) -/* Find number of elements in array */ -#define ARRAYELTS(arr) (sizeof (arr) / sizeof ((arr)[0])) +/* Number of elements in an array. */ +#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 === modified file 'src/process.c' --- src/process.c 2014-03-26 15:57:13 +0000 +++ src/process.c 2014-04-05 19:30:36 +0000 @@ -2022,11 +2022,11 @@ terminator, however. */ if (name_length > 0 && sockun->sun_path[0] != '\0') { - const char* terminator = - memchr (sockun->sun_path, '\0', name_length); + const char *terminator + = memchr (sockun->sun_path, '\0', name_length); if (terminator) - name_length = terminator - (const char*) sockun->sun_path; + name_length = terminator - (const char *) sockun->sun_path; } return make_unibyte_string (sockun->sun_path, name_length); === modified file 'src/profiler.c' --- src/profiler.c 2014-01-01 07:43:34 +0000 +++ src/profiler.c 2014-04-05 19:30:36 +0000 @@ -294,7 +294,7 @@ sigev.sigev_signo = SIGPROF; sigev.sigev_notify = SIGEV_SIGNAL; - for (i = 0; i < sizeof system_clock / sizeof *system_clock; i++) + for (i = 0; i < ARRAYELTS (system_clock); i++) if (timer_create (system_clock[i], &sigev, &profiler_timer) == 0) { profiler_timer_ok = 1; === modified file 'src/sysdep.c' --- src/sysdep.c 2014-04-03 20:46:04 +0000 +++ src/sysdep.c 2014-04-05 19:30:36 +0000 @@ -128,7 +128,7 @@ /* Return the current working directory. Returns NULL on errors. Any other returned value must be freed with free. This is used only when get_current_dir_name is not defined on the system. */ -char* +char * get_current_dir_name (void) { char *buf; === modified file 'src/unexcoff.c' --- src/unexcoff.c 2014-01-01 07:43:34 +0000 +++ src/unexcoff.c 2014-04-05 19:30:36 +0000 @@ -120,7 +120,7 @@ into an int which is the number of a byte. This is a no-op on ordinary machines, but not on all. */ -#define ADDR_CORRECT(x) ((char *)(x) - (char*)0) +#define ADDR_CORRECT(x) ((char *) (x) - (char *) 0) #include "lisp.h" === modified file 'src/xdisp.c' --- src/xdisp.c 2014-03-23 15:57:25 +0000 +++ src/xdisp.c 2014-04-05 19:30:36 +0000 @@ -22639,7 +22639,7 @@ return decode_mode_spec_buf; no_value: { - char* p = decode_mode_spec_buf; + char *p = decode_mode_spec_buf; int pad = width - 2; while (pad-- > 0) *p++ = ' '; === modified file 'src/xfaces.c' --- src/xfaces.c 2014-04-03 20:46:04 +0000 +++ src/xfaces.c 2014-04-05 19:30:36 +0000 @@ -273,10 +273,6 @@ #define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface) -/* Value is the number of elements of VECTOR. */ - -#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR)) - /* Size of hash table of realized faces in face caches (should be a prime number). */ @@ -5093,14 +5089,14 @@ { Lisp_Object list; int i; - int indices[DIM (font_sort_order)]; + int indices[ARRAYELTS (font_sort_order)]; CHECK_LIST (order); memset (indices, 0, sizeof indices); i = 0; for (list = order; - CONSP (list) && i < DIM (indices); + CONSP (list) && i < ARRAYELTS (indices); list = XCDR (list), ++i) { Lisp_Object attr = XCAR (list); @@ -5122,9 +5118,9 @@ indices[i] = xlfd; } - if (!NILP (list) || i != DIM (indices)) + if (!NILP (list) || i != ARRAYELTS (indices)) signal_error ("Invalid font sort order", order); - for (i = 0; i < DIM (font_sort_order); ++i) + for (i = 0; i < ARRAYELTS (font_sort_order); ++i) if (indices[i] == 0) signal_error ("Invalid font sort order", order); @@ -6348,7 +6344,7 @@ int i; fprintf (stderr, "font selection order: "); - for (i = 0; i < DIM (font_sort_order); ++i) + for (i = 0; i < ARRAYELTS (font_sort_order); ++i) fprintf (stderr, "%d ", font_sort_order[i]); fprintf (stderr, "\n"); === modified file 'src/xgselect.c' --- src/xgselect.c 2014-03-05 06:31:57 +0000 +++ src/xgselect.c 2014-04-05 19:30:36 +0000 @@ -41,7 +41,7 @@ int have_wfds = wfds != NULL; GPollFD gfds_buf[128]; GPollFD *gfds = gfds_buf; - int gfds_size = sizeof gfds_buf / sizeof *gfds_buf; + int gfds_size = ARRAYELTS (gfds_buf); int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1; int i, nfds, tmo_in_millisec; bool need_to_dispatch; === modified file 'src/xsmfns.c' --- src/xsmfns.c 2014-01-01 07:43:34 +0000 +++ src/xsmfns.c 2014-04-05 19:30:36 +0000 @@ -395,7 +395,7 @@ { #define SM_ERRORSTRING_LEN 512 char errorstring[SM_ERRORSTRING_LEN]; - char* previous_id = NULL; + char *previous_id = NULL; SmcCallbacks callbacks; ptrdiff_t name_len = 0; === modified file 'src/xterm.c' --- src/xterm.c 2014-04-03 20:46:04 +0000 +++ src/xterm.c 2014-04-05 19:30:36 +0000 @@ -308,7 +308,7 @@ void record_event (char *locus, int type) { - if (event_record_index == sizeof (event_record) / sizeof (struct record)) + if (event_record_index == ARRAYELTS (event_record)) event_record_index = 0; event_record[event_record_index].locus = locus; @@ -5624,7 +5624,7 @@ static short temp_buffer[100]; #define STORE_KEYSYM_FOR_DEBUG(keysym) \ - if (temp_index == sizeof temp_buffer / sizeof (short)) \ + if (temp_index == ARRAYELTS (temp_buffer)) \ temp_index = 0; \ temp_buffer[temp_index++] = (keysym) === modified file 'src/xterm.h' --- src/xterm.h 2014-03-03 08:27:58 +0000 +++ src/xterm.h 2014-04-05 19:30:36 +0000 @@ -996,7 +996,7 @@ #ifdef USE_GTK extern int xg_set_icon (struct frame *, Lisp_Object); -extern int xg_set_icon_from_xpm_data (struct frame *, const char**); +extern int xg_set_icon_from_xpm_data (struct frame *, const char **); #endif /* USE_GTK */ extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);