Fix more problems found by GCC 4.5.2's static checks.

This commit is contained in:
Paul Eggert 2011-03-22 18:01:59 -07:00
commit c9c49752e1
45 changed files with 1923 additions and 311 deletions

View file

@ -1,3 +1,16 @@
2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
Fix more problems found by GCC 4.5.2's static checks.
* Makefile.in (GNULIB_MODULES): Add socklen.
* configure.in: Do not check for sys/socket.h, since socklen does that.
* m4/socklen.m4: New automatically-generated file, from gnulib.
fakemail: Remove dependency on ignore-value.
* Makefile.in (GNULIB_MODULES): Add stdio.
* lib/stdio.in.h, m4/stdio_h.m4: New files, automatically
imported from gnulib.
* .bzrignore: Add lib/stdio.h.
2011-03-22 Glenn Morris <rgm@gnu.org>
* autogen/copy_autogen: Work from ./ or ../.

View file

@ -332,7 +332,8 @@ DOS_gnulib_comp.m4 = gl-comp.m4
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = \
crypto/md5 dtoastr filemode getloadavg getopt-gnu \
ignore-value intprops lstat mktime readlink strftime symlink sys_stat
ignore-value intprops lstat mktime readlink \
socklen stdio strftime symlink sys_stat
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)

View file

@ -1265,7 +1265,6 @@ if test $emacs_cv_struct_exception != yes; then
AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
fi
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>

View file

