Now on revision 109770. ------------------------------------------------------------ revno: 109770 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-08-25 09:53:06 +0300 message: Add lib/execinfo.h to .bzrignore. diff: === modified file '.bzrignore' --- .bzrignore 2012-08-02 01:59:19 +0000 +++ .bzrignore 2012-08-25 06:53:06 +0000 @@ -84,6 +84,7 @@ lib/alloca.h lib/arg-nonnull.h lib/c++defs.h +lib/execinfo.h lib/getopt.h lib/inttypes.h lib/stdalign.h ------------------------------------------------------------ revno: 109769 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-24 23:38:43 -0700 message: * emacs.c (fatal_error_signal_hook): Remove. All uses removed. This leftover from old code was always 0. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-25 06:25:00 +0000 +++ src/ChangeLog 2012-08-25 06:38:43 +0000 @@ -1,5 +1,8 @@ 2012-08-25 Paul Eggert + * emacs.c (fatal_error_signal_hook): Remove. + All uses removed. This leftover from old code was always 0. + * casefiddle.c, casetab.c, category.c: Use bool for boolean. * casefiddle.c (casify_object, casify_region): * casetab.c (set_case_table): === modified file 'src/emacs.c' --- src/emacs.c 2012-08-19 21:00:09 +0000 +++ src/emacs.c 2012-08-25 06:38:43 +0000 @@ -279,11 +279,6 @@ /* Nonzero if handling a fatal error already. */ int fatal_error_in_progress; -/* If non-null, call this function from fatal_error_signal before - committing suicide. */ - -static void (*fatal_error_signal_hook) (void); - #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD /* When compiled with GTK and running under Gnome, multiple threads may be created. Keep track of our main @@ -331,9 +326,6 @@ sigunblock (sigmask (fatal_error_code)); #endif - if (fatal_error_signal_hook) - fatal_error_signal_hook (); - kill (getpid (), fatal_error_code); } ------------------------------------------------------------ revno: 109768 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-24 23:25:00 -0700 message: * casefiddle.c, casetab.c, category.c: Use bool for boolean. * casefiddle.c (casify_object, casify_region): * casetab.c (set_case_table): * category.c, category.h (word_boundary_p): * category.h (CHAR_HAS_CATEGORY): Use bool for booleans, instead of int. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-25 05:55:32 +0000 +++ src/ChangeLog 2012-08-25 06:25:00 +0000 @@ -1,3 +1,12 @@ +2012-08-25 Paul Eggert + + * casefiddle.c, casetab.c, category.c: Use bool for boolean. + * casefiddle.c (casify_object, casify_region): + * casetab.c (set_case_table): + * category.c, category.h (word_boundary_p): + * category.h (CHAR_HAS_CATEGORY): + Use bool for booleans, instead of int. + 2012-08-25 Eli Zaretskii * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. === modified file 'src/casefiddle.c' --- src/casefiddle.c 2012-08-03 23:36:11 +0000 +++ src/casefiddle.c 2012-08-25 06:25:00 +0000 @@ -35,8 +35,8 @@ static Lisp_Object casify_object (enum case_action flag, Lisp_Object obj) { - register int c, c1; - register int inword = flag == CASE_DOWN; + int c, c1; + bool inword = flag == CASE_DOWN; /* If the case table is flagged as modified, rescan it. */ if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) @@ -47,7 +47,8 @@ int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META); int flags = XINT (obj) & flagbits; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, + enable_multibyte_characters)); /* If the character has higher bits set above the flags, return it unchanged. @@ -189,9 +190,9 @@ static void casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) { - register int c; - register int inword = flag == CASE_DOWN; - register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); + int c; + bool inword = flag == CASE_DOWN; + bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); ptrdiff_t start, end; ptrdiff_t start_byte; === modified file 'src/casetab.c' --- src/casetab.c 2012-08-18 06:06:39 +0000 +++ src/casetab.c 2012-08-25 06:25:00 +0000 @@ -79,7 +79,7 @@ return Vascii_downcase_table; } -static Lisp_Object set_case_table (Lisp_Object table, int standard); +static Lisp_Object set_case_table (Lisp_Object, bool); DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, doc: /* Select a new case table for the current buffer. @@ -113,7 +113,7 @@ } static Lisp_Object -set_case_table (Lisp_Object table, int standard) +set_case_table (Lisp_Object table, bool standard) { Lisp_Object up, canon, eqv; === modified file 'src/category.c' --- src/category.c 2012-08-20 08:20:25 +0000 +++ src/category.c 2012-08-25 06:25:00 +0000 @@ -406,17 +406,17 @@ return Qnil; } -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. +/* Return true if there is a word boundary between two word-constituent + characters C1 and C2 if they appear in this order. Use the macro WORD_BOUNDARY_P instead of calling this function directly. */ -int +bool word_boundary_p (int c1, int c2) { Lisp_Object category_set1, category_set2; Lisp_Object tail; - int default_result; + bool default_result; if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), CHAR_TABLE_REF (Vchar_script_table, c2))) === modified file 'src/category.h' --- src/category.h 2012-08-20 08:20:25 +0000 +++ src/category.h 2012-08-25 06:25:00 +0000 @@ -77,14 +77,14 @@ /* Return the category set of character C in the current category table. */ #define CATEGORY_SET(c) char_category_set (c) -/* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. +/* Return true if CATEGORY_SET contains CATEGORY. The faster version of `!NILP (Faref (category_set, category))'. */ #define CATEGORY_MEMBER(category, category_set) \ ((XCATEGORY_SET (category_set)->data[(category) / 8] \ >> ((category) % 8)) & 1) -/* Return 1 if category set of CH contains CATEGORY, else return 0. */ -CATEGORY_INLINE int +/* Return true if category set of CH contains CATEGORY. */ +CATEGORY_INLINE bool CHAR_HAS_CATEGORY (int ch, int category) { Lisp_Object category_set = CATEGORY_SET (ch); @@ -108,14 +108,14 @@ #define CATEGORY_TABLE_VERSION (table) \ Fchar_table_extra_slot (table, make_number (1)) -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. +/* Return true if there is a word boundary between two + word-constituent characters C1 and C2 if they appear in this order. There is no word boundary between two word-constituent ASCII and Latin-1 characters. */ #define WORD_BOUNDARY_P(c1, c2) \ (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ && word_boundary_p (c1, c2)) -extern int word_boundary_p (int, int); +extern bool word_boundary_p (int, int); INLINE_HEADER_END ------------------------------------------------------------ revno: 109767 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-08-25 08:55:32 +0300 message: MS-Windows adaptations for revisions 109765 and 109766. lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. (GNULIBOBJS): Add $(BLD)/execinfo.$(O). src/makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-25 04:04:08 +0000 +++ ChangeLog 2012-08-25 05:55:32 +0000 @@ -1,3 +1,8 @@ +2012-08-25 Eli Zaretskii + + * lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. + (GNULIBOBJS): Add $(BLD)/execinfo.$(O). + 2012-08-24 Paul Eggert On assertion failure, print backtrace if available. === modified file 'lib/makefile.w32-in' --- lib/makefile.w32-in 2012-08-10 21:29:38 +0000 +++ lib/makefile.w32-in 2012-08-25 05:55:32 +0000 @@ -28,6 +28,7 @@ $(BLD)/c-strncasecmp.$(O) \ $(BLD)/dtoastr.$(O) \ $(BLD)/dtotimespec.$(O) \ + $(BLD)/execinfo.$(O) \ $(BLD)/getopt.$(O) \ $(BLD)/getopt1.$(O) \ $(BLD)/gettime.$(O) \ @@ -129,6 +130,9 @@ $(GNU_LIB)/timespec.h \ $(CONFIG_H) +$(BLD)/execinfo.$(O) : \ + $(GNU_LIB)/execinfo.h + $(BLD)/getopt.$(O) : \ $(GNU_LIB)/getopt.c \ $(GNU_LIB)/getopt.h \ @@ -299,3 +303,7 @@ < getopt.in.h > getopt_.h-t $(CP) getopt_.h-t getopt_.h - $(DEL) getopt_.h-t + +execinfo.h: execinfo.in.h + $(CP) execinfo.in.h $@ + === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-25 04:04:08 +0000 +++ src/ChangeLog 2012-08-25 05:55:32 +0000 @@ -1,3 +1,7 @@ +2012-08-25 Eli Zaretskii + + * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. + 2012-08-25 Paul Eggert On assertion failure, print backtrace if available. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-08-20 01:28:35 +0000 +++ src/makefile.w32-in 2012-08-25 05:55:32 +0000 @@ -480,6 +480,7 @@ $(SRC)/syssignal.h \ $(SRC)/w32.h \ $(NT_INC)/unistd.h \ + $(GNU_LIB)/execinfo.h \ $(GNU_LIB)/verify.h \ $(BLOCKINPUT_H) \ $(BUFFER_H) \ ------------------------------------------------------------ revno: 109766 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-24 21:27:32 -0700 message: * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. diff: === added file 'lib/execinfo.c' --- lib/execinfo.c 1970-01-01 00:00:00 +0000 +++ lib/execinfo.c 2012-08-25 04:27:32 +0000 @@ -0,0 +1,3 @@ +#include +#define _GL_EXECINFO_INLINE _GL_EXTERN_INLINE +#include "execinfo.h" === added file 'lib/execinfo.in.h' --- lib/execinfo.in.h 1970-01-01 00:00:00 +0000 +++ lib/execinfo.in.h 2012-08-25 04:27:32 +0000 @@ -0,0 +1,54 @@ +/* Information about executables. + + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_EXECINFO_H +#define _GL_EXECINFO_H + +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_EXECINFO_INLINE +# define _GL_EXECINFO_INLINE _GL_INLINE +#endif + +_GL_EXECINFO_INLINE int +backtrace (void **buffer, int size) +{ + (void) buffer; + (void) size; + return 0; +} + +_GL_EXECINFO_INLINE char ** +backtrace_symbols (void *const *buffer, int size) +{ + (void) buffer; + (void) size; + return 0; +} + +_GL_EXECINFO_INLINE void +backtrace_symbols_fd (void *const *buffer, int size, int fd) +{ + (void) buffer; + (void) size; + (void) fd; +} + +_GL_INLINE_HEADER_END + +#endif === added file 'm4/execinfo.m4' --- m4/execinfo.m4 1970-01-01 00:00:00 +0000 +++ m4/execinfo.m4 2012-08-25 04:27:32 +0000 @@ -0,0 +1,31 @@ +# Check for GNU-style execinfo.h. + +dnl Copyright 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXECINFO_H], +[ + AC_CHECK_HEADERS_ONCE([execinfo.h]) + + LIB_EXECINFO='' + EXECINFO_H='execinfo.h' + + if test $ac_cv_header_execinfo_h = yes; then + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([backtrace_symbols_fd], [execinfo], + [test "$ac_cv_search_backtrace_symbols_fd" = "none required" || + LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd]) + LIBS=$gl_saved_libs + test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H='' + fi + + if test -n "$EXECINFO_H"; then + AC_LIBOBJ([execinfo]) + fi + + AC_SUBST([EXECINFO_H]) + AC_SUBST([LIB_EXECINFO]) + AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"]) +]) ------------------------------------------------------------ revno: 109765 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-24 21:04:08 -0700 message: On assertion failure, print backtrace if available. Merge from gnulib, incorporating: 2012-08-24 execinfo: port to FreeBSD 2012-08-22 execinfo: new module * admin/merge-gnulib (GNULIB_MODULES): Add execinfo. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. * src/alloc.c [ENABLE_CHECKING]: Include . (die) [ENABLE_CHECKING]: Print a backtrace if available. * src/Makefile.in (LIB_EXECINFO): New macro. (LIBES): Use it. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-22 06:55:44 +0000 +++ ChangeLog 2012-08-25 04:04:08 +0000 @@ -1,3 +1,12 @@ +2012-08-24 Paul Eggert + + On assertion failure, print backtrace if available. + Merge from gnulib, incorporating: + 2012-08-24 execinfo: port to FreeBSD + 2012-08-22 execinfo: new module + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. + 2012-08-22 Glenn Morris * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-16 21:58:44 +0000 +++ admin/ChangeLog 2012-08-25 04:04:08 +0000 @@ -1,3 +1,8 @@ +2012-08-24 Paul Eggert + + On assertion failure, print backtrace if available. + * merge-gnulib (GNULIB_MODULES): Add execinfo. + 2012-08-16 Paul Eggert Use ASCII tests for character types. === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2012-08-16 21:58:44 +0000 +++ admin/merge-gnulib 2012-08-25 04:04:08 +0000 @@ -28,7 +28,7 @@ GNULIB_MODULES=' alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 - dtoastr dtotimespec dup2 environ + dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2012-08-19 23:31:24 +0000 +++ lib/gnulib.mk 2012-08-25 04:04:08 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings MOSTLYCLEANFILES += core *.stackdump @@ -150,6 +150,31 @@ ## end gnulib module dup2 +## begin gnulib module execinfo + +BUILT_SOURCES += $(EXECINFO_H) + +# We need the following in order to create when the system +# doesn't have one that works. +if GL_GENERATE_EXECINFO_H +execinfo.h: execinfo.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/execinfo.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +execinfo.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += execinfo.h execinfo.h-t + +EXTRA_DIST += execinfo.c execinfo.in.h + +EXTRA_libgnu_a_SOURCES += execinfo.c + +## end gnulib module execinfo + ## begin gnulib module filemode libgnu_a_SOURCES += filemode.c === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2012-08-19 23:31:24 +0000 +++ m4/gnulib-comp.m4 2012-08-25 04:04:08 +0000 @@ -53,6 +53,7 @@ # Code from module dtotimespec: # Code from module dup2: # Code from module environ: + # Code from module execinfo: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: @@ -152,6 +153,7 @@ gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) + gl_EXECINFO_H AC_REQUIRE([gl_EXTERN_INLINE]) gl_FILEMODE gl_GETLOADAVG @@ -534,6 +536,8 @@ lib/dtoastr.c lib/dtotimespec.c lib/dup2.c + lib/execinfo.c + lib/execinfo.in.h lib/filemode.c lib/filemode.h lib/ftoastr.c @@ -605,6 +609,7 @@ m4/clock_time.m4 m4/dup2.m4 m4/environ.m4 + m4/execinfo.m4 m4/extensions.m4 m4/extern-inline.m4 m4/filemode.m4 === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-25 03:11:12 +0000 +++ src/ChangeLog 2012-08-25 04:04:08 +0000 @@ -1,5 +1,11 @@ 2012-08-25 Paul Eggert + On assertion failure, print backtrace if available. + * alloc.c [ENABLE_CHECKING]: Include . + (die) [ENABLE_CHECKING]: Print a backtrace if available. + * Makefile.in (LIB_EXECINFO): New macro. + (LIBES): Use it. + * bytecode.c, callint.c, callproc.c: Use bool for boolean. * bytecode.c (exec_byte_code): * callint.c (check_mark, Fcall_interactively): === modified file 'src/Makefile.in' --- src/Makefile.in 2012-08-20 23:57:35 +0000 +++ src/Makefile.in 2012-08-25 04:04:08 +0000 @@ -159,6 +159,8 @@ ## dbusbind.o if HAVE_DBUS, else empty. DBUS_OBJ = @DBUS_OBJ@ +LIB_EXECINFO=@LIB_EXECINFO@ + SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ SETTINGS_LIBS = @SETTINGS_LIBS@ @@ -383,6 +385,7 @@ ## with GCC, we might need LIB_GCC again after them. LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) \ + $(LIB_EXECINFO) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ === modified file 'src/alloc.c' --- src/alloc.c 2012-08-21 23:39:56 +0000 +++ src/alloc.c 2012-08-25 04:04:08 +0000 @@ -6681,13 +6681,21 @@ } #ifdef ENABLE_CHECKING + +# include + bool suppress_checking; void die (const char *msg, const char *file, int line) { + enum { NPOINTERS_MAX = 500 }; + void *buffer[NPOINTERS_MAX]; + int npointers; fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", file, line, msg); + npointers = backtrace (buffer, NPOINTERS_MAX); + backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); abort (); } #endif ------------------------------------------------------------ revno: 109764 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-24 20:11:12 -0700 message: * bytecode.c, callint.c, callproc.c: Use bool for boolean. * bytecode.c (exec_byte_code): * callint.c (check_mark, Fcall_interactively): * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1) (getenv_internal, sync_process_alive, call_process_exited): * lisp.h (USE_SAFE_ALLOCA): Use bool for booleans, instead of int. * lisp.h, process.h: Adjust prototypes to match above changes. * callint.c (Fcall_interactively): Don't assume the mark's offset fits in 'int'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-24 04:37:57 +0000 +++ src/ChangeLog 2012-08-25 03:11:12 +0000 @@ -1,3 +1,16 @@ +2012-08-25 Paul Eggert + + * bytecode.c, callint.c, callproc.c: Use bool for boolean. + * bytecode.c (exec_byte_code): + * callint.c (check_mark, Fcall_interactively): + * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1) + (getenv_internal, sync_process_alive, call_process_exited): + * lisp.h (USE_SAFE_ALLOCA): + Use bool for booleans, instead of int. + * lisp.h, process.h: Adjust prototypes to match above changes. + * callint.c (Fcall_interactively): Don't assume the mark's + offset fits in 'int'. + 2012-08-24 Paul Eggert * buffer.c, buffer.h: Use bool for boolean. === modified file 'src/bytecode.c' --- src/bytecode.c 2012-08-07 13:37:21 +0000 +++ src/bytecode.c 2012-08-25 03:11:12 +0000 @@ -553,7 +553,7 @@ if (INTEGERP (args_template)) { ptrdiff_t at = XINT (args_template); - int rest = at & 128; + bool rest = (at & 128) != 0; int mandatory = at & 127; ptrdiff_t nonrest = at >> 8; eassert (mandatory <= nonrest); === modified file 'src/callint.c' --- src/callint.c 2012-08-17 23:38:43 +0000 +++ src/callint.c 2012-08-25 03:11:12 +0000 @@ -150,7 +150,7 @@ = {"", "point", "mark", "region-beginning", "region-end"}; static void -check_mark (int for_region) +check_mark (bool for_region) { Lisp_Object tem; tem = Fmarker_buffer (BVAR (current_buffer, mark)); @@ -273,11 +273,11 @@ signed char *varies; ptrdiff_t i, nargs; - int foo; - int arg_from_tty = 0; + ptrdiff_t mark; + bool arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; ptrdiff_t key_count; - int record_then_fail = 0; + bool record_then_fail = 0; Lisp_Object save_this_command, save_last_command; Lisp_Object save_this_original_command, save_real_this_command; @@ -685,7 +685,7 @@ goto have_prefix_arg; case 'n': /* Read number from minibuffer. */ { - int first = 1; + bool first = 1; do { Lisp_Object str; @@ -726,11 +726,11 @@ check_mark (1); set_marker_both (point_marker, Qnil, PT, PT_BYTE); /* visargs[i+1] = Qnil; */ - foo = marker_position (BVAR (current_buffer, mark)); + mark = marker_position (BVAR (current_buffer, mark)); /* visargs[i] = Qnil; */ - args[i] = PT < foo ? point_marker : BVAR (current_buffer, mark); + args[i] = PT < mark ? point_marker : BVAR (current_buffer, mark); varies[i] = 3; - args[++i] = PT > foo ? point_marker : BVAR (current_buffer, mark); + args[++i] = PT > mark ? point_marker : BVAR (current_buffer, mark); varies[i] = 4; break; === modified file 'src/callproc.c' --- src/callproc.c 2012-08-19 21:00:09 +0000 +++ src/callproc.c 2012-08-25 03:11:12 +0000 @@ -77,7 +77,7 @@ /* True if we are about to fork off a synchronous process or if we are waiting for it. */ -int synch_process_alive; +bool synch_process_alive; /* Nonzero => this is a string explaining death of synchronous subprocess. */ const char *synch_process_death; @@ -94,8 +94,8 @@ On MSDOS, delete the temporary file on any kind of termination. On Unix, kill the process and any children on termination by signal. */ -/* Nonzero if this is termination due to exit. */ -static int call_process_exited; +/* True if this is termination due to exit. */ +static bool call_process_exited; static Lisp_Object call_process_kill (Lisp_Object fdpid) @@ -190,7 +190,7 @@ (ptrdiff_t nargs, Lisp_Object *args) { Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail; - int display_p; + bool display_p; int fd[2]; int filefd; #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) @@ -217,7 +217,7 @@ struct coding_system argument_coding; /* coding-system of arguments */ /* Set to the return value of Ffind_operation_coding_system. */ Lisp_Object coding_systems; - int output_to_buffer = 1; + bool output_to_buffer = 1; /* Qt denotes that Ffind_operation_coding_system is not yet called. */ coding_systems = Qt; @@ -241,7 +241,7 @@ /* If arguments are supplied, we may have to encode them. */ if (nargs >= 5) { - int must_encode = 0; + bool must_encode = 0; Lisp_Object coding_attrs; for (i = 4; i < nargs; i++) @@ -610,12 +610,12 @@ Lisp_Object volatile buffer_volatile = buffer; Lisp_Object volatile coding_systems_volatile = coding_systems; Lisp_Object volatile current_dir_volatile = current_dir; - int volatile display_p_volatile = display_p; + bool volatile display_p_volatile = display_p; + bool volatile output_to_buffer_volatile = output_to_buffer; + bool volatile sa_must_free_volatile = sa_must_free; int volatile fd1_volatile = fd1; int volatile fd_error_volatile = fd_error; int volatile fd_output_volatile = fd_output; - int volatile output_to_buffer_volatile = output_to_buffer; - int volatile sa_must_free_volatile = sa_must_free; ptrdiff_t volatile sa_count_volatile = sa_count; unsigned char const **volatile new_argv_volatile = new_argv; @@ -766,11 +766,11 @@ if (output_to_buffer) { - register int nread; - int first = 1; + int nread; + bool first = 1; EMACS_INT total_read = 0; int carryover = 0; - int display_on_the_fly = display_p; + bool display_on_the_fly = display_p; struct coding_system saved_coding; saved_coding = process_coding; @@ -1086,7 +1086,7 @@ add_env (char **env, char **new_env, char *string) { char **ep; - int ok = 1; + bool ok = 1; if (string == NULL) return new_env; @@ -1126,8 +1126,7 @@ Therefore, the superior process must save and restore the value of environ around the vfork and the call to this function. - SET_PGRP is nonzero if we should put the subprocess into a separate - process group. + If SET_PGRP, put the subprocess into a separate process group. CURRENT_DIR is an elisp string giving the path of the current directory the subprocess should have. Since we can't really signal @@ -1135,7 +1134,8 @@ executable directory by the parent. */ int -child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir) +child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, + Lisp_Object current_dir) { char **env; char *pwd_var; @@ -1394,7 +1394,7 @@ } #endif /* not WINDOWSNT */ -static int +static bool getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, ptrdiff_t *valuelen, Lisp_Object env) { @@ -1429,7 +1429,7 @@ return 0; } -static int +static bool getenv_internal (const char *var, ptrdiff_t varlen, char **value, ptrdiff_t *valuelen, Lisp_Object frame) { === modified file 'src/lisp.h' --- src/lisp.h 2012-08-24 04:37:57 +0000 +++ src/lisp.h 2012-08-25 03:11:12 +0000 @@ -3330,7 +3330,7 @@ #ifndef DOS_NT _Noreturn #endif -extern int child_setup (int, int, int, char **, int, Lisp_Object); +extern int child_setup (int, int, int, char **, bool, Lisp_Object); extern void init_callproc_1 (void); extern void init_callproc (void); extern void set_initial_environment (void); @@ -3586,7 +3586,7 @@ extern void *record_xmalloc (size_t); #define USE_SAFE_ALLOCA \ - ptrdiff_t sa_count = SPECPDL_INDEX (); int sa_must_free = 0 + ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = 0 /* SAFE_ALLOCA allocates a simple buffer. */ === modified file 'src/process.h' --- src/process.h 2012-08-18 02:49:24 +0000 +++ src/process.h 2012-08-25 03:11:12 +0000 @@ -184,7 +184,7 @@ /* True if we are about to fork off a synchronous process or if we are waiting for it. */ -extern int synch_process_alive; +extern bool synch_process_alive; /* Communicate exit status of sync process to from sigchld_handler to Fcall_process. */ ------------------------------------------------------------ revno: 109763 committer: Michael Albinus + + * cmdargs.texi (General Variables): Setting + $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses connections + to the D-Bus session bus. (Bug#12112) + 2012-08-14 Eli Zaretskii * building.texi (Debugger Operation): Correct and improve === modified file 'doc/emacs/cmdargs.texi' --- doc/emacs/cmdargs.texi 2012-06-17 05:13:40 +0000 +++ doc/emacs/cmdargs.texi 2012-08-24 12:55:40 +0000 @@ -434,6 +434,11 @@ @item CDPATH Used by the @code{cd} command to search for the directory you specify, when you specify a relative directory name. +@item DBUS_SESSION_BUS_ADDRESS +Used by D-Bus when Emacs is compiled with it. Usually, there is no +need to change it. Setting it to a dummy address, like +@samp{unix:path=/tmp/foo}, suppresses connections to the D-Bus session +bus. @item EMACSDATA Directory for the architecture-independent files that come with Emacs. This is used to initialize the variable @code{data-directory}. ------------------------------------------------------------ revno: 109762 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-08-23 21:37:57 -0700 message: * buffer.c, buffer.h: Use bool for boolean. * buffer.c (reset_buffer_local_variables) (buffer_lisp_local_variables, Fset_buffer_modified_p) (Frestore_buffer_modified_p, Fset_buffer_multibyte): (overlays_at, overlays_in, mouse_face_overlay_overlaps) (overlay_touches_p, overlay_strings, Foverlay_put) (report_overlay_modification, call_overlay_mod_hooks): (mmap_enlarge, mmap_set_vars): * buffer.h (buffer_has_overlays, uppercasep, lowercasep): Use bool for booleans, instead of int. * buffer.c (compact_buffer, mmap_free_1): Return void, not int, since the 1-or-0 return value is always ignored anyway. (mmap_initialized_p): * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. * buffer.h, lisp.h: Adjust prototypes to match above changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-23 20:31:52 +0000 +++ src/ChangeLog 2012-08-24 04:37:57 +0000 @@ -1,3 +1,21 @@ +2012-08-24 Paul Eggert + + * buffer.c, buffer.h: Use bool for boolean. + * buffer.c (reset_buffer_local_variables) + (buffer_lisp_local_variables, Fset_buffer_modified_p) + (Frestore_buffer_modified_p, Fset_buffer_multibyte): + (overlays_at, overlays_in, mouse_face_overlay_overlaps) + (overlay_touches_p, overlay_strings, Foverlay_put) + (report_overlay_modification, call_overlay_mod_hooks): + (mmap_enlarge, mmap_set_vars): + * buffer.h (buffer_has_overlays, uppercasep, lowercasep): + Use bool for booleans, instead of int. + * buffer.c (compact_buffer, mmap_free_1): Return void, not int, + since the 1-or-0 return value is always ignored anyway. + (mmap_initialized_p): + * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. + * buffer.h, lisp.h: Adjust prototypes to match above changes. + 2012-08-23 Paul Eggert * bidi.c: Use bool for boolean. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-20 07:42:06 +0000 +++ src/buffer.c 2012-08-24 04:37:57 +0000 @@ -110,10 +110,10 @@ int last_per_buffer_idx; static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, - int after, Lisp_Object arg1, + bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); static void swap_out_buffer_local_variables (struct buffer *b); -static void reset_buffer_local_variables (struct buffer *b, int permanent_too); +static void reset_buffer_local_variables (struct buffer *, bool); /* Alist of all buffer names vs the buffers. */ /* This used to be a variable, but is no longer, @@ -155,7 +155,7 @@ static void free_buffer_text (struct buffer *b); static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); -static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); +static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); /* These setters are used only in this file, so they can be private. */ static inline void @@ -979,15 +979,13 @@ it does not treat permanent locals consistently. Instead, use Fkill_all_local_variables. - If PERMANENT_TOO is 1, then we reset permanent - buffer-local variables. If PERMANENT_TOO is 0, - we preserve those. */ + If PERMANENT_TOO, reset permanent buffer-local variables. + If not, preserve those. */ static void -reset_buffer_local_variables (register struct buffer *b, int permanent_too) +reset_buffer_local_variables (struct buffer *b, bool permanent_too) { - register int offset; - int i; + int offset, i; /* Reset the major mode to Fundamental, together with all the things that depend on the major mode. @@ -1253,14 +1251,14 @@ /* Return an alist of the Lisp-level buffer-local bindings of buffer BUF. That is, don't include the variables maintained in special slots in the buffer object. - If CLONE is zero elements of the form (VAR . unbound) are replaced + If not CLONE, replace elements of the form (VAR . unbound) by VAR. */ static Lisp_Object -buffer_lisp_local_variables (struct buffer *buf, int clone) +buffer_lisp_local_variables (struct buffer *buf, bool clone) { Lisp_Object result = Qnil; - register Lisp_Object tail; + Lisp_Object tail; for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) { Lisp_Object val, elt; @@ -1351,11 +1349,9 @@ 1, 1, 0, doc: /* Mark current buffer as modified or unmodified according to FLAG. A non-nil FLAG means mark the buffer modified. */) - (register Lisp_Object flag) + (Lisp_Object flag) { - register int already; - register Lisp_Object fn; - Lisp_Object buffer, window; + Lisp_Object fn, buffer, window; #ifdef CLASH_DETECTION /* If buffer becoming modified, lock the file. @@ -1365,7 +1361,7 @@ /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1432,7 +1428,7 @@ /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - int already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1676,7 +1672,7 @@ /* Truncate undo list and shrink the gap of BUFFER. */ -int +void compact_buffer (struct buffer *buffer) { /* Verify indirection counters. */ @@ -1718,9 +1714,7 @@ } } buffer->text->compact = buffer->text->modiff; - return 1; } - return 0; } DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", @@ -2471,8 +2465,8 @@ struct Lisp_Marker *tail, *markers; struct buffer *other; ptrdiff_t begv, zv; - int narrowed = (BEG != BEGV || Z != ZV); - int modified_p = !NILP (Fbuffer_modified_p (Qnil)); + bool narrowed = (BEG != BEGV || Z != ZV); + bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); Lisp_Object old_undo = BVAR (current_buffer, undo_list); struct gcpro gcpro1; @@ -2821,19 +2815,19 @@ *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. - If CHANGE_REQ is true, then any position written into *PREV_PTR or + If CHANGE_REQ, any position written into *PREV_PTR or *NEXT_PTR is guaranteed to be not equal to POS, unless it is the default (BEGV or ZV). */ ptrdiff_t -overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, +overlays_at (EMACS_INT pos, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, - ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, int change_req) + ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, bool change_req) { Lisp_Object overlay, start, end; struct Lisp_Overlay *tail; @@ -2842,7 +2836,7 @@ Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; + bool inhibit_storing = 0; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -2959,13 +2953,13 @@ *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. */ + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. */ static ptrdiff_t -overlays_in (EMACS_INT beg, EMACS_INT end, int extend, +overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) { @@ -2976,8 +2970,8 @@ Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; - int end_is_Z = end == Z; + bool inhibit_storing = 0; + bool end_is_Z = end == Z; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -3078,10 +3072,10 @@ } -/* Return non-zero if there exists an overlay with a non-nil +/* Return true if there exists an overlay with a non-nil `mouse-face' property overlapping OVERLAY. */ -int +bool mouse_face_overlay_overlaps (Lisp_Object overlay) { ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); @@ -3110,7 +3104,7 @@ /* Fast function to just test if we're at an overlay boundary. */ -int +bool overlay_touches_p (ptrdiff_t pos) { Lisp_Object overlay; @@ -3327,7 +3321,7 @@ Lisp_Object overlay, window, str; struct Lisp_Overlay *ov; ptrdiff_t startpos, endpos; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; @@ -4321,7 +4315,7 @@ (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) { Lisp_Object tail, buffer; - int changed; + bool changed; CHECK_OVERLAY (overlay); @@ -4396,7 +4390,7 @@ and the insert-after-hooks of overlay ending at START. This is called both before and after the modification. - AFTER is nonzero when we call after the modification. + AFTER is true when we call after the modification. ARG1, ARG2, ARG3 are arguments to pass to the hook functions. When AFTER is nonzero, they are the start position, @@ -4404,13 +4398,13 @@ and the length of deleted or replaced old text. */ void -report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, +report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { Lisp_Object prop, overlay; struct Lisp_Overlay *tail; - /* 1 if this change is an insertion. */ - int insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); + /* True if this change is an insertion. */ + bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; overlay = Qnil; @@ -4530,7 +4524,7 @@ } static void -call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, +call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -4689,7 +4683,7 @@ /* 1 means mmap has been initialized. */ -static int mmap_initialized_p; +static bool mmap_initialized_p; /* Value is X rounded up to the next multiple of N. */ @@ -4785,9 +4779,9 @@ /* Unmap a region. P is a pointer to the start of the user-araa of - the region. Value is non-zero if successful. */ + the region. */ -static int +static void mmap_free_1 (struct mmap_region *r) { if (r->next) @@ -4798,24 +4792,19 @@ mmap_regions = r->next; if (munmap (r, r->nbytes_mapped) == -1) - { - fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); - return 0; - } - - return 1; + fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); } /* Enlarge region R by NPAGES pages. NPAGES < 0 means shrink R. - Value is non-zero if successful. */ + Value is true if successful. */ -static int +static bool mmap_enlarge (struct mmap_region *r, int npages) { char *region_end = (char *) r + r->nbytes_mapped; size_t nbytes; - int success = 0; + bool success = 0; if (npages < 0) { @@ -4865,17 +4854,16 @@ } -/* Set or reset variables holding references to mapped regions. If - RESTORE_P is zero, set all variables to null. If RESTORE_P is - non-zero, set all variables to the start of the user-areas - of mapped regions. +/* Set or reset variables holding references to mapped regions. + If not RESTORE_P, set all variables to null. If RESTORE_P, set all + variables to the start of the user-areas of mapped regions. This function is called from Fdump_emacs to ensure that the dumped Emacs doesn't contain references to memory that won't be mapped when Emacs starts. */ void -mmap_set_vars (int restore_p) +mmap_set_vars (bool restore_p) { struct mmap_region *r; === modified file 'src/buffer.h' --- src/buffer.h 2012-08-20 07:42:06 +0000 +++ src/buffer.h 2012-08-24 04:37:57 +0000 @@ -471,7 +471,7 @@ /* Usually 0. Temporarily set to 1 in decode_coding_gap to prevent Fgarbage_collect from shrinking the gap and losing not-yet-decoded bytes. */ - int inhibit_shrinking; + bool inhibit_shrinking; }; /* Most code should use this macro to access Lisp fields in struct buffer. */ @@ -1006,11 +1006,10 @@ extern void delete_all_overlays (struct buffer *); extern void reset_buffer (struct buffer *); -extern int compact_buffer (struct buffer *); +extern void compact_buffer (struct buffer *); extern void evaporate_overlays (ptrdiff_t); -extern ptrdiff_t overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, - ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, - ptrdiff_t *prev_ptr, int change_req); +extern ptrdiff_t overlays_at (EMACS_INT, bool, Lisp_Object **, + ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, bool); extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); @@ -1022,7 +1021,7 @@ extern void record_buffer (Lisp_Object); extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); -extern void mmap_set_vars (int); +extern void mmap_set_vars (bool); /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. @@ -1067,7 +1066,7 @@ /* Non-zero if current buffer has overlays. */ -BUFFER_INLINE int +BUFFER_INLINE bool buffer_has_overlays (void) { return current_buffer->overlays_before || current_buffer->overlays_after; @@ -1243,7 +1242,7 @@ } /* 1 if C is upper case. */ -BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; } +BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } /* Upcase a character C known to be not upper case. */ BUFFER_INLINE int @@ -1255,8 +1254,11 @@ } /* 1 if C is lower case. */ -BUFFER_INLINE int lowercasep (int c) -{ return !uppercasep (c) && upcase1 (c) != c; } +BUFFER_INLINE bool +lowercasep (int c) +{ + return !uppercasep (c) && upcase1 (c) != c; +} /* Upcase a character C, or make no change if that cannot be done. */ BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-21 23:39:56 +0000 +++ src/lisp.h 2012-08-24 04:37:57 +0000 @@ -3110,14 +3110,14 @@ extern void set_time_zone_rule (const char *); /* Defined in buffer.c. */ -extern int mouse_face_overlay_overlaps (Lisp_Object); +extern bool mouse_face_overlay_overlaps (Lisp_Object); extern _Noreturn void nsberror (Lisp_Object); extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); -extern void report_overlay_modification (Lisp_Object, Lisp_Object, int, +extern void report_overlay_modification (Lisp_Object, Lisp_Object, bool, Lisp_Object, Lisp_Object, Lisp_Object); -extern int overlay_touches_p (ptrdiff_t); +extern bool overlay_touches_p (ptrdiff_t); extern Lisp_Object Vbuffer_alist; extern Lisp_Object set_buffer_if_live (Lisp_Object); extern Lisp_Object other_buffer_safely (Lisp_Object);