@ -1,3 +1,33 @@
2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
* ebrowse.c: Use size_t, not int, for sizes.
This avoids a warning with gcc -Wstrict-overflow, and works
better for very large objects.
(inbuffer_size): Now size_t. All uses changed.
(xmalloc, xrealloc, operator_name, process_file): Use size_t for
sizes. Don't bother testing whether a size_t value can be negative.
* etags.c (Ada_funcs): Redo slightly to avoid overflow warning.
etags: In Prolog functions, don't assume int fits in size_t.
This avoids a warning with gcc -Wstrict-overflow.
* etags.c (Prolog_functions, prolog_pr, prolog_atom): Use size_t,
not int, to store sizes.
(prolog_atom): Return 0, not -1, on error. All callers changed.
update-game-score: fix bug with -r
* update-game-score.c (main): Don't set 'scores' to garbage when
-r is specified and scorecount != MAX_SCORES (Bug#8310). This bug
was introduced in the 2002-04-10 change, and was found with gcc
-Wstrict-overflow (GCC 4.5.2, x86-64).
fakemail: Remove dependency on ignore-value.
This undoes some of the recent fakemail-related changes.
It is made possible due to recent changes to gnulib's stdio module.
* Makefile.in (fakemail${EXEEXT}): Do not depend on ignore-value.h.
* fakemail.c: Do not include ignore-value.h.
(put_line): Do not use ignore_value.
2011-03-03 Drake Wilson <drake@begriffli.ch> (tiny change)
* emacsclient.c (longopts): Add quiet.

View file

@ -353,7 +353,7 @@ movemail.o: ${srcdir}/movemail.c ../src/config.h
pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
fakemail${EXEEXT}: ${srcdir}/fakemail.c ${srcdir}/../lib/ignore-value.h ../src/config.h
fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h

View file

@ -378,7 +378,7 @@ int max_regexp = 50;
char *inbuffer;
char *in;
int inbuffer_size;
size_t inbuffer_size;
/* Return the current buffer position in the input file. */
@ -492,7 +492,7 @@ yyerror (const char *format, const char *s)
available. */
static void *
xmalloc (int nbytes)
xmalloc (size_t nbytes)
{
void *p = malloc (nbytes);
if (p == NULL)
@ -507,7 +507,7 @@ xmalloc (int nbytes)
/* Like realloc but print an error and exit if out of memory. */
static void *
xrealloc (void *p, int sz)
xrealloc (void *p, size_t sz)
{
p = realloc (p, sz);
if (p == NULL)
@ -2792,10 +2792,10 @@ parse_classname (void)
static char *
operator_name (int *sc)
{
static int id_size = 0;
static size_t id_size = 0;
static char *id = NULL;
const char *s;
int len;
size_t len;
MATCH ();
@ -2811,7 +2811,7 @@ operator_name (int *sc)
len = strlen (s) + 10;
if (len > id_size)
{
int new_size = max (len, 2 * id_size);
size_t new_size = max (len, 2 * id_size);
id = (char *) xrealloc (id, new_size);
id_size = new_size;
}
@ -2832,7 +2832,7 @@ operator_name (int *sc)
}
else
{
int tokens_matched = 0;
size_t tokens_matched = 0;
len = 20;
if (len > id_size)
@ -2853,7 +2853,7 @@ operator_name (int *sc)
len += strlen (s) + 2;
if (len > id_size)
{
int new_size = max (len, 2 * id_size);
size_t new_size = max (len, 2 * id_size);
id = (char *) xrealloc (id, new_size);
id_size = new_size;
}
@ -3550,7 +3550,7 @@ process_file (char *file)
fp = open_file (file);
if (fp)
{
int nread, nbytes;
size_t nread, nbytes;
/* Give a progress indication if needed. */
if (f_very_verbose)
@ -3574,12 +3574,10 @@ process_file (char *file)
}
nbytes = fread (inbuffer + nread, 1, READ_CHUNK_SIZE, fp);
if (nbytes <= 0)
if (nbytes == 0)
break;
nread += nbytes;
}
if (nread < 0)
nread = 0;
inbuffer[nread] = '\0';
/* Reinitialize scanner and parser for the new input file. */

View file

@ -4198,7 +4198,7 @@ Ada_funcs (FILE *inf)
/* Skip a string i.e. "abcd". */
if (inquote || (*dbp == '"'))
{
dbp = etags_strchr ((inquote) ? dbp : dbp+1, '"');
dbp = etags_strchr (dbp + !inquote, '"');
if (dbp != NULL)
{
inquote = FALSE;
@ -5254,16 +5254,16 @@ HTML_labels (FILE *inf)
* Original code by Sunichirou Sugou (1989)
* Rewritten by Anders Lindgren (1996)
*/
static int prolog_pr (char *, char *);
static size_t prolog_pr (char *, char *);
static void prolog_skip_comment (linebuffer *, FILE *);
static int prolog_atom (char *, int);
static size_t prolog_atom (char *, size_t);
static void
Prolog_functions (FILE *inf)
{
char *cp, *last;
int len;
int allocated;
size_t len;
size_t allocated;
allocated = 0;
len = 0;
@ -5320,16 +5320,16 @@ prolog_skip_comment (linebuffer *plb, FILE *inf)
* Return the size of the name of the predicate or rule, or 0 if no
* header was found.
*/
static int
static size_t
prolog_pr (char *s, char *last)
/* Name of last clause. */
{
int pos;
int len;
size_t pos;
size_t len;
pos = prolog_atom (s, 0);
if (pos < 1)
if (! pos)
return 0;
len = pos;
@ -5339,7 +5339,7 @@ prolog_pr (char *s, char *last)
|| (s[pos] == '(' && (pos += 1))
|| (s[pos] == ':' && s[pos + 1] == '-' && (pos += 2)))
&& (last == NULL /* save only the first clause */
|| len != (int)strlen (last)
|| len != strlen (last)
|| !strneq (s, last, len)))
{
make_tag (s, len, TRUE, s, pos, lineno, linecharno);
@ -5351,17 +5351,17 @@ prolog_pr (char *s, char *last)
/*
* Consume a Prolog atom.
* Return the number of bytes consumed, or -1 if there was an error.
* Return the number of bytes consumed, or 0 if there was an error.
*
* A prolog atom, in this context, could be one of:
* - An alphanumeric sequence, starting with a lower case letter.
* - A quoted arbitrary string. Single quotes can escape themselves.
* Backslash quotes everything.
*/
static int
prolog_atom (char *s, int pos)
static size_t
prolog_atom (char *s, size_t pos)
{
int origpos;
size_t origpos;
origpos = pos;
@ -5390,11 +5390,11 @@ prolog_atom (char *s, int pos)
}
else if (s[pos] == '\0')
/* Multiline quoted atoms are ignored. */
return -1;
return 0;
else if (s[pos] == '\\')
{
if (s[pos+1] == '\0')
return -1;
return 0;
pos += 2;
}
else
@ -5403,7 +5403,7 @@ prolog_atom (char *s, int pos)
return pos - origpos;
}
else
return -1;
return 0;
}

View file

@ -62,8 +62,6 @@ main ()
/* This is to declare cuserid. */
#include <unistd.h>
#include <ignore-value.h>
/* Type definitions */
@ -500,7 +498,7 @@ put_line (const char *string)
}
}
/* Output that much, then break the line. */
ignore_value (fwrite (s, 1, breakpos - s, rem->handle));
fwrite (s, 1, breakpos - s, rem->handle);
column = 8;
/* Skip whitespace and prepare to print more addresses. */

View file

@ -242,13 +242,15 @@ main (int argc, char **argv)
push_score (&scores, &scorecount, newscore, user_id, newdata);
sort_scores (scores, scorecount, reverse);
/* Limit the number of scores. If we're using reverse sorting, then
we should increment the beginning of the array, to skip over the
*smallest* scores. Otherwise, we just decrement the number of
scores, since the smallest will be at the end. */
also increment the beginning of the array, to skip over the
*smallest* scores. Otherwise, just decrementing the number of
scores suffices, since the smallest is at the end. */
if (scorecount > MAX_SCORES)
scorecount -= (scorecount - MAX_SCORES);
if (reverse)
scores += (scorecount - MAX_SCORES);
{
if (reverse)
scores += (scorecount - MAX_SCORES);
scorecount = MAX_SCORES;
}
if (write_scores (scorefile, scores, scorecount) < 0)
{
unlock_file (scorefile, lockstate);

View file

@ -9,7 +9,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=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdio strftime symlink sys_stat
MOSTLYCLEANFILES += core *.stackdump
@ -280,6 +280,117 @@ EXTRA_DIST += stdint.in.h
## end gnulib module stdint
## begin gnulib module stdio
BUILT_SOURCES += stdio.h
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
-e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
-e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
-e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
-e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
-e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
-e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdio.h stdio.h-t
EXTRA_DIST += stdio.in.h
## end gnulib module stdio
## begin gnulib module stdlib
BUILT_SOURCES += stdlib.h

1119
lib/stdio.in.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -172,15 +172,16 @@ extern char *tzname[];
#define add(n, f) \
do \
{ \
int _n = (n); \
int _delta = width - _n; \
int _incr = _n + (_delta > 0 ? _delta : 0); \
if ((size_t) _incr >= maxsize - i) \
size_t _n = (n); \
size_t _w = (width < 0 ? 0 : width); \
size_t _incr = _n < _w ? _w : _n; \
if (_incr >= maxsize - i) \
return 0; \
if (p) \
{ \
if (digits == 0 && _delta > 0) \
if (digits == 0 && _n < _w) \
{ \
size_t _delta = width - _n; \
if (pad == L_('0')) \
memset_zero (p, _delta); \
else \

View file

@ -45,10 +45,12 @@ AC_DEFUN([gl_EARLY],
# Code from module mktime:
# Code from module multiarch:
# Code from module readlink:
# Code from module socklen:
# Code from module stat:
# Code from module stdbool:
# Code from module stddef:
# Code from module stdint:
# Code from module stdio:
# Code from module stdlib:
# Code from module strftime:
# Code from module symlink:
@ -111,6 +113,8 @@ AC_DEFUN([gl_INIT],
# Code from module readlink:
gl_FUNC_READLINK
gl_UNISTD_MODULE_INDICATOR([readlink])
# Code from module socklen:
gl_TYPE_SOCKLEN_T
# Code from module stat:
gl_FUNC_STAT
gl_SYS_STAT_MODULE_INDICATOR([stat])
@ -120,6 +124,8 @@ AC_DEFUN([gl_INIT],
gl_STDDEF_H
# Code from module stdint:
gl_STDINT_H
# Code from module stdio:
gl_STDIO_H
# Code from module stdlib:
gl_STDLIB_H
# Code from module strftime:
@ -305,6 +311,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio.in.h
lib/stdlib.in.h
lib/strftime.c
lib/strftime.h
@ -327,11 +334,13 @@ AC_DEFUN([gl_FILE_LIST], [
m4/mktime.m4
m4/multiarch.m4
m4/readlink.m4
m4/socklen.m4
m4/st_dm_mode.m4
m4/stat.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strftime.m4
m4/symlink.m4

77
m4/socklen.m4 Normal file
View file

@ -0,0 +1,77 @@
# socklen.m4 serial 10
dnl Copyright (C) 2005-2007, 2009-2011 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.
dnl From Albert Chin, Windows fixes from Simon Josefsson.
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
dnl types for the argument to getsockopt, getpeername, etc.:
dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
dnl So we have to test to find something that will work.
AC_DEFUN([gl_TYPE_SOCKLEN_T],
[AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
AC_CHECK_TYPE([socklen_t], ,
[AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([gl_cv_socklen_t_equiv],
[# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
gl_cv_socklen_t_equiv=
for arg2 in "struct sockaddr" void; do
for t in int size_t "unsigned int" "long int" "unsigned long int"; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/socket.h>
int getpeername (int, $arg2 *, $t *);]],
[[$t len;
getpeername (0, 0, &len);]])],
[gl_cv_socklen_t_equiv="$t"])
test "$gl_cv_socklen_t_equiv" != "" && break
done
test "$gl_cv_socklen_t_equiv" != "" && break
done
])
if test "$gl_cv_socklen_t_equiv" = ""; then
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
fi
AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
[type to use in place of socklen_t if not defined])],
[gl_SOCKET_HEADERS])])
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users
dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
dnl When you change this macro, keep also in sync:
dnl - gl_CHECK_SOCKET_HEADERS,
dnl - the Include section of modules/socklen.
AC_DEFUN([gl_SOCKET_HEADERS],
[
/* <sys/types.h> is not needed according to POSIX, but the
<sys/socket.h> in i386-unknown-freebsd4.10 and
powerpc-apple-darwin5.5 required it. */
#include <sys/types.h>
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#elif HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif
])
dnl Tests for the existence of the header for socket facilities.
dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
dnl This macro must match gl_SOCKET_HEADERS.
AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
[AC_CHECK_HEADERS_ONCE([sys/socket.h])
if test $ac_cv_header_sys_socket_h = no; then
dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
dnl the check for those headers unconditional; yet cygwin reports
dnl that the headers are present but cannot be compiled (since on
dnl cygwin, all socket information should come from sys/socket.h).
AC_CHECK_HEADERS([ws2tcpip.h])
fi
])

140
m4/stdio_h.m4 Normal file
View file

@ -0,0 +1,140 @@
# stdio_h.m4 serial 33
dnl Copyright (C) 2007-2011 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_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_C_INLINE])
gl_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FPRINTF=1
GNULIB_PRINTF=1
GNULIB_VFPRINTF=1
GNULIB_VPRINTF=1
GNULIB_FPUTC=1
GNULIB_PUTC=1
GNULIB_PUTCHAR=1
GNULIB_FPUTS=1
GNULIB_PUTS=1
GNULIB_FWRITE=1
dnl This ifdef is just an optimization, to avoid performing a configure
dnl check whose result is not used. It does not make the test of
dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
m4_ifdef([gl_SIGNAL_SIGPIPE], [
gl_SIGNAL_SIGPIPE
if test $gl_cv_header_signal_h_SIGPIPE != yes; then
REPLACE_STDIO_WRITE_FUNCS=1
AC_LIBOBJ([stdio-write])
fi
])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
snprintf tmpfile vdprintf vsnprintf])
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
AC_DEFUN([gl_STDIO_H_DEFAULTS],
[
GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
])

View file

@ -1,3 +1,130 @@
2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
Fix more problems found by GCC 4.5.2's static checks.
* coding.c (encode_coding_raw_text): Avoid unnecessary test
the first time through the loop, since we know p0 < p1 then.
This also avoids a gcc -Wstrict-overflow warning.
* lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
leading to a memory leak, possible in functions like
load_charset_map_from_file that can allocate an unbounded number
of objects (Bug#8318).
* xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
that could (at least in theory) be that large.
* xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
This is less likely to overflow, and avoids undefined behavior if
overflow does occur. All callers changed. Use strtoul to scan
for the unsigned long integer.
(pint2hrstr): Simplify and tune code slightly.
This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
* scroll.c (do_scrolling): Work around GCC bug 48228.
See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
* frame.c (Fmodify_frame_parameters): Simplify loop counter.
This also avoids a warning with gcc -Wstrict-overflow.
(validate_x_resource_name): Simplify count usage.
This also avoids a warning with gcc -Wstrict-overflow.
* fileio.c (Fcopy_file): Report error if fchown or fchmod
fail (Bug#8306).
* emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
* process.c (Fmake_network_process): Use socklen_t, not int,
where POSIX says socklen_t is required in portable programs.
This fixes a porting bug on hosts like 64-bit HP-UX, where
socklen_t is wider than int (Bug#8277).
(Fmake_network_process, server_accept_connection):
(wait_reading_process_output, read_process_output):
Likewise.
* process.c: Rename or move locals to avoid shadowing.
(list_processes_1, Fmake_network_process):
(read_process_output_error_handler, exec_sentinel_error_handler):
Rename or move locals.
(Fmake_network_process): Define label "retry_connect" only if needed.
(Fnetwork_interface_info): Fix pointer signedness.
(process_send_signal): Add cast to avoid pointer signedness problem.
(FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
(create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
Make tparam.h and terminfo.c consistent.
* cm.c (tputs, tgoto, BC, UP): Remove extern decls. Include
tparam.h instead, since it declares them.
* cm.h (PC): Remove extern decl; tparam.h now does this.
* deps.mk (cm.o, terminfo.o): Depend on tparam.h.
* terminfo.c: Include tparam.h, to check interfaces.
(tparm): Make 1st arg a const pointer in decl. Put it at top level.
(tparam): Adjust signature to match interface in tparam.h;
this removes some undefined behavior. Check that outstring and len
are zero, which they always are with Emacs.
* tparam.h (PC, BC, UP): New extern decls.
* xftfont.c (xftfont_shape): Now static, and defined only if needed.
(xftfont_open): Rename locals to avoid shadowing.
* ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
(ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
(OTF_TAG_SYM): Omit macro if not needed.
(ftfont_list): Remove unused local.
(get_adstyle_property, ftfont_pattern_entity):
(ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
Rename locals to avoid shadowing.
* xfont.c (xfont_list_family): Mark var as initialized.
* xml.c (make_dom): Now static.
* composite.c (composition_compute_stop_pos): Rename local to
avoid shadowing.
(composition_reseat_it): Remove unused locals.
(find_automatic_composition, composition_adjust_point): Likewise.
(composition_update_it): Mark var as initialized.
(find_automatic_composition): Mark vars as initialized,
with a FIXME (Bug#8290).
character.h: Rename locals to avoid shadowing.
* character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
(BUF_DEC_POS): Be more systematic about renaming local temporaries
to avoid shadowing.
* textprop.c (property_change_between_p): Remove; unused.
* intervals.c (interval_start_pos): Now static.
* intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
* atimer.c (start_atimer, append_atimer_lists, set_alarm): Rename
locals to avoid shadowing.
* sound.c (wav_play, au_play, Fplay_sound_internal):
Fix pointer signedness.
(alsa_choose_format): Remove unused local var.
(wav_play): Initialize a variable to 0, to prevent undefined
behavior (Bug#8278).
* region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
* region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
* callproc.c (Fcall_process): Use 'volatile' to avoid vfork
clobbering (Bug#8298).
* sysdep.c (sys_subshell): Likewise.
Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
* lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
This should get cleaned up, so that child_setup has the
same signature on all platforms.
* callproc.c (call_process_cleanup): Now static.
(relocate_fd): Rename locals to avoid shadowing.
2011-03-22 Chong Yidong <cyd@stupidchicken.com>
* xterm.c (x_clear_frame): Remove XClearWindow call. This appears

View file

@ -86,7 +86,7 @@ SIGTYPE alarm_signal_handler (int signo);
to cancel_atimer; don't free it yourself. */
struct atimer *
start_atimer (enum atimer_type type, EMACS_TIME time, atimer_callback fn,
start_atimer (enum atimer_type type, EMACS_TIME timestamp, atimer_callback fn,
void *client_data)
{
struct atimer *t;
@ -94,10 +94,10 @@ start_atimer (enum atimer_type type, EMACS_TIME time, atimer_callback fn,
/* Round TIME up to the next full second if we don't have
itimers. */
#ifndef HAVE_SETITIMER
if (EMACS_USECS (time) != 0)
if (EMACS_USECS (timestamp) != 0)
{
EMACS_SET_USECS (time, 0);
EMACS_SET_SECS (time, EMACS_SECS (time) + 1);
EMACS_SET_USECS (timestamp, 0);
EMACS_SET_SECS (timestamp, EMACS_SECS (timestamp) + 1);
}
#endif /* not HAVE_SETITIMER */
@ -123,18 +123,18 @@ start_atimer (enum atimer_type type, EMACS_TIME time, atimer_callback fn,
switch (type)
{
case ATIMER_ABSOLUTE:
t->expiration = time;
t->expiration = timestamp;
break;
case ATIMER_RELATIVE:
EMACS_GET_TIME (t->expiration);
EMACS_ADD_TIME (t->expiration, t->expiration, time);
EMACS_ADD_TIME (t->expiration, t->expiration, timestamp);
break;
case ATIMER_CONTINUOUS:
EMACS_GET_TIME (t->expiration);
EMACS_ADD_TIME (t->expiration, t->expiration, time);
t->interval = time;
EMACS_ADD_TIME (t->expiration, t->expiration, timestamp);
t->interval = timestamp;
break;
}
@ -187,24 +187,24 @@ cancel_atimer (struct atimer *timer)
}
/* Append two lists of atimers LIST1 and LIST2 and return the
/* Append two lists of atimers LIST_1 and LIST_2 and return the
result list. */
static struct atimer *
append_atimer_lists (struct atimer *list1, struct atimer *list2)
append_atimer_lists (struct atimer *list_1, struct atimer *list_2)
{
if (list1 == NULL)
return list2;
else if (list2 == NULL)
return list1;
if (list_1 == NULL)
return list_2;
else if (list_2 == NULL)
return list_1;
else
{
struct atimer *p;
for (p = list1; p->next; p = p->next)
for (p = list_1; p->next; p = p->next)
;
p->next = list2;
return list1;
p->next = list_2;
return list_1;
}
}
@ -287,28 +287,28 @@ set_alarm (void)
{
if (atimers)
{
EMACS_TIME now, time;
EMACS_TIME now, timestamp;
#ifdef HAVE_SETITIMER
struct itimerval it;
#endif
/* Determine s/us till the next timer is ripe. */
EMACS_GET_TIME (now);
EMACS_SUB_TIME (time, atimers->expiration, now);
EMACS_SUB_TIME (timestamp, atimers->expiration, now);
#ifdef HAVE_SETITIMER
/* Don't set the interval to 0; this disables the timer. */
if (EMACS_TIME_LE (atimers->expiration, now))
{
EMACS_SET_SECS (time, 0);
EMACS_SET_USECS (time, 1000);
EMACS_SET_SECS (timestamp, 0);
EMACS_SET_USECS (timestamp, 1000);
}
memset (&it, 0, sizeof it);
it.it_value = time;
it.it_value = timestamp;
setitimer (ITIMER_REAL, &it, 0);
#else /* not HAVE_SETITIMER */
alarm (max (EMACS_SECS (time), 1));
alarm (max (EMACS_SECS (timestamp), 1));
#endif /* not HAVE_SETITIMER */
}
}
@ -442,4 +442,3 @@ init_atimer (void)
/* pending_signals is initialized in init_keyboard.*/
signal (SIGALRM, alarm_signal_handler);
}

View file

@ -107,7 +107,7 @@ call_process_kill (Lisp_Object fdpid)
return Qnil;
}
Lisp_Object
static Lisp_Object
call_process_cleanup (Lisp_Object arg)
{
Lisp_Object fdpid = Fcdr (arg);
@ -180,7 +180,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
(int nargs, register Lisp_Object *args)
{
Lisp_Object infile, buffer, current_dir, path;
int display_p;
volatile int display_p_volatile;
int fd[2];
int filefd;
register int pid;
@ -190,6 +190,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
int bufsize = CALLPROC_BUFFER_SIZE_MIN;
int count = SPECPDL_INDEX ();
const unsigned char **volatile new_argv_volatile;
register const unsigned char **new_argv;
/* File to use for stderr in the child.
t means use same as standard output. */
@ -343,7 +344,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
UNGCPRO;
}
display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
display_p_volatile = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
if (filefd < 0)
@ -371,7 +372,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
&& SREF (path, 1) == ':')
path = Fsubstring (path, make_number (2), Qnil);
new_argv = (const unsigned char **)
new_argv_volatile = new_argv = (const unsigned char **)
alloca (max (2, nargs - 2) * sizeof (char *));
if (nargs > 4)
{
@ -542,6 +543,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
pid = vfork ();
new_argv = new_argv_volatile;
if (pid == 0)
{
if (fd[0] >= 0)
@ -673,6 +676,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
int first = 1;
EMACS_INT total_read = 0;
int carryover = 0;
int display_p = display_p_volatile;
int display_on_the_fly = display_p;
struct coding_system saved_coding;
@ -1272,12 +1276,12 @@ relocate_fd (int fd, int minfd)
#endif
if (new == -1)
{
const char *message1 = "Error while setting up child: ";
const char *message_1 = "Error while setting up child: ";
const char *errmessage = strerror (errno);
const char *message2 = "\n";
emacs_write (2, message1, strlen (message1));
const char *message_2 = "\n";
emacs_write (2, message_1, strlen (message_1));
emacs_write (2, errmessage, strlen (errmessage));
emacs_write (2, message2, strlen (message2));
emacs_write (2, message_2, strlen (message_2));
_exit (1);
}
emacs_close (fd);

View file

@ -278,11 +278,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
do { \
if ((p) > (limit)) \
{ \
const unsigned char *pcb = (p); \
const unsigned char *chp = (p); \
do { \
pcb--; \
} while (pcb >= limit && ! CHAR_HEAD_P (*pcb)); \
(p) = (BYTES_BY_CHAR_HEAD (*pcb) == (p) - pcb) ? pcb : (p) - 1; \
chp--; \
} while (chp >= limit && ! CHAR_HEAD_P (*chp)); \
(p) = (BYTES_BY_CHAR_HEAD (*chp) == (p) - chp) ? chp : (p) - 1; \
} \
} while (0)
@ -353,11 +353,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *string_ptr = &SDATA (STRING)[BYTEIDX]; \
int string_len; \
unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (string_ptr, string_len); \
BYTEIDX += string_len; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
@ -376,11 +376,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int ptrlen; \
unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, ptrlen); \
BYTEIDX += ptrlen; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
@ -416,11 +416,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int string_len; \
unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
int chlen; \
\
OUTPUT= STRING_CHAR_AND_LENGTH (ptr, string_len); \
BYTEIDX += string_len; \
OUTPUT= STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
@ -436,11 +436,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define FETCH_CHAR_ADVANCE_NO_CHECK(OUTPUT, CHARIDX, BYTEIDX) \
do \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
CHARIDX++; \
} \
while (0)
@ -451,8 +451,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define INC_POS(pos_byte) \
do { \
unsigned char *ptr = BYTE_POS_ADDR (pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*ptr); \
unsigned char *chp = BYTE_POS_ADDR (pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
} while (0)
@ -461,16 +461,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DEC_POS(pos_byte) \
do { \
unsigned char *ptr; \
unsigned char *chp; \
\
pos_byte--; \
if (pos_byte < GPT_BYTE) \
ptr = BEG_ADDR + pos_byte - BEG_BYTE; \
chp = BEG_ADDR + pos_byte - BEG_BYTE; \
else \
ptr = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
while (!CHAR_HEAD_P (*ptr)) \
chp = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
while (!CHAR_HEAD_P (*chp)) \
{ \
ptr--; \
chp--; \
pos_byte--; \
} \
} while (0)
@ -510,8 +510,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_INC_POS(buf, pos_byte) \
do { \
unsigned char *bbp = BUF_BYTE_ADDRESS (buf, pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*bbp); \
unsigned char *chp = BUF_BYTE_ADDRESS (buf, pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
} while (0)
@ -520,15 +520,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_DEC_POS(buf, pos_byte) \
do { \
unsigned char *p; \
unsigned char *chp; \
pos_byte--; \
if (pos_byte < BUF_GPT_BYTE (buf)) \
p = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
chp = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
else \
p = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
while (!CHAR_HEAD_P (*p)) \
chp = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
while (!CHAR_HEAD_P (*chp)) \
{ \
p--; \
chp--; \
pos_byte--; \
} \
} while (0)

View file

@ -27,19 +27,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "cm.h"
#include "termhooks.h"
#include "termchar.h"
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
won't find. */
extern void tputs (const char *, int, int (*)(int));
extern char *tgoto (const char *, int, int);
#include "tparam.h"
#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
use about 2000.... */
extern char *BC, *UP;
int cost; /* sums up costs */
/* ARGSUSED */

View file

@ -96,8 +96,6 @@ struct cm
int cc_vabs;
};
extern char PC; /* Pad character */
/* Shorthand */
#ifndef NoCMShortHand
#define curY(tty) (tty)->Wcm->cm_curY

View file

@ -5266,11 +5266,12 @@ encode_coding_raw_text (struct coding_system *coding)
unsigned char str[MAX_MULTIBYTE_LENGTH], *p0 = str, *p1 = str;
CHAR_STRING_ADVANCE (c, p1);
while (p0 < p1)
do
{
EMIT_ONE_BYTE (*p0);
p0++;
}
while (p0 < p1);
}
}
else

View file

@ -1115,7 +1115,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
if (! NILP (val))
{
Lisp_Object elt;
int ridx, back, len;
int ridx, back, blen;
for (ridx = 0; CONSP (val); val = XCDR (val), ridx++)
{
@ -1132,17 +1132,17 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
bpos = (NILP (string) ? CHAR_TO_BYTE (cpos)
: string_char_to_byte (string, cpos));
if (STRINGP (AREF (elt, 0)))
len = fast_looking_at (AREF (elt, 0), cpos, bpos,
start + 1, limit, string);
blen = fast_looking_at (AREF (elt, 0), cpos, bpos,
start + 1, limit, string);
else
len = 1;
if (len > 0)
blen = 1;
if (blen > 0)
{
/* Make CPOS point to the last character of
match. Note that LEN is byte-length. */
if (len > 1)
match. Note that BLEN is byte-length. */
if (blen > 1)
{
bpos += len;
bpos += blen;
if (NILP (string))
cpos = BYTE_TO_CHAR (bpos) - 1;
else
@ -1248,8 +1248,8 @@ composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
else if (w)
{
Lisp_Object lgstring = Qnil;
Lisp_Object val, elt, re;
int len, i;
Lisp_Object val, elt;
int i;
val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val));
@ -1364,7 +1364,7 @@ composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
int
composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, Lisp_Object string)
{
int i, c;
int i, c IF_LINT (= 0);
if (cmp_it->ch < 0)
{
@ -1489,9 +1489,14 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
EMACS_INT head, tail, stop;
/* Limit to check a composition after POS. */
EMACS_INT fore_check_limit;
struct position_record orig, cur, check, prev;
struct position_record orig, cur;
/* FIXME: It's not obvious whether these two variables need initialization.
If they do, please supply initial values.
If not, please remove this comment. */
struct position_record check IF_LINT (= {0}), prev IF_LINT (= {0});
Lisp_Object check_val, val, elt;
int check_lookback;
int c;
Lisp_Object window;
struct window *w;
@ -1657,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
EMACS_INT
composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
{
EMACS_INT charpos, bytepos, startpos, beg, end, pos;
EMACS_INT beg, end;
Lisp_Object val;
int i;
@ -2032,4 +2037,3 @@ See also the documentation of `auto-composition-mode'. */);
defsubr (&Sfind_composition_internal);
defsubr (&Scomposition_get_gstring);
}

View file

@ -65,7 +65,7 @@ coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h composite.h \
window.h dispextern.h msdos.h frame.h termhooks.h \
lisp.h globals.h $(config_h)
cm.o: cm.c frame.h cm.h termhooks.h termchar.h dispextern.h msdos.h \
lisp.h globals.h $(config_h)
tparam.h lisp.h globals.h $(config_h)
cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h \
globals.h $(config_h) msdos.h dispextern.h keyboard.h keymap.h systime.h \
coding.h frame.h composite.h
@ -196,7 +196,7 @@ termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h)
terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \
msdos.h
terminfo.o: terminfo.c lisp.h globals.h $(config_h)
terminfo.o: terminfo.c tparam.h lisp.h globals.h $(config_h)
tparam.o: tparam.c tparam.h lisp.h $(config_h)
undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \
lisp.h globals.h $(config_h)

View file

@ -2312,6 +2312,7 @@ from the parent process and its tty file descriptors. */)
(void)
{
int nfd;
int err = 0;
if (!IS_DAEMON)
error ("This function can only be called if emacs is run as a daemon");
@ -2324,10 +2325,11 @@ from the parent process and its tty file descriptors. */)
/* Get rid of stdin, stdout and stderr. */
nfd = open ("/dev/null", O_RDWR);
dup2 (nfd, 0);
dup2 (nfd, 1);
dup2 (nfd, 2);
close (nfd);
err |= nfd < 0;
err |= dup2 (nfd, 0) < 0;
err |= dup2 (nfd, 1) < 0;
err |= dup2 (nfd, 2) < 0;
err |= close (nfd) != 0;
/* Closing the pipe will notify the parent that it can exit.
FIXME: In case some other process inherited the pipe, closing it here
@ -2336,10 +2338,13 @@ from the parent process and its tty file descriptors. */)
Instead, we should probably close the pipe in start-process and
call-process to make sure the pipe is never inherited by
subprocesses. */
write (daemon_pipe[1], "\n", 1);
close (daemon_pipe[1]);
err |= write (daemon_pipe[1], "\n", 1) < 0;
err |= close (daemon_pipe[1]) != 0;
/* Set it to an invalid value so we know we've already run this function. */
daemon_pipe[1] = -1;
if (err)
error ("I/O error during daemon initialization");
return Qt;
}

View file

@ -1951,9 +1951,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
owner and group. */
if (input_file_statable_p)
{
if (! NILP (preserve_uid_gid))
fchown (ofd, st.st_uid, st.st_gid);
fchmod (ofd, st.st_mode & 07777);
if (!NILP (preserve_uid_gid) && fchown (ofd, st.st_uid, st.st_gid) != 0)
report_file_error ("Doing chown", Fcons (newname, Qnil));
if (fchmod (ofd, st.st_mode & 07777) != 0)
report_file_error ("Doing chmod", Fcons (newname, Qnil));
}
#endif /* not MSDOS */

View file

@ -2529,7 +2529,7 @@ use is not recommended. Explicitly check for a frame-parameter instead. */)
}
/* Now process them in reverse of specified order. */
for (i--; i >= 0; i--)
while (--i >= 0)
{
prop = parms[i];
val = values[i];
@ -3713,8 +3713,7 @@ validate_x_resource_name (void)
return;
/* If name is entirely invalid, or nearly so, use `emacs'. */
if (good_count == 0
|| (good_count == 1 && bad_count > 0))
if (good_count < 2)
{
Vx_resource_name = build_string ("emacs");
return;

View file

@ -168,11 +168,11 @@ get_adstyle_property (FcPattern *p)
for (end = str; *end && *end != ' '; end++);
if (*end)
{
char *p = alloca (end - str + 1);
memcpy (p, str, end - str);
p[end - str] = '\0';
end = p + (end - str);
str = p;
char *newstr = alloca (end - str + 1);
memcpy (newstr, str, end - str);
newstr[end - str] = '\0';
end = newstr + (end - str);
str = newstr;
}
if (xstrcasecmp (str, "Regular") == 0
|| xstrcasecmp (str, "Bold") == 0
@ -190,18 +190,18 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra)
{
Lisp_Object key, cache, entity;
char *file, *str;
int index;
int idx;
int numeric;
double dbl;
FcBool b;
if (FcPatternGetString (p, FC_FILE, 0, (FcChar8 **) &file) != FcResultMatch)
return Qnil;
if (FcPatternGetInteger (p, FC_INDEX, 0, &index) != FcResultMatch)
if (FcPatternGetInteger (p, FC_INDEX, 0, &idx) != FcResultMatch)
return Qnil;
key = Fcons (make_unibyte_string ((char *) file, strlen ((char *) file)),
make_number (index));
make_number (idx));
cache = ftfont_lookup_cache (key, FTFONT_CACHE_FOR_ENTITY);
entity = XCAR (cache);
if (! NILP (entity))
@ -265,7 +265,7 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra)
ASET (entity, FONT_ADSTYLE_INDEX, get_adstyle_property (p));
if ((ft_library || FT_Init_FreeType (&ft_library) == 0)
&& FT_New_Face (ft_library, file, index, &ft_face) == 0)
&& FT_New_Face (ft_library, file, idx, &ft_face) == 0)
{
BDF_PropertyRec rec;
@ -311,8 +311,9 @@ ftfont_resolve_generic_family (Lisp_Object family, FcPattern *pattern)
if (FcPatternGetLangSet (pattern, FC_LANG, 0, &langset) != FcResultMatch)
{
/* This is to avoid the effect of locale. */
static const FcChar8 lang[] = "en";
langset = FcLangSetCreate ();
FcLangSetAdd (langset, "en");
FcLangSetAdd (langset, lang);
FcPatternAddLangSet (pattern, FC_LANG, langset);
FcLangSetDestroy (langset);
}
@ -393,14 +394,14 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
? ! cache_data->ft_face : ! cache_data->fc_charset)
{
char *filename = SSDATA (XCAR (key));
int index = XINT (XCDR (key));
int idx = XINT (XCDR (key));
if (cache_for == FTFONT_CACHE_FOR_FACE)
{
if (! ft_library
&& FT_Init_FreeType (&ft_library) != 0)
return Qnil;
if (FT_New_Face (ft_library, filename, index, &cache_data->ft_face)
if (FT_New_Face (ft_library, filename, idx, &cache_data->ft_face)
!= 0)
return Qnil;
}
@ -412,7 +413,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
FcCharSet *charset = NULL;
pat = FcPatternBuild (0, FC_FILE, FcTypeString, (FcChar8 *) filename,
FC_INDEX, FcTypeInteger, index, NULL);
FC_INDEX, FcTypeInteger, idx, NULL);
if (! pat)
goto finish;
objset = FcObjectSetBuild (FC_CHARSET, FC_STYLE, NULL);
@ -490,8 +491,12 @@ static int ftfont_get_bitmap (struct font *, unsigned,
struct font_bitmap *, int);
static int ftfont_anchor_point (struct font *, unsigned, int,
int *, int *);
#ifdef HAVE_LIBOTF
static Lisp_Object ftfont_otf_capability (struct font *);
# ifdef HAVE_M17N_FLT
static Lisp_Object ftfont_shape (Lisp_Object);
# endif
#endif
#ifdef HAVE_OTF_GET_VARIATION_GLYPHS
static int ftfont_variation_glyphs (struct font *, int c,
@ -618,6 +623,7 @@ struct OpenTypeSpec
(P)[4] = '\0'; \
} while (0)
#ifdef HAVE_LIBOTF
#define OTF_TAG_SYM(SYM, TAG) \
do { \
char str[5]; \
@ -625,6 +631,7 @@ struct OpenTypeSpec
OTF_TAG_STR (TAG, str); \
(SYM) = font_intern_prop (str, 4, 1); \
} while (0)
#endif
static struct OpenTypeSpec *
@ -864,7 +871,6 @@ ftfont_list (Lisp_Object frame, Lisp_Object spec)
FcObjectSet *objset = NULL;
FcCharSet *charset;
Lisp_Object chars = Qnil;
FcResult result;
char otlayout[15]; /* For "otlayout:XXXX" */
struct OpenTypeSpec *otspec = NULL;
int spacing = -1;
@ -1153,7 +1159,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
FT_Face ft_face;
FT_Size ft_size;
FT_UInt size;
Lisp_Object val, filename, index, cache, font_object;
Lisp_Object val, filename, idx, cache, font_object;
int scalable;
int spacing;
char name[256];
@ -1168,7 +1174,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
if (NILP (cache))
return Qnil;
filename = XCAR (val);
index = XCDR (val);
idx = XCDR (val);
val = XCDR (cache);
cache_data = XSAVE_VALUE (XCDR (cache))->pointer;
ft_face = cache_data->ft_face;
@ -1210,7 +1216,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
font = XFONT_OBJECT (font_object);
ftfont_info = (struct ftfont_info *) font;
ftfont_info->ft_size = ft_face->size;
ftfont_info->index = XINT (index);
ftfont_info->index = XINT (idx);
#ifdef HAVE_LIBOTF
ftfont_info->maybe_otf = ft_face->face_flags & FT_FACE_FLAG_SFNT;
ftfont_info->otf = NULL;
@ -1455,7 +1461,8 @@ ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bit
}
static int
ftfont_anchor_point (struct font *font, unsigned int code, int index, int *x, int *y)
ftfont_anchor_point (struct font *font, unsigned int code, int idx,
int *x, int *y)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
FT_Face ft_face = ftfont_info->ft_size->face;
@ -1466,10 +1473,10 @@ ftfont_anchor_point (struct font *font, unsigned int code, int index, int *x, in
return -1;
if (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
return -1;
if (index >= ft_face->glyph->outline.n_points)
if (idx >= ft_face->glyph->outline.n_points)
return -1;
*x = ft_face->glyph->outline.points[index].x;
*y = ft_face->glyph->outline.points[index].y;
*x = ft_face->glyph->outline.points[idx].x;
*y = ft_face->glyph->outline.points[idx].y;
return 0;
}

View file

@ -586,7 +586,7 @@ split_interval_left (INTERVAL interval, EMACS_INT offset)
Don't use this function on an interval which is the child
of another interval! */
int
static int
interval_start_pos (INTERVAL source)
{
Lisp_Object parent;
@ -2559,4 +2559,3 @@ set_intervals_multibyte (int multi_flag)
set_intervals_multibyte_1 (BUF_INTERVALS (current_buffer), multi_flag,
BEG, BEG_BYTE, Z, Z_BYTE);
}

View file

@ -161,8 +161,13 @@ struct interval
(INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0)
/* Abort if interval I's size is negative. */
#define CHECK_TOTAL_LENGTH(i) \
if ((int) (i)->total_length < 0) abort (); else
#define CHECK_TOTAL_LENGTH(i) \
do \
{ \
if ((int) (i)->total_length < 0) \
abort (); \
} \
while (0)
/* Reset this interval to its vanilla, or no-property state. */
#define RESET_INTERVAL(i) \
@ -339,4 +344,3 @@ extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop,
extern void syms_of_textprop (void);
#include "composite.h"

View file

@ -3233,7 +3233,11 @@ extern void syms_of_process (void);
extern void setup_process_coding_systems (Lisp_Object);
EXFUN (Fcall_process, MANY);
extern int child_setup (int, int, int, char **, int, Lisp_Object);
extern int child_setup (int, int, int, char **, int, Lisp_Object)
#ifndef DOS_NT
NO_RETURN
#endif
;
extern void init_callproc_1 (void);
extern void init_callproc (void);
extern void set_initial_environment (void);
@ -3598,7 +3602,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
else \
{ \
buf = (type) xmalloc (size); \
sa_must_free++; \
sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, \
make_save_value (buf, 0)); \
} \
@ -3628,7 +3632,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
buf = (Lisp_Object *) xmalloc (size_); \
arg_ = make_save_value (buf, nelt); \
XSAVE_VALUE (arg_)->dogc = 1; \
sa_must_free++; \
sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, arg_); \
} \
} while (0)

View file

@ -159,9 +159,6 @@ extern Lisp_Object QCfilter;
#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial))
#define SERIALCONN1_P(p) (EQ ((p)->type, Qserial))
/* Define first descriptor number available for subprocesses. */
#define FIRST_PROC_DESC 3
#ifndef HAVE_H_ERRNO
extern int h_errno;
#endif
@ -278,10 +275,6 @@ static SELECT_TYPE connect_wait_mask;
/* Number of bits set in connect_wait_mask. */
static int num_pending_connects;
#define IF_NON_BLOCKING_CONNECT(s) s
#else /* NON_BLOCKING_CONNECT */
#define IF_NON_BLOCKING_CONNECT(s)
#endif /* NON_BLOCKING_CONNECT */
/* The largest descriptor currently in use for a process object. */
@ -1250,8 +1243,8 @@ Returns nil if format of ADDRESS is invalid. */)
static Lisp_Object
list_processes_1 (Lisp_Object query_only)
{
register Lisp_Object tail, tem;
Lisp_Object proc, minspace, tem1;
register Lisp_Object tail;
Lisp_Object proc, minspace;
register struct Lisp_Process *p;
char tembuf[300];
int w_proc, w_buffer, w_tty;
@ -1453,10 +1446,10 @@ list_processes_1 (Lisp_Object query_only)
}
else
{
tem = p->command;
Lisp_Object tem = p->command;
while (1)
{
tem1 = Fcar (tem);
Lisp_Object tem1 = Fcar (tem);
if (NILP (tem1))
break;
Finsert (1, &tem1);
@ -1919,8 +1912,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
/* child_setup must clobber environ on systems with true vfork.
Protect it from permanent change. */
char **save_environ = environ;
current_dir = ENCODE_FILE (current_dir);
volatile Lisp_Object encoded_current_dir = ENCODE_FILE (current_dir);
#ifndef WINDOWSNT
pid = vfork ();
@ -2061,13 +2053,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
child_setup_tty (xforkout);
#ifdef WINDOWSNT
pid = child_setup (xforkin, xforkout, xforkout,
new_argv, 1, current_dir);
new_argv, 1, encoded_current_dir);
#else /* not WINDOWSNT */
#ifdef FD_CLOEXEC
emacs_close (wait_child_setup[0]);
#endif
child_setup (xforkin, xforkout, xforkout,
new_argv, 1, current_dir);
new_argv, 1, encoded_current_dir);
#endif /* not WINDOWSNT */
}
environ = save_environ;
@ -3403,7 +3395,9 @@ usage: (make-network-process &rest ARGS) */)
{
int optn, optbits;
#ifdef WINDOWSNT
retry_connect:
#endif
s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
if (s < 0)
@ -3467,7 +3461,7 @@ usage: (make-network-process &rest ARGS) */)
if (EQ (service, Qt))
{
struct sockaddr_in sa1;
int len1 = sizeof (sa1);
socklen_t len1 = sizeof (sa1);
if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
{
((struct sockaddr_in *)(lres->ai_addr))->sin_port = sa1.sin_port;
@ -3514,7 +3508,8 @@ usage: (make-network-process &rest ARGS) */)
/* Unlike most other syscalls connect() cannot be called
again. (That would return EALREADY.) The proper way to
wait for completion is select(). */
int sc, len;
int sc;
socklen_t len;
SELECT_TYPE fdset;
retry_select:
FD_ZERO (&fdset);
@ -3587,7 +3582,7 @@ usage: (make-network-process &rest ARGS) */)
if (!is_server)
{
struct sockaddr_in sa1;
int len1 = sizeof (sa1);
socklen_t len1 = sizeof (sa1);
if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
contact = Fplist_put (contact, QClocal,
conv_sockaddr_to_lisp ((struct sockaddr *)&sa1, len1));
@ -3705,10 +3700,10 @@ usage: (make-network-process &rest ARGS) */)
{
/* Setup coding systems for communicating with the network stream. */
struct gcpro gcpro1;
struct gcpro inner_gcpro1;
/* Qt denotes we have not yet called Ffind_operation_coding_system. */
Lisp_Object coding_systems = Qt;
Lisp_Object args[5], val;
Lisp_Object fargs[5], val;
if (!NILP (tem))
{
@ -3731,11 +3726,11 @@ usage: (make-network-process &rest ARGS) */)
coding_systems = Qnil;
else
{
args[0] = Qopen_network_stream, args[1] = name,
args[2] = buffer, args[3] = host, args[4] = service;
GCPRO1 (proc);
coding_systems = Ffind_operation_coding_system (5, args);
UNGCPRO;
fargs[0] = Qopen_network_stream, fargs[1] = name,
fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
GCPRO1_VAR (proc, inner_gcpro);
coding_systems = Ffind_operation_coding_system (5, fargs);
UNGCPRO_VAR (inner_gcpro);
}
if (CONSP (coding_systems))
val = XCAR (coding_systems);
@ -3764,11 +3759,11 @@ usage: (make-network-process &rest ARGS) */)
coding_systems = Qnil;
else
{
args[0] = Qopen_network_stream, args[1] = name,
args[2] = buffer, args[3] = host, args[4] = service;
GCPRO1 (proc);
coding_systems = Ffind_operation_coding_system (5, args);
UNGCPRO;
fargs[0] = Qopen_network_stream, fargs[1] = name,
fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
GCPRO1_VAR (proc, inner_gcpro);
coding_systems = Ffind_operation_coding_system (5, fargs);
UNGCPRO_VAR (inner_gcpro);
}
}
if (CONSP (coding_systems))
@ -3948,7 +3943,7 @@ FLAGS is the current flags of the interface. */)
CHECK_STRING (ifname);
memset (rq.ifr_name, 0, sizeof rq.ifr_name);
strncpy (rq.ifr_name, SDATA (ifname), sizeof (rq.ifr_name));
strncpy (rq.ifr_name, SSDATA (ifname), sizeof (rq.ifr_name));
s = socket (AF_INET, SOCK_STREAM, 0);
if (s < 0)
@ -4192,7 +4187,7 @@ server_accept_connection (Lisp_Object server, int channel)
struct sockaddr_un un;
#endif
} saddr;
int len = sizeof saddr;
socklen_t len = sizeof saddr;
s = accept (channel, &saddr.sa, &len);
@ -4928,8 +4923,6 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
d->func (channel, d->data, 0);
}
/* Really FIRST_PROC_DESC should be 0 on Unix,
but this is safer in the short run. */
for (channel = 0; channel <= max_process_desc; channel++)
{
if (FD_ISSET (channel, &Available)
@ -5059,7 +5052,7 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
/* getsockopt(,,SO_ERROR,,) is said to hang on some systems.
So only use it on systems where it is known to work. */
{
int xlen = sizeof (xerrno);
socklen_t xlen = sizeof (xerrno);
if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
xerrno = errno;
}
@ -5128,9 +5121,9 @@ read_process_output_call (Lisp_Object fun_and_args)
}
static Lisp_Object
read_process_output_error_handler (Lisp_Object error)
read_process_output_error_handler (Lisp_Object error_val)
{
cmd_error_internal (error, "error in process filter: ");
cmd_error_internal (error_val, "error in process filter: ");
Vinhibit_quit = Qt;
update_echo_area ();
Fsleep_for (make_number (2), Qnil);
@ -5171,7 +5164,7 @@ read_process_output (Lisp_Object proc, register int channel)
/* We have a working select, so proc_buffered_char is always -1. */
if (DATAGRAM_CHAN_P (channel))
{
int len = datagram_address[channel].len;
socklen_t len = datagram_address[channel].len;
nbytes = recvfrom (channel, chars + carryover, readmax,
0, datagram_address[channel].sa, &len);
}
@ -5925,7 +5918,7 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
if (sig_char && *sig_char != CDISABLE)
{
send_process (proc, sig_char, 1, Qnil);
send_process (proc, (char *) sig_char, 1, Qnil);
return;
}
/* If we can't send the signal with a character,
@ -6534,9 +6527,9 @@ exec_sentinel_unwind (Lisp_Object data)
}
static Lisp_Object
exec_sentinel_error_handler (Lisp_Object error)
exec_sentinel_error_handler (Lisp_Object error_val)
{
cmd_error_internal (error, "error in process sentinel: ");
cmd_error_internal (error_val, "error in process sentinel: ");
Vinhibit_quit = Qt;
update_echo_area ();
Fsleep_for (make_number (2), Qnil);

View file

@ -290,37 +290,37 @@ move_cache_gap (struct region_cache *c, EMACS_INT pos, EMACS_INT min_size)
}
/* Insert a new boundary in cache C; it will have cache index INDEX,
/* Insert a new boundary in cache C; it will have cache index I,
and have the specified POS and VALUE. */
static void
insert_cache_boundary (struct region_cache *c, EMACS_INT index, EMACS_INT pos,
insert_cache_boundary (struct region_cache *c, EMACS_INT i, EMACS_INT pos,
int value)
{
/* index must be a valid cache index. */
if (index < 0 || index > c->cache_len)
/* i must be a valid cache index. */
if (i < 0 || i > c->cache_len)
abort ();
/* We must never want to insert something before the dummy first
boundary. */
if (index == 0)
if (i == 0)
abort ();
/* We must only be inserting things in order. */
if (! (BOUNDARY_POS (c, index-1) < pos
&& (index == c->cache_len
|| pos < BOUNDARY_POS (c, index))))
if (! (BOUNDARY_POS (c, i - 1) < pos
&& (i == c->cache_len
|| pos < BOUNDARY_POS (c, i))))
abort ();
/* The value must be different from the ones around it. However, we
temporarily create boundaries that establish the same value as
the subsequent boundary, so we're not going to flag that case. */
if (BOUNDARY_VALUE (c, index-1) == value)
if (BOUNDARY_VALUE (c, i - 1) == value)
abort ();
move_cache_gap (c, index, 1);
move_cache_gap (c, i, 1);
c->boundaries[index].pos = pos - c->buffer_beg;
c->boundaries[index].value = value;
c->boundaries[i].pos = pos - c->buffer_beg;
c->boundaries[i].value = value;
c->gap_start++;
c->gap_len--;
c->cache_len++;
@ -808,4 +808,3 @@ pp_cache (struct region_cache *c)
fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i));
}
}

View file

@ -111,3 +111,5 @@ extern int region_cache_backward (struct buffer *BUF,
EMACS_INT POS,
EMACS_INT *NEXT);
/* For debugging. */
void pp_cache (struct region_cache *);

View file

@ -245,8 +245,8 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, struct m
int i, j, k;
/* Set to 1 if we have set a terminal window with
set_terminal_window. */
int terminal_window_p = 0;
set_terminal_window. It's unsigned to work around GCC bug 48228. */
unsigned int terminal_window_p = 0;
/* A queue for line insertions to be done. */
struct queue { int count, pos; };

View file

@ -595,12 +595,12 @@ wav_play (struct sound *s, struct sound_device *sd)
files I found so far. If someone feels inclined to implement the
whole RIFF-WAVE spec, please do. */
if (STRINGP (s->data))
sd->write (sd, SDATA (s->data) + sizeof *header,
sd->write (sd, SSDATA (s->data) + sizeof *header,
SBYTES (s->data) - sizeof *header);
else
{
char *buffer;
int nbytes;
int nbytes = 0;
int blksize = sd->period_size ? sd->period_size (sd) : 2048;
int data_left = header->data_length;
@ -686,7 +686,7 @@ au_play (struct sound *s, struct sound_device *sd)
sd->configure (sd);
if (STRINGP (s->data))
sd->write (sd, SDATA (s->data) + header->data_offset,
sd->write (sd, SSDATA (s->data) + header->data_offset,
SBYTES (s->data) - header->data_offset);
else
{
@ -1104,7 +1104,6 @@ alsa_close (struct sound_device *sd)
static void
alsa_choose_format (struct sound_device *sd, struct sound *s)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
if (s->type == RIFF)
{
struct wav_header *h = (struct wav_header *) s->header;
@ -1410,7 +1409,7 @@ Internal use only, use `play-sound' instead. */)
{
int len = SCHARS (attrs[SOUND_DEVICE]);
current_sound_device->file = (char *) alloca (len + 1);
strcpy (current_sound_device->file, SDATA (attrs[SOUND_DEVICE]));
strcpy (current_sound_device->file, SSDATA (attrs[SOUND_DEVICE]));
}
if (INTEGERP (attrs[SOUND_VOLUME]))
@ -1498,4 +1497,3 @@ init_sound (void)
}
#endif /* HAVE_SOUND */

View file

@ -488,7 +488,8 @@ sys_subshell (void)
int pid;
struct save_signal saved_handlers[5];
Lisp_Object dir;
unsigned char * IF_LINT (volatile) str = 0;
unsigned char *volatile str_volatile = 0;
unsigned char *str;
int len;
saved_handlers[0].code = SIGINT;
@ -512,7 +513,7 @@ sys_subshell (void)
goto xyzzy;
dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
str = (unsigned char *) alloca (SCHARS (dir) + 2);
str_volatile = str = (unsigned char *) alloca (SCHARS (dir) + 2);
len = SCHARS (dir);
memcpy (str, SDATA (dir), len);
if (str[len - 1] != '/') str[len++] = '/';
@ -544,6 +545,7 @@ sys_subshell (void)
sh = "sh";
/* Use our buffer's default directory for the subshell. */
str = str_volatile;
if (str && chdir ((char *) str) != 0)
{
#ifndef DOS_NT

View file

@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "tparam.h"
#include <setjmp.h>
#include "lisp.h"
@ -33,18 +35,19 @@ char *UP, *BC, PC;
format is different too.
*/
extern char *tparm (const char *str, ...);
char *
tparam (char *string, char *outstring,
int len, int arg1, int arg2, int arg3, int arg4,
int arg5, int arg6, int arg7, int arg8, int arg9)
tparam (const char *string, char *outstring, int len,
int arg1, int arg2, int arg3, int arg4)
{
char *temp;
extern char *tparm (char *str, ...);
temp = tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
if (outstring == 0)
outstring = ((char *) (xmalloc ((strlen (temp)) + 1)));
strcpy (outstring, temp);
return outstring;
/* Emacs always should pass a null OUTSTRING and zero LEN. */
if (outstring || len)
abort ();
temp = tparm (string, arg1, arg2, arg3, arg4);
return xstrdup (temp);
}

View file

@ -974,37 +974,6 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
return make_number (next->position);
}
/* Return 1 if there's a change in some property between BEG and END. */
int
property_change_between_p (EMACS_INT beg, EMACS_INT end)
{
register INTERVAL i, next;
Lisp_Object object, pos;
XSETBUFFER (object, current_buffer);
XSETFASTINT (pos, beg);
i = validate_interval_range (object, &pos, &pos, soft);
if (NULL_INTERVAL_P (i))
return 0;
next = next_interval (i);
while (! NULL_INTERVAL_P (next) && intervals_equal (i, next))
{
next = next_interval (next);
if (NULL_INTERVAL_P (next))
return 0;
if (next->position >= end)
return 0;
}
if (NULL_INTERVAL_P (next))
return 0;
return 1;
}
DEFUN ("next-single-property-change", Fnext_single_property_change,
Snext_single_property_change, 2, 4, 0,
doc: /* Return the position of next property change for a specific property.
@ -2331,4 +2300,3 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and
/* defsubr (&Serase_text_properties); */
/* defsubr (&Scopy_text_properties); */
}

View file

@ -29,3 +29,7 @@ char *tgetstr (const char *, char **);
char *tgoto (const char *, int, int);
char *tparam (const char *, char *, int, int, int, int, int);
extern char PC;
extern char *BC;
extern char *UP;

View file

@ -802,8 +802,8 @@ static int cursor_row_fully_visible_p (struct window *, int, int);
static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int);
static int try_cursor_movement (Lisp_Object, struct text_pos, int *);
static int trailing_whitespace_p (EMACS_INT);
static int message_log_check_duplicate (EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT);
static unsigned long int message_log_check_duplicate (EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT);
static void push_it (struct it *);
static void pop_it (struct it *);
static void sync_frame_with_window_matrix_rows (struct window *);
@ -7973,7 +7973,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
if (nlflag)
{
EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte;
int dups;
unsigned long int dups;
insert_1 ("\n", 1, 1, 0, 0);
scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0);
@ -8001,7 +8001,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
/* If you change this format, don't forget to also
change message_log_check_duplicate. */
sprintf (dupstr, " [%d times]", dups);
sprintf (dupstr, " [%lu times]", dups);
duplen = strlen (dupstr);
TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1);
insert_1 (dupstr, duplen, 1, 0, 1);
@ -8063,7 +8063,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
Return 0 if different, 1 if the new one should just replace it, or a
value N > 1 if we should also append " [N times]". */
static int
static unsigned long int
message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte,
EMACS_INT this_bol, EMACS_INT this_bol_byte)
{
@ -8085,10 +8085,9 @@ message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte,
return 2;
if (*p1++ == ' ' && *p1++ == '[')
{
int n = 0;
while (*p1 >= '0' && *p1 <= '9')
n = n * 10 + *p1++ - '0';
if (strncmp ((char *) p1, " times]\n", 8) == 0)
char *pend;
unsigned long int n = strtoul ((char *) p1, &pend, 10);
if (strncmp (pend, " times]\n", 8) == 0)
return n+1;
}
return 0;
@ -19007,7 +19006,7 @@ pint2str (register char *buf, register int width, register EMACS_INT d)
static const char power_letter[] =
{
0, /* not used */
0, /* no letter */
'k', /* kilo */
'M', /* mega */
'G', /* giga */
@ -19089,8 +19088,7 @@ pint2hrstr (char *buf, int width, int d)
p = psuffix = buf + max (width, length);
/* Print EXPONENT. */
if (exponent)
*psuffix++ = power_letter[exponent];
*psuffix++ = power_letter[exponent];
*psuffix = '\0';
/* Print TENTHS. */

View file

@ -629,7 +629,7 @@ xfont_list_family (Lisp_Object frame)
char **names;
int num_fonts, i;
Lisp_Object list;
char *last_family;
char *last_family IF_LINT (= 0);
int last_len;
BLOCK_INPUT;

View file

@ -280,7 +280,7 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
FcResult result;
Display *display = FRAME_X_DISPLAY (f);
Lisp_Object val, filename, index, font_object;
Lisp_Object val, filename, idx, font_object;
FcPattern *pat = NULL, *match;
struct xftfont_info *xftfont_info = NULL;
struct font *font;
@ -298,7 +298,7 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
return Qnil;
val = XCDR (val);
filename = XCAR (val);
index = XCDR (val);
idx = XCDR (val);
size = XINT (AREF (entity, FONT_SIZE_INDEX));
if (size == 0)
size = pixel_size;
@ -335,7 +335,7 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
xftfont_add_rendering_parameters (pat, entity);
FcPatternAddString (pat, FC_FILE, (FcChar8 *) SDATA (filename));
FcPatternAddInteger (pat, FC_INDEX, XINT (index));
FcPatternAddInteger (pat, FC_INDEX, XINT (idx));
BLOCK_INPUT;
@ -409,9 +409,9 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
spacing = FC_PROPORTIONAL;
if (! ascii_printable[0])
{
int i;
for (i = 0; i < 95; i++)
ascii_printable[i] = ' ' + i;
int ch;
for (ch = 0; ch < 95; ch++)
ascii_printable[ch] = ' ' + ch;
}
BLOCK_INPUT;
if (spacing != FC_PROPORTIONAL
@ -672,7 +672,8 @@ xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_b
return len;
}
Lisp_Object
#if defined HAVE_M17N_FLT && defined HAVE_LIBOTF
static Lisp_Object
xftfont_shape (Lisp_Object lgstring)
{
struct font *font;
@ -688,6 +689,7 @@ xftfont_shape (Lisp_Object lgstring)
XftUnlockFace (xftfont_info->xftfont);
return val;
}
#endif
static int
xftfont_end_for_frame (FRAME_PTR f)

View file

@ -922,7 +922,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
#endif
Lisp_Object items;
widget_value *wv, *first_wv, *prev_wv = 0;
int i, last_i = 0;
EMACS_UINT i, last_i = 0;
int *submenu_start, *submenu_end;
int *submenu_top_level_items, *submenu_n_panes;

View file

@ -28,7 +28,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "buffer.h"
Lisp_Object make_dom (xmlNode *node)
static Lisp_Object
make_dom (xmlNode *node)
{
if (node->type == XML_ELEMENT_NODE)
{