emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104021: Merge fixes for aliasing bug


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104021: Merge fixes for aliasing bug, string-to-float bug, etc.
Date: Tue, 26 Apr 2011 12:59:54 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104021 [merge]
fixes bug(s): http://debbugs.gnu.org/8546 http://debbugs.gnu.org/8525
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2011-04-26 12:59:54 -0700
message:
  Merge fixes for aliasing bug, string-to-float bug, etc.
added:
  lib/inttypes.in.h
  lib/strtoimax.c
  lib/strtol.c
  lib/strtoul.c
  lib/strtoull.c
  lib/strtoumax.c
  lib/verify.h
  m4/inttypes.m4
  m4/strtoull.m4
  m4/strtoumax.m4
modified:
  .bzrignore
  ChangeLog
  Makefile.in
  configure.in
  lib/gnulib.mk
  m4/gl-comp.m4
  src/ChangeLog
  src/alloc.c
  src/bidi.c
  src/buffer.c
  src/buffer.h
  src/bytecode.c
  src/callint.c
  src/ccl.c
  src/character.c
  src/charset.c
  src/chartab.c
  src/coding.c
  src/composite.c
  src/data.c
  src/dbusbind.c
  src/dispnew.c
  src/disptab.h
  src/doc.c
  src/fns.c
  src/font.c
  src/font.h
  src/frame.c
  src/frame.h
  src/fringe.c
  src/gnutls.c
  src/gtkutil.c
  src/image.c
  src/indent.c
  src/intervals.c
  src/intervals.h
  src/keyboard.c
  src/keymap.c
  src/lisp.h
  src/lread.c
  src/m/amdx86-64.h
  src/m/ia64.h
  src/m/ibms390x.h
  src/minibuf.c
  src/print.c
  src/process.c
  src/process.h
  src/region-cache.c
  src/syntax.c
  src/sysdep.c
  src/termhooks.h
  src/textprop.c
  src/w32font.c
  src/w32menu.c
  src/window.c
  src/window.h
  src/xdisp.c
  src/xfaces.c
  src/xfns.c
  src/xmenu.c
  src/xrdb.c
  src/xselect.c
=== modified file '.bzrignore'
--- a/.bzrignore        2011-04-06 02:13:16 +0000
+++ b/.bzrignore        2011-04-22 07:34:26 +0000
@@ -50,6 +50,7 @@
 lib/arg-nonnull.h
 lib/c++defs.h
 lib/getopt.h
+lib/inttypes.h
 lib/stdio.h
 lib/stdlib.h
 lib/sys/

=== modified file 'ChangeLog'
--- a/ChangeLog 2011-04-25 01:30:05 +0000
+++ b/ChangeLog 2011-04-26 06:17:52 +0000
@@ -1,3 +1,19 @@
+2011-04-26  Paul Eggert  <address@hidden>
+
+       * configure.in: Suppress unnecessary checks for size_t.
+       (AC_TYPE_SIZE_T): Define an empty macro, to suppress obsolescent test.
+       (size_t): Do not check for this, and do not typedef.  This code
+       is never exercised now.
+
+       * Makefile.in (GNULIB_MODULES): Add strtoumax.
+       This is needed for the new integer-reading code in lread.c.
+       It automatically pulls in the following gnulib files, which
+       are used on old-fashioned platforms that don't have strtoumax:
+       lib/inttypes.in.h, lib/strtoimax.c, lib/strtol.c, lib/strtoul.c,
+       lib/strtoull.c, lib/strtoumax.c, lib/verify.h, m4/inttypes.m4,
+       m4/strtoull.m4, m4/strtoumax.m4.
+       * .bzrignore: Add lib/inttypes.h.
+
 2011-04-24  Teodor Zlatanov  <address@hidden>
 
        * configure.in: Check for GnuTLS certificate verify callbacks.

=== modified file 'Makefile.in'
--- a/Makefile.in       2011-04-20 17:23:30 +0000
+++ b/Makefile.in       2011-04-26 06:17:52 +0000
@@ -333,7 +333,7 @@
 GNULIB_MODULES = \
   careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu \
   ignore-value intprops lstat mktime readlink \
-  socklen stdio strftime symlink sys_stat
+  socklen stdio strftime strtoumax symlink sys_stat
 GNULIB_TOOL_FLAGS = \
  --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
 sync-from-gnulib: $(gnulib_srcdir)

=== modified file 'configure.in'
--- a/configure.in      2011-04-25 01:30:05 +0000
+++ b/configure.in      2011-04-26 06:17:52 +0000
@@ -987,6 +987,9 @@
   CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
 fi
 
+# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better.
+AC_DEFUN([AC_TYPE_SIZE_T])
+
 dnl Do this early because it can frob feature test macros for Unix-98 &c.
 AC_SYS_LARGEFILE
 
@@ -3036,8 +3039,6 @@
     [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
 fi
 
-AC_CHECK_TYPES(size_t)
-
 AC_TYPE_MBSTATE_T
 
 AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr,
@@ -3563,10 +3564,6 @@
 void *alloca (size_t);
 #endif
 
-#ifndef HAVE_SIZE_T
-typedef unsigned size_t;
-#endif
-
 #ifndef HAVE_STRCHR
 #define strchr(a, b) index (a, b)
 #endif

=== modified file 'lib/gnulib.mk'
--- a/lib/gnulib.mk     2011-04-18 04:03:18 +0000
+++ b/lib/gnulib.mk     2011-04-26 19:29:47 +0000
@@ -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 
careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value 
intprops lstat mktime readlink socklen stdio 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 
careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value 
intprops lstat mktime readlink socklen stdio strftime strtoumax symlink sys_stat
 
 
 MOSTLYCLEANFILES += core *.stackdump
@@ -174,6 +174,48 @@
 
 ## end   gnulib module intprops
 
+## begin gnulib module inttypes-incomplete
+
+BUILT_SOURCES += inttypes.h
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) 
$(ARG_NONNULL_H)
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+             -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_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+             -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
+             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+             -e 
's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+             -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+             -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \
+             -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \
+             -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \
+             -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \
+             -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+             -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+             -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+             -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+             -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' 
\
+             -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+             -e 
's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+             -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' 
\
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/inttypes.in.h; \
+       } > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+
+EXTRA_DIST += inttypes.in.h
+
+## end   gnulib module inttypes-incomplete
+
 ## begin gnulib module lstat
 
 
@@ -532,6 +574,24 @@
 
 ## end   gnulib module strftime
 
+## begin gnulib module strtoull
+
+
+EXTRA_DIST += strtol.c strtoul.c strtoull.c
+
+EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c
+
+## end   gnulib module strtoull
+
+## begin gnulib module strtoumax
+
+
+EXTRA_DIST += strtoimax.c strtoumax.c
+
+EXTRA_libgnu_a_SOURCES += strtoimax.c strtoumax.c
+
+## end   gnulib module strtoumax
+
 ## begin gnulib module symlink
 
 
@@ -785,6 +845,12 @@
 
 ## end   gnulib module unistd
 
+## begin gnulib module verify
+
+libgnu_a_SOURCES += verify.h
+
+## end   gnulib module verify
+
 ## begin gnulib module warn-on-use
 
 BUILT_SOURCES += warn-on-use.h

=== added file 'lib/inttypes.in.h'
--- a/lib/inttypes.in.h 1970-01-01 00:00:00 +0000
+++ b/lib/inttypes.in.h 2011-04-22 23:53:21 +0000
@@ -0,0 +1,1110 @@
+/* Copyright (C) 2006-2011 Free Software Foundation, Inc.
+   Written by Paul Eggert, Bruno Haible, Derek Price.
+   This file is part of gnulib.
+
+   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 <http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
+ */
+
+#if __GNUC__ >= 3
address@hidden@
+#endif
address@hidden@
+
+/* Include the original <inttypes.h> if it exists, and if this file
+   has not been included yet or if this file includes gnulib stdint.h
+   which in turn includes this file.
+   The include_next requires a split double-inclusion guard.  */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+#  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define INTTYPES_H
+
+/* Include <stdint.h> or the gnulib replacement.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stdint.h>
+#endif
+/* Get CHAR_BIT.  */
+#include <limits.h>
+
+#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
+# error "This file assumes that 'int' has exactly 32 bits. Please report your 
platform and compiler to <address@hidden>."
+#endif
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* 7.8.1 Macros for format specifiers */
+
+#if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
+
+# if defined _TNS_R_TARGET
+   /* Tandem NonStop R series and compatible platforms released before
+      July 2005 support %Ld but not %lld.  */
+#  define _LONG_LONG_FORMAT_PREFIX "L"
+# else
+#  define _LONG_LONG_FORMAT_PREFIX "ll"
+# endif
+
+# if !defined PRId8 || @PRI_MACROS_BROKEN@
+#  undef PRId8
+#  ifdef INT8_MAX
+#   define PRId8 "d"
+#  endif
+# endif
+# if !defined PRIi8 || @PRI_MACROS_BROKEN@
+#  undef PRIi8
+#  ifdef INT8_MAX
+#   define PRIi8 "i"
+#  endif
+# endif
+# if !defined PRIo8 || @PRI_MACROS_BROKEN@
+#  undef PRIo8
+#  ifdef UINT8_MAX
+#   define PRIo8 "o"
+#  endif
+# endif
+# if !defined PRIu8 || @PRI_MACROS_BROKEN@
+#  undef PRIu8
+#  ifdef UINT8_MAX
+#   define PRIu8 "u"
+#  endif
+# endif
+# if !defined PRIx8 || @PRI_MACROS_BROKEN@
+#  undef PRIx8
+#  ifdef UINT8_MAX
+#   define PRIx8 "x"
+#  endif
+# endif
+# if !defined PRIX8 || @PRI_MACROS_BROKEN@
+#  undef PRIX8
+#  ifdef UINT8_MAX
+#   define PRIX8 "X"
+#  endif
+# endif
+# if !defined PRId16 || @PRI_MACROS_BROKEN@
+#  undef PRId16
+#  ifdef INT16_MAX
+#   define PRId16 "d"
+#  endif
+# endif
+# if !defined PRIi16 || @PRI_MACROS_BROKEN@
+#  undef PRIi16
+#  ifdef INT16_MAX
+#   define PRIi16 "i"
+#  endif
+# endif
+# if !defined PRIo16 || @PRI_MACROS_BROKEN@
+#  undef PRIo16
+#  ifdef UINT16_MAX
+#   define PRIo16 "o"
+#  endif
+# endif
+# if !defined PRIu16 || @PRI_MACROS_BROKEN@
+#  undef PRIu16
+#  ifdef UINT16_MAX
+#   define PRIu16 "u"
+#  endif
+# endif
+# if !defined PRIx16 || @PRI_MACROS_BROKEN@
+#  undef PRIx16
+#  ifdef UINT16_MAX
+#   define PRIx16 "x"
+#  endif
+# endif
+# if !defined PRIX16 || @PRI_MACROS_BROKEN@
+#  undef PRIX16
+#  ifdef UINT16_MAX
+#   define PRIX16 "X"
+#  endif
+# endif
+# if !defined PRId32 || @PRI_MACROS_BROKEN@
+#  undef PRId32
+#  ifdef INT32_MAX
+#   define PRId32 "d"
+#  endif
+# endif
+# if !defined PRIi32 || @PRI_MACROS_BROKEN@
+#  undef PRIi32
+#  ifdef INT32_MAX
+#   define PRIi32 "i"
+#  endif
+# endif
+# if !defined PRIo32 || @PRI_MACROS_BROKEN@
+#  undef PRIo32
+#  ifdef UINT32_MAX
+#   define PRIo32 "o"
+#  endif
+# endif
+# if !defined PRIu32 || @PRI_MACROS_BROKEN@
+#  undef PRIu32
+#  ifdef UINT32_MAX
+#   define PRIu32 "u"
+#  endif
+# endif
+# if !defined PRIx32 || @PRI_MACROS_BROKEN@
+#  undef PRIx32
+#  ifdef UINT32_MAX
+#   define PRIx32 "x"
+#  endif
+# endif
+# if !defined PRIX32 || @PRI_MACROS_BROKEN@
+#  undef PRIX32
+#  ifdef UINT32_MAX
+#   define PRIX32 "X"
+#  endif
+# endif
+# ifdef INT64_MAX
+#  if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+#   define _PRI64_PREFIX "l"
+#  elif defined _MSC_VER || defined __MINGW32__
+#   define _PRI64_PREFIX "I64"
+#  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#   define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
+#  endif
+#  if !defined PRId64 || @PRI_MACROS_BROKEN@
+#   undef PRId64
+#   define PRId64 _PRI64_PREFIX "d"
+#  endif
+#  if !defined PRIi64 || @PRI_MACROS_BROKEN@
+#   undef PRIi64
+#   define PRIi64 _PRI64_PREFIX "i"
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+#   define _PRIu64_PREFIX "l"
+#  elif defined _MSC_VER || defined __MINGW32__
+#   define _PRIu64_PREFIX "I64"
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+#  endif
+#  if !defined PRIo64 || @PRI_MACROS_BROKEN@
+#   undef PRIo64
+#   define PRIo64 _PRIu64_PREFIX "o"
+#  endif
+#  if !defined PRIu64 || @PRI_MACROS_BROKEN@
+#   undef PRIu64
+#   define PRIu64 _PRIu64_PREFIX "u"
+#  endif
+#  if !defined PRIx64 || @PRI_MACROS_BROKEN@
+#   undef PRIx64
+#   define PRIx64 _PRIu64_PREFIX "x"
+#  endif
+#  if !defined PRIX64 || @PRI_MACROS_BROKEN@
+#   undef PRIX64
+#   define PRIX64 _PRIu64_PREFIX "X"
+#  endif
+# endif
+
+# if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIdLEAST8
+#  define PRIdLEAST8 "d"
+# endif
+# if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIiLEAST8
+#  define PRIiLEAST8 "i"
+# endif
+# if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIoLEAST8
+#  define PRIoLEAST8 "o"
+# endif
+# if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIuLEAST8
+#  define PRIuLEAST8 "u"
+# endif
+# if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIxLEAST8
+#  define PRIxLEAST8 "x"
+# endif
+# if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIXLEAST8
+#  define PRIXLEAST8 "X"
+# endif
+# if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIdLEAST16
+#  define PRIdLEAST16 "d"
+# endif
+# if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIiLEAST16
+#  define PRIiLEAST16 "i"
+# endif
+# if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIoLEAST16
+#  define PRIoLEAST16 "o"
+# endif
+# if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIuLEAST16
+#  define PRIuLEAST16 "u"
+# endif
+# if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIxLEAST16
+#  define PRIxLEAST16 "x"
+# endif
+# if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIXLEAST16
+#  define PRIXLEAST16 "X"
+# endif
+# if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIdLEAST32
+#  define PRIdLEAST32 "d"
+# endif
+# if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIiLEAST32
+#  define PRIiLEAST32 "i"
+# endif
+# if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIoLEAST32
+#  define PRIoLEAST32 "o"
+# endif
+# if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIuLEAST32
+#  define PRIuLEAST32 "u"
+# endif
+# if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIxLEAST32
+#  define PRIxLEAST32 "x"
+# endif
+# if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIXLEAST32
+#  define PRIXLEAST32 "X"
+# endif
+# ifdef INT64_MAX
+#  if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIdLEAST64
+#   define PRIdLEAST64 PRId64
+#  endif
+#  if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIiLEAST64
+#   define PRIiLEAST64 PRIi64
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIoLEAST64
+#   define PRIoLEAST64 PRIo64
+#  endif
+#  if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIuLEAST64
+#   define PRIuLEAST64 PRIu64
+#  endif
+#  if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIxLEAST64
+#   define PRIxLEAST64 PRIx64
+#  endif
+#  if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIXLEAST64
+#   define PRIXLEAST64 PRIX64
+#  endif
+# endif
+
+# if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIdFAST8
+#  if INT_FAST8_MAX > INT32_MAX
+#   define PRIdFAST8 PRId64
+#  else
+#   define PRIdFAST8 "d"
+#  endif
+# endif
+# if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIiFAST8
+#  if INT_FAST8_MAX > INT32_MAX
+#   define PRIiFAST8 PRIi64
+#  else
+#   define PRIiFAST8 "i"
+#  endif
+# endif
+# if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIoFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define PRIoFAST8 PRIo64
+#  else
+#   define PRIoFAST8 "o"
+#  endif
+# endif
+# if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIuFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define PRIuFAST8 PRIu64
+#  else
+#   define PRIuFAST8 "u"
+#  endif
+# endif
+# if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIxFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define PRIxFAST8 PRIx64
+#  else
+#   define PRIxFAST8 "x"
+#  endif
+# endif
+# if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
+#  undef PRIXFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define PRIXFAST8 PRIX64
+#  else
+#   define PRIXFAST8 "X"
+#  endif
+# endif
+# if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIdFAST16
+#  if INT_FAST16_MAX > INT32_MAX
+#   define PRIdFAST16 PRId64
+#  else
+#   define PRIdFAST16 "d"
+#  endif
+# endif
+# if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIiFAST16
+#  if INT_FAST16_MAX > INT32_MAX
+#   define PRIiFAST16 PRIi64
+#  else
+#   define PRIiFAST16 "i"
+#  endif
+# endif
+# if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIoFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define PRIoFAST16 PRIo64
+#  else
+#   define PRIoFAST16 "o"
+#  endif
+# endif
+# if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIuFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define PRIuFAST16 PRIu64
+#  else
+#   define PRIuFAST16 "u"
+#  endif
+# endif
+# if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIxFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define PRIxFAST16 PRIx64
+#  else
+#   define PRIxFAST16 "x"
+#  endif
+# endif
+# if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
+#  undef PRIXFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define PRIXFAST16 PRIX64
+#  else
+#   define PRIXFAST16 "X"
+#  endif
+# endif
+# if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIdFAST32
+#  if INT_FAST32_MAX > INT32_MAX
+#   define PRIdFAST32 PRId64
+#  else
+#   define PRIdFAST32 "d"
+#  endif
+# endif
+# if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIiFAST32
+#  if INT_FAST32_MAX > INT32_MAX
+#   define PRIiFAST32 PRIi64
+#  else
+#   define PRIiFAST32 "i"
+#  endif
+# endif
+# if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIoFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define PRIoFAST32 PRIo64
+#  else
+#   define PRIoFAST32 "o"
+#  endif
+# endif
+# if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIuFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define PRIuFAST32 PRIu64
+#  else
+#   define PRIuFAST32 "u"
+#  endif
+# endif
+# if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIxFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define PRIxFAST32 PRIx64
+#  else
+#   define PRIxFAST32 "x"
+#  endif
+# endif
+# if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
+#  undef PRIXFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define PRIXFAST32 PRIX64
+#  else
+#   define PRIXFAST32 "X"
+#  endif
+# endif
+# ifdef INT64_MAX
+#  if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIdFAST64
+#   define PRIdFAST64 PRId64
+#  endif
+#  if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIiFAST64
+#   define PRIiFAST64 PRIi64
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIoFAST64
+#   define PRIoFAST64 PRIo64
+#  endif
+#  if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIuFAST64
+#   define PRIuFAST64 PRIu64
+#  endif
+#  if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIxFAST64
+#   define PRIxFAST64 PRIx64
+#  endif
+#  if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
+#   undef PRIXFAST64
+#   define PRIXFAST64 PRIX64
+#  endif
+# endif
+
+# if !defined PRIdMAX || @PRI_MACROS_BROKEN@
+#  undef PRIdMAX
+#  if @INT32_MAX_LT_INTMAX_MAX@
+#   define PRIdMAX PRId64
+#  else
+#   define PRIdMAX "ld"
+#  endif
+# endif
+# if !defined PRIiMAX || @PRI_MACROS_BROKEN@
+#  undef PRIiMAX
+#  if @INT32_MAX_LT_INTMAX_MAX@
+#   define PRIiMAX PRIi64
+#  else
+#   define PRIiMAX "li"
+#  endif
+# endif
+# if !defined PRIoMAX || @PRI_MACROS_BROKEN@
+#  undef PRIoMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define PRIoMAX PRIo64
+#  else
+#   define PRIoMAX "lo"
+#  endif
+# endif
+# if !defined PRIuMAX || @PRI_MACROS_BROKEN@
+#  undef PRIuMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define PRIuMAX PRIu64
+#  else
+#   define PRIuMAX "lu"
+#  endif
+# endif
+# if !defined PRIxMAX || @PRI_MACROS_BROKEN@
+#  undef PRIxMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define PRIxMAX PRIx64
+#  else
+#   define PRIxMAX "lx"
+#  endif
+# endif
+# if !defined PRIXMAX || @PRI_MACROS_BROKEN@
+#  undef PRIXMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define PRIXMAX PRIX64
+#  else
+#   define PRIXMAX "lX"
+#  endif
+# endif
+
+# if !defined PRIdPTR || @PRI_MACROS_BROKEN@
+#  undef PRIdPTR
+#  ifdef INTPTR_MAX
+#   define PRIdPTR @PRIPTR_PREFIX@ "d"
+#  endif
+# endif
+# if !defined PRIiPTR || @PRI_MACROS_BROKEN@
+#  undef PRIiPTR
+#  ifdef INTPTR_MAX
+#   define PRIiPTR @PRIPTR_PREFIX@ "i"
+#  endif
+# endif
+# if !defined PRIoPTR || @PRI_MACROS_BROKEN@
+#  undef PRIoPTR
+#  ifdef UINTPTR_MAX
+#   define PRIoPTR @PRIPTR_PREFIX@ "o"
+#  endif
+# endif
+# if !defined PRIuPTR || @PRI_MACROS_BROKEN@
+#  undef PRIuPTR
+#  ifdef UINTPTR_MAX
+#   define PRIuPTR @PRIPTR_PREFIX@ "u"
+#  endif
+# endif
+# if !defined PRIxPTR || @PRI_MACROS_BROKEN@
+#  undef PRIxPTR
+#  ifdef UINTPTR_MAX
+#   define PRIxPTR @PRIPTR_PREFIX@ "x"
+#  endif
+# endif
+# if !defined PRIXPTR || @PRI_MACROS_BROKEN@
+#  undef PRIXPTR
+#  ifdef UINTPTR_MAX
+#   define PRIXPTR @PRIPTR_PREFIX@ "X"
+#  endif
+# endif
+
+# if !defined SCNd8 || @PRI_MACROS_BROKEN@
+#  undef SCNd8
+#  ifdef INT8_MAX
+#   define SCNd8 "hhd"
+#  endif
+# endif
+# if !defined SCNi8 || @PRI_MACROS_BROKEN@
+#  undef SCNi8
+#  ifdef INT8_MAX
+#   define SCNi8 "hhi"
+#  endif
+# endif
+# if !defined SCNo8 || @PRI_MACROS_BROKEN@
+#  undef SCNo8
+#  ifdef UINT8_MAX
+#   define SCNo8 "hho"
+#  endif
+# endif
+# if !defined SCNu8 || @PRI_MACROS_BROKEN@
+#  undef SCNu8
+#  ifdef UINT8_MAX
+#   define SCNu8 "hhu"
+#  endif
+# endif
+# if !defined SCNx8 || @PRI_MACROS_BROKEN@
+#  undef SCNx8
+#  ifdef UINT8_MAX
+#   define SCNx8 "hhx"
+#  endif
+# endif
+# if !defined SCNd16 || @PRI_MACROS_BROKEN@
+#  undef SCNd16
+#  ifdef INT16_MAX
+#   define SCNd16 "hd"
+#  endif
+# endif
+# if !defined SCNi16 || @PRI_MACROS_BROKEN@
+#  undef SCNi16
+#  ifdef INT16_MAX
+#   define SCNi16 "hi"
+#  endif
+# endif
+# if !defined SCNo16 || @PRI_MACROS_BROKEN@
+#  undef SCNo16
+#  ifdef UINT16_MAX
+#   define SCNo16 "ho"
+#  endif
+# endif
+# if !defined SCNu16 || @PRI_MACROS_BROKEN@
+#  undef SCNu16
+#  ifdef UINT16_MAX
+#   define SCNu16 "hu"
+#  endif
+# endif
+# if !defined SCNx16 || @PRI_MACROS_BROKEN@
+#  undef SCNx16
+#  ifdef UINT16_MAX
+#   define SCNx16 "hx"
+#  endif
+# endif
+# if !defined SCNd32 || @PRI_MACROS_BROKEN@
+#  undef SCNd32
+#  ifdef INT32_MAX
+#   define SCNd32 "d"
+#  endif
+# endif
+# if !defined SCNi32 || @PRI_MACROS_BROKEN@
+#  undef SCNi32
+#  ifdef INT32_MAX
+#   define SCNi32 "i"
+#  endif
+# endif
+# if !defined SCNo32 || @PRI_MACROS_BROKEN@
+#  undef SCNo32
+#  ifdef UINT32_MAX
+#   define SCNo32 "o"
+#  endif
+# endif
+# if !defined SCNu32 || @PRI_MACROS_BROKEN@
+#  undef SCNu32
+#  ifdef UINT32_MAX
+#   define SCNu32 "u"
+#  endif
+# endif
+# if !defined SCNx32 || @PRI_MACROS_BROKEN@
+#  undef SCNx32
+#  ifdef UINT32_MAX
+#   define SCNx32 "x"
+#  endif
+# endif
+# ifdef INT64_MAX
+#  if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+#   define _SCN64_PREFIX "l"
+#  elif defined _MSC_VER || defined __MINGW32__
+#   define _SCN64_PREFIX "I64"
+#  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#   define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
+#  endif
+#  if !defined SCNd64 || @PRI_MACROS_BROKEN@
+#   undef SCNd64
+#   define SCNd64 _SCN64_PREFIX "d"
+#  endif
+#  if !defined SCNi64 || @PRI_MACROS_BROKEN@
+#   undef SCNi64
+#   define SCNi64 _SCN64_PREFIX "i"
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+#   define _SCNu64_PREFIX "l"
+#  elif defined _MSC_VER || defined __MINGW32__
+#   define _SCNu64_PREFIX "I64"
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+#  endif
+#  if !defined SCNo64 || @PRI_MACROS_BROKEN@
+#   undef SCNo64
+#   define SCNo64 _SCNu64_PREFIX "o"
+#  endif
+#  if !defined SCNu64 || @PRI_MACROS_BROKEN@
+#   undef SCNu64
+#   define SCNu64 _SCNu64_PREFIX "u"
+#  endif
+#  if !defined SCNx64 || @PRI_MACROS_BROKEN@
+#   undef SCNx64
+#   define SCNx64 _SCNu64_PREFIX "x"
+#  endif
+# endif
+
+# if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNdLEAST8
+#  define SCNdLEAST8 "hhd"
+# endif
+# if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNiLEAST8
+#  define SCNiLEAST8 "hhi"
+# endif
+# if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNoLEAST8
+#  define SCNoLEAST8 "hho"
+# endif
+# if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNuLEAST8
+#  define SCNuLEAST8 "hhu"
+# endif
+# if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNxLEAST8
+#  define SCNxLEAST8 "hhx"
+# endif
+# if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNdLEAST16
+#  define SCNdLEAST16 "hd"
+# endif
+# if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNiLEAST16
+#  define SCNiLEAST16 "hi"
+# endif
+# if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNoLEAST16
+#  define SCNoLEAST16 "ho"
+# endif
+# if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNuLEAST16
+#  define SCNuLEAST16 "hu"
+# endif
+# if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNxLEAST16
+#  define SCNxLEAST16 "hx"
+# endif
+# if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNdLEAST32
+#  define SCNdLEAST32 "d"
+# endif
+# if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNiLEAST32
+#  define SCNiLEAST32 "i"
+# endif
+# if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNoLEAST32
+#  define SCNoLEAST32 "o"
+# endif
+# if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNuLEAST32
+#  define SCNuLEAST32 "u"
+# endif
+# if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNxLEAST32
+#  define SCNxLEAST32 "x"
+# endif
+# ifdef INT64_MAX
+#  if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNdLEAST64
+#   define SCNdLEAST64 SCNd64
+#  endif
+#  if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNiLEAST64
+#   define SCNiLEAST64 SCNi64
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNoLEAST64
+#   define SCNoLEAST64 SCNo64
+#  endif
+#  if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNuLEAST64
+#   define SCNuLEAST64 SCNu64
+#  endif
+#  if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNxLEAST64
+#   define SCNxLEAST64 SCNx64
+#  endif
+# endif
+
+# if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNdFAST8
+#  if INT_FAST8_MAX > INT32_MAX
+#   define SCNdFAST8 SCNd64
+#  elif INT_FAST8_MAX == 0x7fff
+#   define SCNdFAST8 "hd"
+#  elif INT_FAST8_MAX == 0x7f
+#   define SCNdFAST8 "hhd"
+#  else
+#   define SCNdFAST8 "d"
+#  endif
+# endif
+# if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNiFAST8
+#  if INT_FAST8_MAX > INT32_MAX
+#   define SCNiFAST8 SCNi64
+#  elif INT_FAST8_MAX == 0x7fff
+#   define SCNiFAST8 "hi"
+#  elif INT_FAST8_MAX == 0x7f
+#   define SCNiFAST8 "hhi"
+#  else
+#   define SCNiFAST8 "i"
+#  endif
+# endif
+# if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNoFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define SCNoFAST8 SCNo64
+#  elif UINT_FAST8_MAX == 0xffff
+#   define SCNoFAST8 "ho"
+#  elif UINT_FAST8_MAX == 0xff
+#   define SCNoFAST8 "hho"
+#  else
+#   define SCNoFAST8 "o"
+#  endif
+# endif
+# if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNuFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define SCNuFAST8 SCNu64
+#  elif UINT_FAST8_MAX == 0xffff
+#   define SCNuFAST8 "hu"
+#  elif UINT_FAST8_MAX == 0xff
+#   define SCNuFAST8 "hhu"
+#  else
+#   define SCNuFAST8 "u"
+#  endif
+# endif
+# if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
+#  undef SCNxFAST8
+#  if UINT_FAST8_MAX > UINT32_MAX
+#   define SCNxFAST8 SCNx64
+#  elif UINT_FAST8_MAX == 0xffff
+#   define SCNxFAST8 "hx"
+#  elif UINT_FAST8_MAX == 0xff
+#   define SCNxFAST8 "hhx"
+#  else
+#   define SCNxFAST8 "x"
+#  endif
+# endif
+# if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNdFAST16
+#  if INT_FAST16_MAX > INT32_MAX
+#   define SCNdFAST16 SCNd64
+#  elif INT_FAST16_MAX == 0x7fff
+#   define SCNdFAST16 "hd"
+#  else
+#   define SCNdFAST16 "d"
+#  endif
+# endif
+# if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNiFAST16
+#  if INT_FAST16_MAX > INT32_MAX
+#   define SCNiFAST16 SCNi64
+#  elif INT_FAST16_MAX == 0x7fff
+#   define SCNiFAST16 "hi"
+#  else
+#   define SCNiFAST16 "i"
+#  endif
+# endif
+# if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNoFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define SCNoFAST16 SCNo64
+#  elif UINT_FAST16_MAX == 0xffff
+#   define SCNoFAST16 "ho"
+#  else
+#   define SCNoFAST16 "o"
+#  endif
+# endif
+# if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNuFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define SCNuFAST16 SCNu64
+#  elif UINT_FAST16_MAX == 0xffff
+#   define SCNuFAST16 "hu"
+#  else
+#   define SCNuFAST16 "u"
+#  endif
+# endif
+# if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
+#  undef SCNxFAST16
+#  if UINT_FAST16_MAX > UINT32_MAX
+#   define SCNxFAST16 SCNx64
+#  elif UINT_FAST16_MAX == 0xffff
+#   define SCNxFAST16 "hx"
+#  else
+#   define SCNxFAST16 "x"
+#  endif
+# endif
+# if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNdFAST32
+#  if INT_FAST32_MAX > INT32_MAX
+#   define SCNdFAST32 SCNd64
+#  else
+#   define SCNdFAST32 "d"
+#  endif
+# endif
+# if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNiFAST32
+#  if INT_FAST32_MAX > INT32_MAX
+#   define SCNiFAST32 SCNi64
+#  else
+#   define SCNiFAST32 "i"
+#  endif
+# endif
+# if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNoFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define SCNoFAST32 SCNo64
+#  else
+#   define SCNoFAST32 "o"
+#  endif
+# endif
+# if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNuFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define SCNuFAST32 SCNu64
+#  else
+#   define SCNuFAST32 "u"
+#  endif
+# endif
+# if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
+#  undef SCNxFAST32
+#  if UINT_FAST32_MAX > UINT32_MAX
+#   define SCNxFAST32 SCNx64
+#  else
+#   define SCNxFAST32 "x"
+#  endif
+# endif
+# ifdef INT64_MAX
+#  if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNdFAST64
+#   define SCNdFAST64 SCNd64
+#  endif
+#  if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNiFAST64
+#   define SCNiFAST64 SCNi64
+#  endif
+# endif
+# ifdef UINT64_MAX
+#  if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNoFAST64
+#   define SCNoFAST64 SCNo64
+#  endif
+#  if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNuFAST64
+#   define SCNuFAST64 SCNu64
+#  endif
+#  if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
+#   undef SCNxFAST64
+#   define SCNxFAST64 SCNx64
+#  endif
+# endif
+
+# if !defined SCNdMAX || @PRI_MACROS_BROKEN@
+#  undef SCNdMAX
+#  if @INT32_MAX_LT_INTMAX_MAX@
+#   define SCNdMAX SCNd64
+#  else
+#   define SCNdMAX "ld"
+#  endif
+# endif
+# if !defined SCNiMAX || @PRI_MACROS_BROKEN@
+#  undef SCNiMAX
+#  if @INT32_MAX_LT_INTMAX_MAX@
+#   define SCNiMAX SCNi64
+#  else
+#   define SCNiMAX "li"
+#  endif
+# endif
+# if !defined SCNoMAX || @PRI_MACROS_BROKEN@
+#  undef SCNoMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define SCNoMAX SCNo64
+#  else
+#   define SCNoMAX "lo"
+#  endif
+# endif
+# if !defined SCNuMAX || @PRI_MACROS_BROKEN@
+#  undef SCNuMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define SCNuMAX SCNu64
+#  else
+#   define SCNuMAX "lu"
+#  endif
+# endif
+# if !defined SCNxMAX || @PRI_MACROS_BROKEN@
+#  undef SCNxMAX
+#  if @UINT32_MAX_LT_UINTMAX_MAX@
+#   define SCNxMAX SCNx64
+#  else
+#   define SCNxMAX "lx"
+#  endif
+# endif
+
+# if !defined SCNdPTR || @PRI_MACROS_BROKEN@
+#  undef SCNdPTR
+#  ifdef INTPTR_MAX
+#   define SCNdPTR @PRIPTR_PREFIX@ "d"
+#  endif
+# endif
+# if !defined SCNiPTR || @PRI_MACROS_BROKEN@
+#  undef SCNiPTR
+#  ifdef INTPTR_MAX
+#   define SCNiPTR @PRIPTR_PREFIX@ "i"
+#  endif
+# endif
+# if !defined SCNoPTR || @PRI_MACROS_BROKEN@
+#  undef SCNoPTR
+#  ifdef UINTPTR_MAX
+#   define SCNoPTR @PRIPTR_PREFIX@ "o"
+#  endif
+# endif
+# if !defined SCNuPTR || @PRI_MACROS_BROKEN@
+#  undef SCNuPTR
+#  ifdef UINTPTR_MAX
+#   define SCNuPTR @PRIPTR_PREFIX@ "u"
+#  endif
+# endif
+# if !defined SCNxPTR || @PRI_MACROS_BROKEN@
+#  undef SCNxPTR
+#  ifdef UINTPTR_MAX
+#   define SCNxPTR @PRIPTR_PREFIX@ "x"
+#  endif
+# endif
+
+#endif
+
+/* 7.8.2 Functions for greatest-width integer types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @GNULIB_IMAXABS@
+# if address@hidden@
+extern intmax_t imaxabs (intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxabs
+# if HAVE_RAW_DECL_IMAXABS
+_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
+                 "use gnulib module imaxabs for portability");
+# endif
+#endif
+
+#if @GNULIB_IMAXDIV@
+# if address@hidden@
+#  if !GNULIB_defined_imaxdiv_t
+typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+#   define GNULIB_defined_imaxdiv_t 1
+#  endif
+extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxdiv
+# if HAVE_RAW_DECL_IMAXDIV
+_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
+                 "use gnulib module imaxdiv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOIMAX@
+# if address@hidden@
+#  undef strtoimax
+extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtoimax
+# if HAVE_RAW_DECL_STRTOIMAX
+_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
+                 "use gnulib module strtoimax for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUMAX@
+# if address@hidden@
+#  undef strtoumax
+extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtoumax
+# if HAVE_RAW_DECL_STRTOUMAX
+_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
+                 "use gnulib module strtoumax for portability");
+# endif
+#endif
+
+/* Don't bother defining or declaring wcstoimax and wcstoumax, since
+   wide-character functions like this are hardly ever useful.  */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */

=== added file 'lib/strtoimax.c'
--- a/lib/strtoimax.c   1970-01-01 00:00:00 +0000
+++ b/lib/strtoimax.c   2011-04-21 19:12:13 +0000
@@ -0,0 +1,75 @@
+/* Convert string representation of a number into an intmax_t value.
+
+   Copyright (C) 1999, 2001-2004, 2006, 2009-2011 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 <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+/* Verify interface.  */
+#include <inttypes.h>
+
+#include <stdlib.h>
+
+#include "verify.h"
+
+#ifdef UNSIGNED
+# ifndef HAVE_DECL_STRTOULL
+"this configure-time declaration test was not run"
+# endif
+# if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG_INT
+unsigned long long int strtoull (char const *, char **, int);
+# endif
+
+#else
+
+# ifndef HAVE_DECL_STRTOLL
+"this configure-time declaration test was not run"
+# endif
+# if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG_INT
+long long int strtoll (char const *, char **, int);
+# endif
+#endif
+
+#ifdef UNSIGNED
+# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
+# define Int uintmax_t
+# define Unsigned unsigned
+# define strtoimax strtoumax
+# define strtol strtoul
+# define strtoll strtoull
+#else
+# define Have_long_long HAVE_LONG_LONG_INT
+# define Int intmax_t
+# define Unsigned
+#endif
+
+Int
+strtoimax (char const *ptr, char **endptr, int base)
+{
+#if Have_long_long
+  verify (sizeof (Int) == sizeof (Unsigned long int)
+          || sizeof (Int) == sizeof (Unsigned long long int));
+
+  if (sizeof (Int) != sizeof (Unsigned long int))
+    return strtoll (ptr, endptr, base);
+#else
+  verify (sizeof (Int) == sizeof (Unsigned long int));
+#endif
+
+  return strtol (ptr, endptr, base);
+}

=== added file 'lib/strtol.c'
--- a/lib/strtol.c      1970-01-01 00:00:00 +0000
+++ b/lib/strtol.c      2011-04-22 07:33:37 +0000
@@ -0,0 +1,433 @@
+/* Convert string representation of a number into an integer value.
+
+   Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2011 Free Software
+   Foundation, Inc.
+
+   NOTE: The canonical source of this file is maintained with the GNU C
+   Library.  Bugs can be reported to address@hidden
+
+   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 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 <http://www.gnu.org/licenses/>.  */
+
+#ifdef _LIBC
+# define USE_NUMBER_GROUPING
+#else
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef USE_NUMBER_GROUPING
+# include "../locale/localeinfo.h"
+#endif
+
+/* Nonzero if we are defining `strtoul' or `strtoull', operating on
+   unsigned integers.  */
+#ifndef UNSIGNED
+# define UNSIGNED 0
+# define INT LONG int
+#else
+# define INT unsigned LONG int
+#endif
+
+/* Determine the name.  */
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# if UNSIGNED
+#  ifdef USE_WIDE_CHAR
+#   ifdef QUAD
+#    define strtol __wcstoull_l
+#   else
+#    define strtol __wcstoul_l
+#   endif
+#  else
+#   ifdef QUAD
+#    define strtol __strtoull_l
+#   else
+#    define strtol __strtoul_l
+#   endif
+#  endif
+# else
+#  ifdef USE_WIDE_CHAR
+#   ifdef QUAD
+#    define strtol __wcstoll_l
+#   else
+#    define strtol __wcstol_l
+#   endif
+#  else
+#   ifdef QUAD
+#    define strtol __strtoll_l
+#   else
+#    define strtol __strtol_l
+#   endif
+#  endif
+# endif
+#else
+# if UNSIGNED
+#  ifdef USE_WIDE_CHAR
+#   ifdef QUAD
+#    define strtol wcstoull
+#   else
+#    define strtol wcstoul
+#   endif
+#  else
+#   ifdef QUAD
+#    define strtol strtoull
+#   else
+#    define strtol strtoul
+#   endif
+#  endif
+# else
+#  ifdef USE_WIDE_CHAR
+#   ifdef QUAD
+#    define strtol wcstoll
+#   else
+#    define strtol wcstol
+#   endif
+#  else
+#   ifdef QUAD
+#    define strtol strtoll
+#   endif
+#  endif
+# endif
+#endif
+
+/* If QUAD is defined, we are defining `strtoll' or `strtoull',
+   operating on `long long int's.  */
+#ifdef QUAD
+# define LONG long long
+# define STRTOL_LONG_MIN LLONG_MIN
+# define STRTOL_LONG_MAX LLONG_MAX
+# define STRTOL_ULONG_MAX ULLONG_MAX
+
+/* The extra casts in the following macros work around compiler bugs,
+   e.g., in Cray C 5.0.3.0.  */
+
+/* True if negative values of the signed integer type T use two's
+   complement, ones' complement, or signed magnitude representation,
+   respectively.  Much GNU code assumes two's complement, but some
+   people like to be portable to all possible C hosts.  */
+# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
+# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
+# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+
+/* True if the arithmetic type T is signed.  */
+# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* The maximum and minimum values for the integer type T.  These
+   macros have undefined behavior if T is signed and has padding bits.
+   If this is a problem for you, please let us know how to fix it for
+   your host.  */
+# define TYPE_MINIMUM(t) \
+   ((t) (! TYPE_SIGNED (t) \
+         ? (t) 0 \
+         : TYPE_SIGNED_MAGNITUDE (t) \
+         ? ~ (t) 0 \
+         : ~ TYPE_MAXIMUM (t)))
+# define TYPE_MAXIMUM(t) \
+   ((t) (! TYPE_SIGNED (t) \
+         ? (t) -1 \
+         : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+# ifndef ULLONG_MAX
+#  define ULLONG_MAX TYPE_MAXIMUM (unsigned long long)
+# endif
+# ifndef LLONG_MAX
+#  define LLONG_MAX TYPE_MAXIMUM (long long int)
+# endif
+# ifndef LLONG_MIN
+#  define LLONG_MIN TYPE_MINIMUM (long long int)
+# endif
+
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
+   /* Work around gcc bug with using this constant.  */
+   static const unsigned long long int maxquad = ULLONG_MAX;
+#  undef STRTOL_ULONG_MAX
+#  define STRTOL_ULONG_MAX maxquad
+# endif
+#else
+# define LONG long
+# define STRTOL_LONG_MIN LONG_MIN
+# define STRTOL_LONG_MAX LONG_MAX
+# define STRTOL_ULONG_MAX ULONG_MAX
+#endif
+
+
+/* We use this code also for the extended locale handling where the
+   function gets as an additional argument the locale which has to be
+   used.  To access the values we have to redefine the _NL_CURRENT
+   macro.  */
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# undef _NL_CURRENT
+# define _NL_CURRENT(category, item) \
+  (current->values[_NL_ITEM_INDEX (item)].string)
+# define LOCALE_PARAM , loc
+# define LOCALE_PARAM_PROTO , __locale_t loc
+#else
+# define LOCALE_PARAM
+# define LOCALE_PARAM_PROTO
+#endif
+
+#ifdef USE_WIDE_CHAR
+# include <wchar.h>
+# include <wctype.h>
+# define L_(Ch) L##Ch
+# define UCHAR_TYPE wint_t
+# define STRING_TYPE wchar_t
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+#  define ISSPACE(Ch) __iswspace_l ((Ch), loc)
+#  define ISALPHA(Ch) __iswalpha_l ((Ch), loc)
+#  define TOUPPER(Ch) __towupper_l ((Ch), loc)
+# else
+#  define ISSPACE(Ch) iswspace (Ch)
+#  define ISALPHA(Ch) iswalpha (Ch)
+#  define TOUPPER(Ch) towupper (Ch)
+# endif
+#else
+# define L_(Ch) Ch
+# define UCHAR_TYPE unsigned char
+# define STRING_TYPE char
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+#  define ISSPACE(Ch) __isspace_l ((Ch), loc)
+#  define ISALPHA(Ch) __isalpha_l ((Ch), loc)
+#  define TOUPPER(Ch) __toupper_l ((Ch), loc)
+# else
+#  define ISSPACE(Ch) isspace (Ch)
+#  define ISALPHA(Ch) isalpha (Ch)
+#  define TOUPPER(Ch) toupper (Ch)
+# endif
+#endif
+
+#define INTERNAL(X) INTERNAL1(X)
+#define INTERNAL1(X) __##X##_internal
+#define WEAKNAME(X) WEAKNAME1(X)
+
+#ifdef USE_NUMBER_GROUPING
+/* This file defines a function to check for correct grouping.  */
+# include "grouping.h"
+#endif
+
+
+
+/* Convert NPTR to an `unsigned long int' or `long int' in base BASE.
+   If BASE is 0 the base is determined by the presence of a leading
+   zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal.
+   If BASE is < 2 or > 36, it is reset to 10.
+   If ENDPTR is not NULL, a pointer to the character after the last
+   one converted is stored in *ENDPTR.  */
+
+INT
+INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
+                   int base, int group LOCALE_PARAM_PROTO)
+{
+  int negative;
+  register unsigned LONG int cutoff;
+  register unsigned int cutlim;
+  register unsigned LONG int i;
+  register const STRING_TYPE *s;
+  register UCHAR_TYPE c;
+  const STRING_TYPE *save, *end;
+  int overflow;
+
+#ifdef USE_NUMBER_GROUPING
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+  struct locale_data *current = loc->__locales[LC_NUMERIC];
+# endif
+  /* The thousands character of the current locale.  */
+  wchar_t thousands = L'\0';
+  /* The numeric grouping specification of the current locale,
+     in the format described in <locale.h>.  */
+  const char *grouping;
+
+  if (group)
+    {
+      grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
+      if (*grouping <= 0 || *grouping == CHAR_MAX)
+        grouping = NULL;
+      else
+        {
+          /* Figure out the thousands separator character.  */
+# if defined _LIBC || defined _HAVE_BTOWC
+          thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP));
+          if (thousands == WEOF)
+            thousands = L'\0';
+# endif
+          if (thousands == L'\0')
+            grouping = NULL;
+        }
+    }
+  else
+    grouping = NULL;
+#endif
+
+  if (base < 0 || base == 1 || base > 36)
+    {
+      __set_errno (EINVAL);
+      return 0;
+    }
+
+  save = s = nptr;
+
+  /* Skip white space.  */
+  while (ISSPACE (*s))
+    ++s;
+  if (*s == L_('\0'))
+    goto noconv;
+
+  /* Check for a sign.  */
+  if (*s == L_('-'))
+    {
+      negative = 1;
+      ++s;
+    }
+  else if (*s == L_('+'))
+    {
+      negative = 0;
+      ++s;
+    }
+  else
+    negative = 0;
+
+  /* Recognize number prefix and if BASE is zero, figure it out ourselves.  */
+  if (*s == L_('0'))
+    {
+      if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X'))
+        {
+          s += 2;
+          base = 16;
+        }
+      else if (base == 0)
+        base = 8;
+    }
+  else if (base == 0)
+    base = 10;
+
+  /* Save the pointer so we can check later if anything happened.  */
+  save = s;
+
+#ifdef USE_NUMBER_GROUPING
+  if (group)
+    {
+      /* Find the end of the digit string and check its grouping.  */
+      end = s;
+      for (c = *end; c != L_('\0'); c = *++end)
+        if ((wchar_t) c != thousands
+            && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9'))
+            && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base))
+          break;
+      if (*s == thousands)
+        end = s;
+      else
+        end = correctly_grouped_prefix (s, end, thousands, grouping);
+    }
+  else
+#endif
+    end = NULL;
+
+  cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base;
+  cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base;
+
+  overflow = 0;
+  i = 0;
+  for (c = *s; c != L_('\0'); c = *++s)
+    {
+      if (s == end)
+        break;
+      if (c >= L_('0') && c <= L_('9'))
+        c -= L_('0');
+      else if (ISALPHA (c))
+        c = TOUPPER (c) - L_('A') + 10;
+      else
+        break;
+      if ((int) c >= base)
+        break;
+      /* Check for overflow.  */
+      if (i > cutoff || (i == cutoff && c > cutlim))
+        overflow = 1;
+      else
+        {
+          i *= (unsigned LONG int) base;
+          i += c;
+        }
+    }
+
+  /* Check if anything actually happened.  */
+  if (s == save)
+    goto noconv;
+
+  /* Store in ENDPTR the address of one character
+     past the last character we converted.  */
+  if (endptr != NULL)
+    *endptr = (STRING_TYPE *) s;
+
+#if !UNSIGNED
+  /* Check for a value that is within the range of
+     `unsigned LONG int', but outside the range of `LONG int'.  */
+  if (overflow == 0
+      && i > (negative
+              ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1
+              : (unsigned LONG int) STRTOL_LONG_MAX))
+    overflow = 1;
+#endif
+
+  if (overflow)
+    {
+      __set_errno (ERANGE);
+#if UNSIGNED
+      return STRTOL_ULONG_MAX;
+#else
+      return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX;
+#endif
+    }
+
+  /* Return the result of the appropriate sign.  */
+  return negative ? -i : i;
+
+noconv:
+  /* We must handle a special case here: the base is 0 or 16 and the
+     first two characters are '0' and 'x', but the rest are no
+     hexadecimal digits.  This is no error case.  We return 0 and
+     ENDPTR points to the `x`.  */
+  if (endptr != NULL)
+    {
+      if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
+          && save[-2] == L_('0'))
+        *endptr = (STRING_TYPE *) &save[-1];
+      else
+        /*  There was no number to convert.  */
+        *endptr = (STRING_TYPE *) nptr;
+    }
+
+  return 0L;
+}
+
+/* External user entry point.  */
+
+
+INT
+#ifdef weak_function
+weak_function
+#endif
+strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr,
+        int base LOCALE_PARAM_PROTO)
+{
+  return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM);
+}

=== added file 'lib/strtoul.c'
--- a/lib/strtoul.c     1970-01-01 00:00:00 +0000
+++ b/lib/strtoul.c     2011-04-21 19:12:13 +0000
@@ -0,0 +1,19 @@
+/* Copyright (C) 1991, 1997, 2009-2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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 <http://www.gnu.org/licenses/>.  */
+
+#define UNSIGNED        1
+
+#include "strtol.c"

=== added file 'lib/strtoull.c'
--- a/lib/strtoull.c    1970-01-01 00:00:00 +0000
+++ b/lib/strtoull.c    2011-04-21 19:12:13 +0000
@@ -0,0 +1,26 @@
+/* Function to parse an `unsigned long long int' from text.
+   Copyright (C) 1995-1997, 1999, 2009-2011 Free Software Foundation, Inc.
+   NOTE: The canonical source of this file is maintained with the GNU C
+   Library.  Bugs can be reported to address@hidden
+
+   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 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 <http://www.gnu.org/licenses/>.  */
+
+#define QUAD 1
+
+#include "strtoul.c"
+
+#ifdef _LIBC
+strong_alias (__strtoull_internal, __strtouq_internal)
+weak_alias (strtoull, strtouq)
+#endif

=== added file 'lib/strtoumax.c'
--- a/lib/strtoumax.c   1970-01-01 00:00:00 +0000
+++ b/lib/strtoumax.c   2011-04-21 19:12:13 +0000
@@ -0,0 +1,2 @@
+#define UNSIGNED 1
+#include "strtoimax.c"

=== added file 'lib/verify.h'
--- a/lib/verify.h      1970-01-01 00:00:00 +0000
+++ b/lib/verify.h      2011-04-21 19:12:13 +0000
@@ -0,0 +1,202 @@
+/* Compile-time assert-like macros.
+
+   Copyright (C) 2005-2006, 2009-2011 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 <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert, Bruno Haible, and Jim Meyering.  */
+
+#ifndef VERIFY_H
+# define VERIFY_H 1
+
+/* Define HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the
+   C1X draft N1548 section 6.7.10.  This is supported by GCC 4.6.0 and
+   later, in C mode, and its use here generates easier-to-read diagnostics
+   when verify (R) fails.
+
+   Define HAVE_STATIC_ASSERT to 1 if static_assert works as per the
+   C1X draft N1548 section 7.2 or the C++0X draft N3242 section 7.(4).
+   This will likely be supported by future GCC versions, in C++ mode.
+
+   For now, use this only with GCC.  Eventually whether _Static_assert
+   and static_assert works should be determined by 'configure'.  */
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined 
__cplusplus
+#  define HAVE__STATIC_ASSERT 1
+# endif
+/* The condition (99 < __GNUC__) is temporary, until we know about the
+   first G++ release that supports static_assert.  */
+# if (99 < __GNUC__) && defined __cplusplus
+#  define HAVE_STATIC_ASSERT 1
+# endif
+
+/* Each of these macros verifies that its argument R is nonzero.  To
+   be portable, R should be an integer constant expression.  Unlike
+   assert (R), there is no run-time overhead.
+
+   There are two macros, since no single macro can be used in all
+   contexts in C.  verify_true (R) is for scalar contexts, including
+   integer constant expression contexts.  verify (R) is for declaration
+   contexts, e.g., the top level.
+
+   Symbols ending in "__" are private to this header.
+
+   If _Static_assert works, verify (R) uses it directly.  Similarly,
+   verify_true (R) works by packaging a _Static_assert inside a struct
+   that is an operand of sizeof.
+
+   The code below uses several ideas for C++ compilers, and for C
+   compilers that do not support _Static_assert:
+
+   * The first step is ((R) ? 1 : -1).  Given an expression R, of
+     integral or boolean or floating-point type, this yields an
+     expression of integral type, whose value is later verified to be
+     constant and nonnegative.
+
+   * Next this expression W is wrapped in a type
+     struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
+     If W is negative, this yields a compile-time error.  No compiler can
+     deal with a bit-field of negative size.
+
+     One might think that an array size check would have the same
+     effect, that is, that the type struct { unsigned int dummy[W]; }
+     would work as well.  However, inside a function, some compilers
+     (such as C++ compilers and GNU C) allow local parameters and
+     variables inside array size expressions.  With these compilers,
+     an array size check would not properly diagnose this misuse of
+     the verify macro:
+
+       void function (int n) { verify (n < 0); }
+
+   * For the verify macro, the struct verify_type__ will need to
+     somehow be embedded into a declaration.  To be portable, this
+     declaration must declare an object, a constant, a function, or a
+     typedef name.  If the declared entity uses the type directly,
+     such as in
+
+       struct dummy {...};
+       typedef struct {...} dummy;
+       extern struct {...} *dummy;
+       extern void dummy (struct {...} *);
+       extern struct {...} *dummy (void);
+
+     two uses of the verify macro would yield colliding declarations
+     if the entity names are not disambiguated.  A workaround is to
+     attach the current line number to the entity name:
+
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
+
+     But this has the problem that two invocations of verify from
+     within the same macro would collide, since the __LINE__ value
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
+
+     A solution is to use the sizeof operator.  It yields a number,
+     getting rid of the identity of the type.  Declarations like
+
+       extern int dummy [sizeof (struct {...})];
+       extern void dummy (int [sizeof (struct {...})]);
+       extern int (*dummy (void)) [sizeof (struct {...})];
+
+     can be repeated.
+
+   * Should the implementation use a named struct or an unnamed struct?
+     Which of the following alternatives can be used?
+
+       extern int dummy [sizeof (struct {...})];
+       extern int dummy [sizeof (struct verify_type__ {...})];
+       extern void dummy (int [sizeof (struct {...})]);
+       extern void dummy (int [sizeof (struct verify_type__ {...})]);
+       extern int (*dummy (void)) [sizeof (struct {...})];
+       extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
+
+     In the second and sixth case, the struct type is exported to the
+     outer scope; two such declarations therefore collide.  GCC warns
+     about the first, third, and fourth cases.  So the only remaining
+     possibility is the fifth case:
+
+       extern int (*dummy (void)) [sizeof (struct {...})];
+
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
+
+   * This implementation exploits the fact that older versions of GCC,
+     which do not support _Static_assert, also do not warn about the
+     last declaration mentioned above.
+
+   * In C++, any struct definition inside sizeof is invalid.
+     Use a template type to work around the problem.  */
+
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
+
+/* Verify requirement R at compile-time, as an integer constant expression.
+   Return 1.  */
+
+# ifdef __cplusplus
+template <int w>
+  struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
+#  define verify_true(R) \
+     (!!sizeof (verify_type__<(R) ? 1 : -1>))
+# elif HAVE__STATIC_ASSERT
+#  define verify_true(R) \
+     (!!sizeof \
+      (struct { \
+        _Static_assert (R, "verify_true (" #R ")"); \
+        int verify_dummy__; \
+       }))
+# elif HAVE_STATIC_ASSERT
+#  define verify_true(R) \
+     (!!sizeof \
+      (struct { \
+        static_assert (R, "verify_true (" #R ")"); \
+        int verify_dummy__; \
+       }))
+# else
+#  define verify_true(R) \
+     (!!sizeof \
+      (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
+# endif
+
+/* Verify requirement R at compile-time, as a declaration without a
+   trailing ';'.  */
+
+# if HAVE__STATIC_ASSERT
+#  define verify(R) _Static_assert (R, "verify (" #R ")")
+# elif HAVE_STATIC_ASSERT
+#  define verify(R) static_assert (R, "verify (" #R ")")
+# else
+#  define verify(R) \
+    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
+# endif
+
+#endif

=== modified file 'm4/gl-comp.m4'
--- a/m4/gl-comp.m4     2011-04-08 21:53:30 +0000
+++ b/m4/gl-comp.m4     2011-04-26 19:29:47 +0000
@@ -43,6 +43,7 @@
   # Code from module ignore-value:
   # Code from module include_next:
   # Code from module intprops:
+  # Code from module inttypes-incomplete:
   # Code from module lstat:
   # Code from module mktime:
   # Code from module multiarch:
@@ -56,11 +57,14 @@
   # Code from module stdio:
   # Code from module stdlib:
   # Code from module strftime:
+  # Code from module strtoull:
+  # Code from module strtoumax:
   # Code from module symlink:
   # Code from module sys_stat:
   # Code from module time:
   # Code from module time_r:
   # Code from module unistd:
+  # Code from module verify:
   # Code from module warn-on-use:
 ])
 
@@ -108,6 +112,8 @@
   AC_REQUIRE([AC_C_INLINE])
   # Code from module include_next:
   # Code from module intprops:
+  # Code from module inttypes-incomplete:
+  gl_INTTYPES_INCOMPLETE
   # Code from module lstat:
   gl_FUNC_LSTAT
   gl_SYS_STAT_MODULE_INDICATOR([lstat])
@@ -138,6 +144,12 @@
   gl_STDLIB_H
   # Code from module strftime:
   gl_FUNC_GNU_STRFTIME
+  # Code from module strtoull:
+  gl_FUNC_STRTOULL
+  gl_STDLIB_MODULE_INDICATOR([strtoull])
+  # Code from module strtoumax:
+  gl_FUNC_STRTOUMAX
+  gl_INTTYPES_MODULE_INDICATOR([strtoumax])
   # Code from module symlink:
   gl_FUNC_SYMLINK
   gl_UNISTD_MODULE_INDICATOR([symlink])
@@ -151,6 +163,7 @@
   gl_TIME_MODULE_INDICATOR([time_r])
   # Code from module unistd:
   gl_UNISTD_H
+  # Code from module verify:
   # Code from module warn-on-use:
   # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
@@ -313,6 +326,7 @@
   lib/gettext.h
   lib/ignore-value.h
   lib/intprops.h
+  lib/inttypes.in.h
   lib/lstat.c
   lib/md5.c
   lib/md5.h
@@ -327,11 +341,17 @@
   lib/stdlib.in.h
   lib/strftime.c
   lib/strftime.h
+  lib/strtoimax.c
+  lib/strtol.c
+  lib/strtoul.c
+  lib/strtoull.c
+  lib/strtoumax.c
   lib/symlink.c
   lib/sys_stat.in.h
   lib/time.in.h
   lib/time_r.c
   lib/unistd.in.h
+  lib/verify.h
   m4/00gnulib.m4
   m4/c-strtod.m4
   m4/extensions.m4
@@ -340,6 +360,7 @@
   m4/getopt.m4
   m4/gnulib-common.m4
   m4/include_next.m4
+  m4/inttypes.m4
   m4/longlong.m4
   m4/lstat.m4
   m4/md5.m4
@@ -356,6 +377,8 @@
   m4/stdio_h.m4
   m4/stdlib_h.m4
   m4/strftime.m4
+  m4/strtoull.m4
+  m4/strtoumax.m4
   m4/symlink.m4
   m4/sys_stat_h.m4
   m4/time_h.m4

=== added file 'm4/inttypes.m4'
--- a/m4/inttypes.m4    1970-01-01 00:00:00 +0000
+++ b/m4/inttypes.m4    2011-04-26 19:29:47 +0000
@@ -0,0 +1,172 @@
+# inttypes.m4 serial 23
+dnl Copyright (C) 2006-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 Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN([gl_INTTYPES_H],
+[
+  AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+  gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN([gl_INTTYPES_INCOMPLETE],
+[
+  AC_REQUIRE([gl_STDINT_H])
+  AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+  dnl Override <inttypes.h> always, so that the portability warnings work.
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+  AC_REQUIRE([gl_MULTIARCH])
+
+  dnl Ensure that <stdint.h> defines the limit macros, since gnulib's
+  dnl <inttypes.h> relies on them.  This macro is only needed when a
+  dnl C++ compiler is in use; it has no effect for a C compiler.
+  dnl Also be careful to define __STDC_LIMIT_MACROS only when gnulib's
+  dnl <inttypes.h> is going to be created, and to avoid redefinition warnings
+  dnl if the __STDC_LIMIT_MACROS is already defined through the CPPFLAGS.
+  AC_DEFINE([GL_TRIGGER_STDC_LIMIT_MACROS], [1],
+    [Define to make the limit macros in <stdint.h> visible.])
+  AH_VERBATIM([__STDC_LIMIT_MACROS_ZZZ],
+[/* Ensure that <stdint.h> defines the limit macros, since gnulib's
+   <inttypes.h> relies on them.  */
+#if defined __cplusplus && !defined __STDC_LIMIT_MACROS && 
GL_TRIGGER_STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS 1
+#endif
+])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
+    ]], [imaxabs imaxdiv strtoimax strtoumax])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+  AC_REQUIRE([gt_INTTYPES_PRI])
+
+  PRIPTR_PREFIX=
+  if test -n "$STDINT_H"; then
+    dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
+    PRIPTR_PREFIX='"l"'
+  else
+    dnl Using the system's <stdint.h>.
+    for glpfx in '' l ll I64; do
+      case $glpfx in
+        '')  gltype1='int';;
+        l)   gltype1='long int';;
+        ll)  gltype1='long long int';;
+        I64) gltype1='__int64';;
+      esac
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[#include <stdint.h>
+           extern intptr_t foo;
+           extern $gltype1 foo;]])],
+        [PRIPTR_PREFIX='"'$glpfx'"'])
+      test -n "$PRIPTR_PREFIX" && break
+    done
+  fi
+  AC_SUBST([PRIPTR_PREFIX])
+
+  gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+    [INT32_MAX_LT_INTMAX_MAX],
+    [defined INT32_MAX && defined INTMAX_MAX],
+    [INT32_MAX < INTMAX_MAX],
+    [sizeof (int) < sizeof (long long int)])
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
+    gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+      [INT64_MAX_EQ_LONG_MAX],
+      [defined INT64_MAX],
+      [INT64_MAX == LONG_MAX],
+      [sizeof (long long int) == sizeof (long int)])
+  else
+    INT64_MAX_EQ_LONG_MAX=-1
+  fi
+  gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+    [UINT32_MAX_LT_UINTMAX_MAX],
+    [defined UINT32_MAX && defined UINTMAX_MAX],
+    [UINT32_MAX < UINTMAX_MAX],
+    [sizeof (unsigned int) < sizeof (unsigned long long int)])
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
+    gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+      [UINT64_MAX_EQ_ULONG_MAX],
+      [defined UINT64_MAX],
+      [UINT64_MAX == ULONG_MAX],
+      [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+  else
+    UINT64_MAX_EQ_ULONG_MAX=-1
+  fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+  AC_CACHE_CHECK([whether $3],
+    [gl_cv_test_$1],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[/* Work also in C++ mode.  */
+            #define __STDC_LIMIT_MACROS 1
+
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+            #include <limits.h>
+            #if HAVE_STDINT_H
+             #include <stdint.h>
+            #endif
+
+            #if $2
+             #define CONDITION ($3)
+            #elif HAVE_LONG_LONG_INT
+             #define CONDITION ($4)
+            #else
+             #define CONDITION 0
+            #endif
+            int test[CONDITION ? 1 : -1];]])],
+       [gl_cv_test_$1=yes],
+       [gl_cv_test_$1=no])])
+  if test $gl_cv_test_$1 = yes; then
+    $1=1;
+  else
+    $1=0;
+  fi
+  AC_SUBST([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+  GNULIB_IMAXABS=0;      AC_SUBST([GNULIB_IMAXABS])
+  GNULIB_IMAXDIV=0;      AC_SUBST([GNULIB_IMAXDIV])
+  GNULIB_STRTOIMAX=0;    AC_SUBST([GNULIB_STRTOIMAX])
+  GNULIB_STRTOUMAX=0;    AC_SUBST([GNULIB_STRTOUMAX])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_IMAXABS=1;   AC_SUBST([HAVE_DECL_IMAXABS])
+  HAVE_DECL_IMAXDIV=1;   AC_SUBST([HAVE_DECL_IMAXDIV])
+  HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+  HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+  INT32_MAX_LT_INTMAX_MAX=1;  AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+  INT64_MAX_EQ_LONG_MAX='defined _LP64';  AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+  PRI_MACROS_BROKEN=0;   AC_SUBST([PRI_MACROS_BROKEN])
+  PRIPTR_PREFIX=__PRIPTR_PREFIX;  AC_SUBST([PRIPTR_PREFIX])
+  UINT32_MAX_LT_UINTMAX_MAX=1;  AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+  UINT64_MAX_EQ_ULONG_MAX='defined _LP64';  AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])

=== added file 'm4/strtoull.m4'
--- a/m4/strtoull.m4    1970-01-01 00:00:00 +0000
+++ b/m4/strtoull.m4    2011-04-21 19:12:13 +0000
@@ -0,0 +1,25 @@
+# strtoull.m4 serial 6
+dnl Copyright (C) 2002, 2004, 2006, 2008-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_FUNC_STRTOULL],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  dnl We don't need (and can't compile) the replacement strtoull
+  dnl unless the type 'unsigned long long int' exists.
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+  if test "$ac_cv_type_unsigned_long_long_int" = yes; then
+    AC_REPLACE_FUNCS([strtoull])
+    if test $ac_cv_func_strtoull = no; then
+      HAVE_STRTOULL=0
+      gl_PREREQ_STRTOULL
+    fi
+  fi
+])
+
+# Prerequisites of lib/strtoull.c.
+AC_DEFUN([gl_PREREQ_STRTOULL], [
+  :
+])

=== added file 'm4/strtoumax.m4'
--- a/m4/strtoumax.m4   1970-01-01 00:00:00 +0000
+++ b/m4/strtoumax.m4   2011-04-26 19:29:47 +0000
@@ -0,0 +1,26 @@
+# strtoumax.m4 serial 9
+dnl Copyright (C) 2002-2004, 2006, 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.
+
+AC_DEFUN([gl_FUNC_STRTOUMAX],
+[
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+
+  AC_CHECK_DECLS_ONCE([strtoumax])
+  if test "$ac_cv_have_decl_strtoumax" != yes; then
+    HAVE_DECL_STRTOUMAX=0
+
+    AC_REPLACE_FUNCS([strtoumax])
+    if test $ac_cv_func_strtoumax = no; then
+      gl_PREREQ_STRTOUMAX
+    fi
+  fi
+])
+
+# Prerequisites of lib/strtoumax.c.
+AC_DEFUN([gl_PREREQ_STRTOUMAX], [
+  AC_CHECK_DECLS([strtoull])
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+])

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-04-26 14:02:55 +0000
+++ b/src/ChangeLog     2011-04-26 18:02:10 +0000
@@ -1,3 +1,194 @@
+2011-04-26  Paul Eggert  <address@hidden>
+
+       * keyboard.c (handle_user_signal): Fix pointer signedness problem.
+
+       * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
+       (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
+       Remove unused local.
+       (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
+
+       lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
+       GCC 4.6.0 optimizes based on type-based alias analysis.  For
+       example, if b is of type struct buffer * and v of type struct
+       Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
+       != &v->size, and therefore "v->size = 1; b->size = 2; return
+       v->size;" must therefore return 1.  This assumption is incorrect
+       for Emacs, since it type-puns struct Lisp_Vector * with many other
+       types.  To fix this problem, this patch adds a new type struct
+       vectorlike_header that documents the constraints on layout of vectors
+       and pseudovectors, and helps optimizing compilers not get fooled
+       by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
+       XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
+       * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
+       the size member.
+       (XSETPVECTYPE): Rewrite in terms of new macro.
+       (XSETPVECTYPESIZE): New macro, specifying both type and size.
+       This is a bit clearer, and further avoids the possibility of
+       undesirable aliasing.
+       (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
+       (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
+       (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
+       since Lisp_Subr is a special case (no "next" field).
+       (ASIZE): Now uses header.size rather than size.  All
+       previous uses of XVECTOR (foo)->size replaced to use this macro,
+       to avoid the hassle of writing XVECTOR (foo)->header.size.
+       (struct vectorlike_header): New type.
+       (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
+       object, to help avoid aliasing.
+       (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
+       (SUBRP): Likewise, since Lisp_Subr is a special case.
+       * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
+       (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
+       (struct Lisp_Hash_Table): Combine first two members into a single
+       struct vectorlike_header member.  All uses of "size" and "next" members
+       changed to be "header.size" and "header.next".
+       * buffer.h (struct buffer): Likewise.
+       * font.h (struct font_spec, struct font_entity, struct font): Likewise.
+       * frame.h (struct frame): Likewise.
+       * process.h (struct Lisp_Process): Likewise.
+       * termhooks.h (struct terminal): Likewise.
+       * window.c (struct save_window_data, struct saved_window): Likewise.
+       * window.h (struct window): Likewise.
+       * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
+       Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
+       * buffer.c (init_buffer_once): Likewise.
+       * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
+       special case.
+       * process.c (Fformat_network_address): Use local var for size,
+       for brevity.
+
+       * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
+
+       Make the Lisp reader and string-to-float more consistent (Bug#8525)
+       * data.c (atof): Remove decl; no longer used or needed.
+       (digit_to_number): Move to lread.c.
+       (Fstring_to_number): Use new string_to_number function, to be
+       consistent with how the Lisp reader treats infinities and NaNs.
+       Do not assume that floating-point numbers represent EMACS_INT
+       without losing information; this is not true on most 64-bit hosts.
+       Avoid double-rounding errors, by insisting on integers when
+       parsing non-base-10 numbers, as the documentation specifies.
+       * lisp.h (string_to_number): New decl, replacing ...
+       (isfloat_string): Remove.
+       * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
+       (read1): Do not accept +. and -. as integers; this
+       appears to have been a coding error.  Similarly, do not accept
+       strings like +-1e0 as floating point numbers.  Do not report
+       overflow for integer overflows unless the base is not 10 which
+       means we have no simple and reliable way to continue.
+       Break out the floating-point parsing into a new
+       function string_to_number, so that Fstring_to_number parses
+       floating point numbers consistently with the Lisp reader.
+       (digit_to_number): Moved here from data.c.  Make it static inline.
+       (E_CHAR, EXP_INT): Remove, replacing with ...
+       (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
+       (string_to_number): New function, replacing isfloat_string.
+       This function checks for valid syntax and produces the resulting
+       Lisp float number too.  Rework it so that string-to-number
+       no longer mishandles examples like "1.0e+".  Use strtoumax,
+       so that overflow for non-base-10 numbers is reported only when
+       there's no portable and simple way to convert to floating point.
+
+       * textprop.c (set_text_properties_1): Rewrite for clarity,
+       and to avoid GCC warning about integer overflow.
+
+       * intervals.h (struct interval): Use EMACS_INT for members
+       where EMACS_UINT might cause problems.  See
+       <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
+       (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
+       * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
+       All uses changed.
+       (offset_intervals): Tell GCC not to worry about length overflow
+       when negating a negative length.
+
+       * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
+       (overrun_check_free): Likewise.
+
+       * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
+       in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
+       word size.
+
+       * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
+       (gnutls_make_error): Rename local to avoid shadowing.
+       (gnutls_emacs_global_deinit): ifdef out; not used.
+       (Fgnutls_boot): Use const for pointer to readonly storage.
+       Comment out unused local.  Fix pointer signedness problems.
+
+       * lread.c (openp): Don't stuff size_t into an 'int'.
+       Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
+       about possible signed overflow.
+
+       * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
+       (GDK_KEY_g): Don't define if already defined.
+       (xg_prepare_tooltip): Avoid pointer signedness problem.
+       (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
+
+       * process.c (Fnetwork_interface_info): Avoid left-shift undefined
+       behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
+
+       * xfns.c (Fx_window_property): Simplify a bit,
+       to make a bit faster and to avoid GCC 4.6.0 warning.
+       * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
+
+       * fns.c (internal_equal): Don't assume size_t fits in int.
+
+       * alloc.c (compact_small_strings): Tighten assertion a little.
+
+       Replace pEd with more-general pI, and fix some printf arg casts.
+       * lisp.h (pI): New macro, generalizing old pEd macro to other
+       conversion specifiers.  For example, use "...%"pI"d..." rather
+       than "...%"pEd"...".
+       (pEd): Remove.  All uses replaced with similar uses of pI.
+       * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
+       * alloc.c (check_pure_size): Don't overflow by converting size to int.
+       * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
+       * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
+       * dbusbind.c (xd_append_arg): Use pI to avoid cast.
+       (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
+       * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
+       64-bit hosts.
+       (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
+       * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
+       * print.c (safe_debug_print, print_object): Likewise.
+       (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
+       to int.
+       Use pI instead of if-then-else-abort.  Use %p to avoid casts,
+       avoiding the 0 flag, which is not portable.
+       * process.c (Fmake_network_process): Use pI to avoid cast.
+       * region-cache.c (pp_cache): Likewise.
+       * xdisp.c (decode_mode_spec): Likewise.
+       * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
+       behavior on 64-bit hosts with printf arg.
+       * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
+       (x_stop_queuing_selection_requests): Likewise.
+       (x_get_window_property): Don't truncate byte count to an 'int'
+       when tracing.
+
+       * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
+       here, since it parses constructs like leading '-' and spaces,
+       which are not wanted; and it overflows with large numbers.
+       Instead, simply match F[0-9]+, which is what is wanted anyway.
+
+       * alloc.c: Remove unportable assumptions about struct layout.
+       (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
+       (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
+       (allocate_vectorlike, make_pure_vector): Use the new macros,
+       plus offsetof, to remove unportable assumptions about struct layout.
+       These assumptions hold on all porting targets that I know of, but
+       they are not guaranteed, they're easy to remove, and removing them
+       makes further changes easier.
+
+       * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
+       This doesn't fix a bug but makes the code clearer.
+       (string_overrun_cookie): Now const.  Use initializers that
+       don't formally overflow signed char, to avoid warnings.
+       (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
+       can cause Emacs to crash when string overrun checking is enabled.
+       (allocate_buffer): Don't assume sizeof (struct buffer) is a
+       multiple of sizeof (EMACS_INT); it need not be, if
+       alignof(EMACS_INT) < sizeof (EMACS_INT).
+       (check_sblock, check_string_bytes, check_string_free_list): Protoize.
+
 2011-04-26  Juanma Barranquero  <address@hidden>
 
        * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
@@ -5,7 +196,7 @@
 2011-04-26  Teodor Zlatanov  <address@hidden>
 
        * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
-       supposed to be handshaking.
+       supposed to be handshaking.  (Bug#8556)
        Reported by Paul Eggert <address@hidden>.
 
 2011-04-26  Daniel Colascione <address@hidden>

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2011-04-25 21:36:06 +0000
+++ b/src/alloc.c       2011-04-26 06:17:52 +0000
@@ -146,9 +146,9 @@
 #define UNMARK_STRING(S)       ((S)->size &= ~ARRAY_MARK_FLAG)
 #define STRING_MARKED_P(S)     (((S)->size & ARRAY_MARK_FLAG) != 0)
 
-#define VECTOR_MARK(V)         ((V)->size |= ARRAY_MARK_FLAG)
-#define VECTOR_UNMARK(V)       ((V)->size &= ~ARRAY_MARK_FLAG)
-#define VECTOR_MARKED_P(V)     (((V)->size & ARRAY_MARK_FLAG) != 0)
+#define VECTOR_MARK(V)         ((V)->header.size |= ARRAY_MARK_FLAG)
+#define VECTOR_UNMARK(V)       ((V)->header.size &= ~ARRAY_MARK_FLAG)
+#define VECTOR_MARKED_P(V)     (((V)->header.size & ARRAY_MARK_FLAG) != 0)
 
 /* Value is the number of bytes of S, a pointer to a struct Lisp_String.
    Be careful during GC, because S->size contains the mark bit for
@@ -555,7 +555,7 @@
 
 /* Like malloc, but wraps allocated block with header and trailer.  */
 
-POINTER_TYPE *
+static POINTER_TYPE *
 overrun_check_malloc (size_t size)
 {
   register unsigned char *val;
@@ -579,7 +579,7 @@
 /* Like realloc, but checks old block for overrun, and wraps new block
    with header and trailer.  */
 
-POINTER_TYPE *
+static POINTER_TYPE *
 overrun_check_realloc (POINTER_TYPE *block, size_t size)
 {
   register unsigned char *val = (unsigned char *) block;
@@ -617,7 +617,7 @@
 
 /* Like free, but checks block for overrun.  */
 
-void
+static void
 overrun_check_free (POINTER_TYPE *block)
 {
   unsigned char *val = (unsigned char *) block;
@@ -835,7 +835,7 @@
    nothing else.  */
 #define BLOCK_PADDING 0
 #define BLOCK_BYTES \
-  (BLOCK_ALIGN - sizeof (struct ablock *) - BLOCK_PADDING)
+  (BLOCK_ALIGN - sizeof (struct ablocks *) - BLOCK_PADDING)
 
 /* Internal data structures and constants.  */
 
@@ -1055,8 +1055,9 @@
   struct buffer *b
     = (struct buffer *) lisp_malloc (sizeof (struct buffer),
                                     MEM_TYPE_BUFFER);
-  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
-  XSETPVECTYPE (b, PVEC_BUFFER);
+  XSETPVECTYPESIZE (b, PVEC_BUFFER,
+                   ((sizeof (struct buffer) + sizeof (EMACS_INT) - 1)
+                    / sizeof (EMACS_INT)));
   return b;
 }
 
@@ -1516,23 +1517,26 @@
 
 #define SDATA_NBYTES(S)        (S)->nbytes
 #define SDATA_DATA(S)  (S)->data
+#define SDATA_SELECTOR(member) member
 
 #else /* not GC_CHECK_STRING_BYTES */
 
   union
   {
-    /* When STRING in non-null.  */
+    /* When STRING is non-null.  */
     unsigned char data[1];
 
     /* When STRING is null.  */
     EMACS_INT nbytes;
   } u;
 
-
 #define SDATA_NBYTES(S)        (S)->u.nbytes
 #define SDATA_DATA(S)  (S)->u.data
+#define SDATA_SELECTOR(member) u.member
 
 #endif /* not GC_CHECK_STRING_BYTES */
+
+#define SDATA_DATA_OFFSET offsetof (struct sdata, SDATA_SELECTOR (data))
 };
 
 
@@ -1608,18 +1612,7 @@
    a pointer to the `u.data' member of its sdata structure; the
    structure starts at a constant offset in front of that.  */
 
-#ifdef GC_CHECK_STRING_BYTES
-
-#define SDATA_OF_STRING(S) \
-     ((struct sdata *) ((S)->data - sizeof (struct Lisp_String *) \
-                       - sizeof (EMACS_INT)))
-
-#else /* not GC_CHECK_STRING_BYTES */
-
-#define SDATA_OF_STRING(S) \
-     ((struct sdata *) ((S)->data - sizeof (struct Lisp_String *)))
-
-#endif /* not GC_CHECK_STRING_BYTES */
+#define SDATA_OF_STRING(S) ((struct sdata *) ((S)->data - SDATA_DATA_OFFSET))
 
 
 #ifdef GC_CHECK_STRING_OVERRUN
@@ -1629,8 +1622,8 @@
    presence of this cookie during GC.  */
 
 #define GC_STRING_OVERRUN_COOKIE_SIZE  4
-static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
-  { 0xde, 0xad, 0xbe, 0xef };
+static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
+  { '\xde', '\xad', '\xbe', '\xef' };
 
 #else
 #define GC_STRING_OVERRUN_COOKIE_SIZE 0
@@ -1643,18 +1636,25 @@
 #ifdef GC_CHECK_STRING_BYTES
 
 #define SDATA_SIZE(NBYTES)                     \
-     ((sizeof (struct Lisp_String *)           \
+     ((SDATA_DATA_OFFSET                       \
        + (NBYTES) + 1                          \
-       + sizeof (EMACS_INT)                    \
        + sizeof (EMACS_INT) - 1)               \
       & ~(sizeof (EMACS_INT) - 1))
 
 #else /* not GC_CHECK_STRING_BYTES */
 
-#define SDATA_SIZE(NBYTES)                     \
-     ((sizeof (struct Lisp_String *)           \
-       + (NBYTES) + 1                          \
-       + sizeof (EMACS_INT) - 1)               \
+/* The 'max' reserves space for the nbytes union member even when NBYTES + 1 is
+   less than the size of that member.  The 'max' is not needed when
+   SDATA_DATA_OFFSET is a multiple of sizeof (EMACS_INT), because then the
+   alignment code reserves enough space.  */
+
+#define SDATA_SIZE(NBYTES)                                   \
+     ((SDATA_DATA_OFFSET                                     \
+       + (SDATA_DATA_OFFSET % sizeof (EMACS_INT) == 0        \
+         ? NBYTES                                            \
+         : max (NBYTES, sizeof (EMACS_INT) - 1))             \
+       + 1                                                   \
+       + sizeof (EMACS_INT) - 1)                             \
       & ~(sizeof (EMACS_INT) - 1))
 
 #endif /* not GC_CHECK_STRING_BYTES */
@@ -1682,9 +1682,6 @@
 
 static int check_string_bytes_count;
 
-static void check_string_bytes (int);
-static void check_sblock (struct sblock *);
-
 #define CHECK_STRING_BYTES(S)  STRING_BYTES (S)
 
 
@@ -1875,7 +1872,7 @@
 
   if (nbytes > LARGE_STRING_BYTES)
     {
-      size_t size = sizeof *b - sizeof (struct sdata) + needed;
+      size_t size = offsetof (struct sblock, first_data) + needed;
 
 #ifdef DOUG_LEA_MALLOC
       /* Prevent mmap'ing the chunk.  Lisp data may not be mmap'ed
@@ -1936,7 +1933,8 @@
   s->size_byte = nbytes;
   s->data[nbytes] = '\0';
 #ifdef GC_CHECK_STRING_OVERRUN
-  memcpy (data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE);
+  memcpy ((char *) data + needed, string_overrun_cookie,
+         GC_STRING_OVERRUN_COOKIE_SIZE);
 #endif
 
   /* If S had already data assigned, mark that as free by setting its
@@ -2150,7 +2148,7 @@
              /* Copy, and update the string's `data' pointer.  */
              if (from != to)
                {
-                 xassert (tb != b || to <= from);
+                 xassert (tb != b || to < from);
                  memmove (to, from, nbytes + GC_STRING_EXTRA);
                  to->string->data = SDATA_DATA (to);
                }
@@ -2246,10 +2244,8 @@
      slot `size' of the struct Lisp_Bool_Vector.  */
   val = Fmake_vector (make_number (length_in_elts + 1), Qnil);
 
-  /* Get rid of any bits that would cause confusion.  */
-  XVECTOR (val)->size = 0;     /* No Lisp_Object to trace in there.  */
-  /* Use  XVECTOR (val) rather than `p' because p->size is not TRT. */
-  XSETPVECTYPE (XVECTOR (val), PVEC_BOOL_VECTOR);
+  /* No Lisp_Object to trace in there.  */
+  XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0);
 
   p = XBOOL_VECTOR (val);
   p->size = XFASTINT (length);
@@ -2804,7 +2800,8 @@
   /* This gets triggered by code which I haven't bothered to fix.  --Stef  */
   /* eassert (!handling_signal); */
 
-  nbytes = sizeof *p + (len - 1) * sizeof p->contents[0];
+  nbytes = (offsetof (struct Lisp_Vector, contents)
+           + len * sizeof p->contents[0]);
   p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE);
 
 #ifdef DOUG_LEA_MALLOC
@@ -2815,7 +2812,7 @@
   consing_since_gc += nbytes;
   vector_cells_consed += len;
 
-  p->next = all_vectors;
+  p->header.next.vector = all_vectors;
   all_vectors = p;
 
   MALLOC_UNBLOCK_INPUT;
@@ -2831,7 +2828,7 @@
 allocate_vector (EMACS_INT nslots)
 {
   struct Lisp_Vector *v = allocate_vectorlike (nslots);
-  v->size = nslots;
+  v->header.size = nslots;
   return v;
 }
 
@@ -2845,11 +2842,10 @@
   EMACS_INT i;
 
   /* Only the first lisplen slots will be traced normally by the GC.  */
-  v->size = lisplen;
   for (i = 0; i < lisplen; ++i)
     v->contents[i] = Qnil;
 
-  XSETPVECTYPE (v, tag);       /* Add the appropriate tag.  */
+  XSETPVECTYPESIZE (v, tag, lisplen);
   return v;
 }
 
@@ -4572,8 +4568,9 @@
 check_pure_size (void)
 {
   if (pure_bytes_used_before_overflow)
-    message ("emacs:0:Pure Lisp storage overflow (approx. %d bytes needed)",
-            (int) (pure_bytes_used + pure_bytes_used_before_overflow));
+    message (("emacs:0:Pure Lisp storage overflow (approx. %"pI"d"
+             " bytes needed)"),
+            pure_bytes_used + pure_bytes_used_before_overflow);
 }
 
 
@@ -4732,11 +4729,12 @@
 {
   Lisp_Object new;
   struct Lisp_Vector *p;
-  size_t size = sizeof *p + (len - 1) * sizeof (Lisp_Object);
+  size_t size = (offsetof (struct Lisp_Vector, contents)
+                + len * sizeof (Lisp_Object));
 
   p = (struct Lisp_Vector *) pure_alloc (size, Lisp_Vectorlike);
   XSETVECTOR (new, p);
-  XVECTOR (new)->size = len;
+  XVECTOR (new)->header.size = len;
   return new;
 }
 
@@ -4774,7 +4772,7 @@
       register EMACS_INT i;
       EMACS_INT size;
 
-      size = XVECTOR (obj)->size;
+      size = ASIZE (obj);
       if (size & PSEUDOVECTOR_FLAG)
        size &= PSEUDOVECTOR_SIZE_MASK;
       vec = XVECTOR (make_pure_vector (size));
@@ -4898,7 +4896,7 @@
              }
          }
 
-       nextb = nextb->next;
+       nextb = nextb->header.next.buffer;
       }
   }
 
@@ -5053,7 +5051,7 @@
           undo_list any more, we can finally mark the list.  */
        mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list));
 
-       nextb = nextb->next;
+       nextb = nextb->header.next.buffer;
       }
   }
 
@@ -5227,7 +5225,7 @@
 static void
 mark_vectorlike (struct Lisp_Vector *ptr)
 {
-  register EMACS_UINT size = ptr->size;
+  register EMACS_UINT size = ptr->header.size;
   register EMACS_UINT i;
 
   eassert (!VECTOR_MARKED_P (ptr));
@@ -5250,7 +5248,7 @@
 static void
 mark_char_table (struct Lisp_Vector *ptr)
 {
-  register EMACS_UINT size = ptr->size & PSEUDOVECTOR_SIZE_MASK;
+  register EMACS_UINT size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
   register EMACS_UINT i;
 
   eassert (!VECTOR_MARKED_P (ptr));
@@ -5363,7 +5361,7 @@
          if (po != &buffer_defaults && po != &buffer_local_symbols)
            {
              struct buffer *b;
-             for (b = all_buffers; b && b != po; b = b->next)
+             for (b = all_buffers; b && b != po; b = b->header.next.buffer)
                ;
              if (b == NULL)
                abort ();
@@ -5379,7 +5377,7 @@
           recursion there.  */
        {
          register struct Lisp_Vector *ptr = XVECTOR (obj);
-         register EMACS_UINT size = ptr->size;
+         register EMACS_UINT size = ptr->header.size;
          register EMACS_UINT i;
 
          CHECK_LIVE (live_vector_p);
@@ -6011,10 +6009,10 @@
       if (!VECTOR_MARKED_P (buffer))
        {
          if (prev)
-           prev->next = buffer->next;
+           prev->header.next = buffer->header.next;
          else
-           all_buffers = buffer->next;
-         next = buffer->next;
+           all_buffers = buffer->header.next.buffer;
+         next = buffer->header.next.buffer;
          lisp_free (buffer);
          buffer = next;
        }
@@ -6022,7 +6020,7 @@
        {
          VECTOR_UNMARK (buffer);
          UNMARK_BALANCE_INTERVALS (BUF_INTERVALS (buffer));
-         prev = buffer, buffer = buffer->next;
+         prev = buffer, buffer = buffer->header.next.buffer;
        }
   }
 
@@ -6035,10 +6033,10 @@
       if (!VECTOR_MARKED_P (vector))
        {
          if (prev)
-           prev->next = vector->next;
+           prev->header.next = vector->header.next;
          else
-           all_vectors = vector->next;
-         next = vector->next;
+           all_vectors = vector->header.next.vector;
+         next = vector->header.next.vector;
          lisp_free (vector);
          n_vectors--;
          vector = next;
@@ -6047,11 +6045,11 @@
       else
        {
          VECTOR_UNMARK (vector);
-         if (vector->size & PSEUDOVECTOR_FLAG)
-           total_vector_size += (PSEUDOVECTOR_SIZE_MASK & vector->size);
+         if (vector->header.size & PSEUDOVECTOR_FLAG)
+           total_vector_size += PSEUDOVECTOR_SIZE_MASK & vector->header.size;
          else
-           total_vector_size += vector->size;
-         prev = vector, vector = vector->next;
+           total_vector_size += vector->header.size;
+         prev = vector, vector = vector->header.next.vector;
        }
   }
 

=== modified file 'src/bidi.c'
--- a/src/bidi.c        2011-04-11 06:13:04 +0000
+++ b/src/bidi.c        2011-04-19 00:34:42 +0000
@@ -1807,6 +1807,6 @@
   fputs ("\n", stderr);
   fputs ("pos ", stderr);
   for (i = 0; i < bidi_cache_idx; i++)
-    fprintf (stderr, "%*ld", ndigits, (long)bidi_cache[i].charpos);
+    fprintf (stderr, "%*"pI"d", ndigits, bidi_cache[i].charpos);
   fputs ("\n", stderr);
 }

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2011-04-23 03:07:16 +0000
+++ b/src/buffer.c      2011-04-26 06:17:52 +0000
@@ -43,7 +43,7 @@
 struct buffer *current_buffer;         /* the current buffer */
 
 /* First buffer in chain of all buffers (in reverse order of creation).
-   Threaded through ->next.  */
+   Threaded through ->header.next.buffer.  */
 
 struct buffer *all_buffers;
 
@@ -359,7 +359,7 @@
   b->prevent_redisplay_optimizations_p = 1;
 
   /* Put this on the chain of all buffers including killed ones.  */
-  b->next = all_buffers;
+  b->header.next.buffer = all_buffers;
   all_buffers = b;
 
   /* An ordinary buffer normally doesn't need markers
@@ -588,7 +588,7 @@
   BVAR (b, width_table) = Qnil;
 
   /* Put this on the chain of all buffers including killed ones.  */
-  b->next = all_buffers;
+  b->header.next.buffer = all_buffers;
   all_buffers = b;
 
   name = Fcopy_sequence (name);
@@ -1458,7 +1458,7 @@
 
       GCPRO1 (buffer);
 
-      for (other = all_buffers; other; other = other->next)
+      for (other = all_buffers; other; other = other->header.next.buffer)
        /* all_buffers contains dead buffers too;
           don't re-kill them.  */
        if (other->base_buffer == b && !NILP (BVAR (other, name)))
@@ -2099,7 +2099,7 @@
 
   { /* This is probably harder to make work.  */
     struct buffer *other;
-    for (other = all_buffers; other; other = other->next)
+    for (other = all_buffers; other; other = other->header.next.buffer)
       if (other->base_buffer == other_buffer
          || other->base_buffer == current_buffer)
        error ("One of the buffers to swap has indirect buffers");
@@ -2476,7 +2476,7 @@
 
   /* Copy this buffer's new multibyte status
      into all of its indirect buffers.  */
-  for (other = all_buffers; other; other = other->next)
+  for (other = all_buffers; other; other = other->header.next.buffer)
     if (other->base_buffer == current_buffer && !NILP (BVAR (other, name)))
       {
        BVAR (other, enable_multibyte_characters)
@@ -4178,7 +4178,7 @@
 static void
 add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
 {
-  int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
+  int oldsize = ASIZE (last_overlay_modification_hooks);
 
   if (last_overlay_modification_hooks_used == oldsize)
     last_overlay_modification_hooks = larger_vector
@@ -4973,9 +4973,9 @@
   buffer_local_symbols.text = &buffer_local_symbols.own_text;
   BUF_INTERVALS (&buffer_defaults) = 0;
   BUF_INTERVALS (&buffer_local_symbols) = 0;
-  XSETPVECTYPE (&buffer_defaults, PVEC_BUFFER);
+  XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, 0);
   XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
-  XSETPVECTYPE (&buffer_local_symbols, PVEC_BUFFER);
+  XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, 0);
   XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
 
   /* Set up the default values of various buffer slots.  */

=== modified file 'src/buffer.h'
--- a/src/buffer.h      2011-04-11 01:41:15 +0000
+++ b/src/buffer.h      2011-04-25 19:40:22 +0000
@@ -499,14 +499,13 @@
 
      Check out mark_buffer (alloc.c) to see why.  */
 
-  EMACS_UINT size;
-
-  /* Next buffer, in chain of all buffers including killed buffers.
+  /* HEADER.NEXT is the next buffer, in chain of all buffers,
+     including killed buffers.
      This chain is used only for garbage collection, in order to
      collect killed buffers properly.
      Note that vectors and most pseudovectors are all on one chain,
      but buffers are on a separate chain of their own.  */
-  struct buffer *next;
+  struct vectorlike_header header;
 
   /* This structure holds the coordinates of the buffer contents
      in ordinary buffers.  In indirect buffers, this is not used.  */

=== modified file 'src/bytecode.c'
--- a/src/bytecode.c    2011-04-11 03:39:45 +0000
+++ b/src/bytecode.c    2011-04-25 21:34:39 +0000
@@ -444,7 +444,7 @@
   /* Lisp_Object v1, v2; */
   Lisp_Object *vectorp;
 #ifdef BYTE_CODE_SAFE
-  int const_length = XVECTOR (vector)->size;
+  int const_length;
   Lisp_Object *stacke;
   int bytestr_length;
 #endif
@@ -466,6 +466,10 @@
   CHECK_VECTOR (vector);
   CHECK_NUMBER (maxdepth);
 
+#ifdef BYTE_CODE_SAFE
+  const_length = ASIZE (vector);
+#endif
+
   if (STRING_MULTIBYTE (bytestr))
     /* BYTESTR must have been produced by Emacs 20.2 or the earlier
        because they produced a raw 8-bit string for byte-code and now

=== modified file 'src/callint.c'
--- a/src/callint.c     2011-04-23 10:33:28 +0000
+++ b/src/callint.c     2011-04-26 06:17:52 +0000
@@ -294,7 +294,7 @@
   else
     {
       CHECK_VECTOR (keys);
-      key_count = XVECTOR (keys)->size;
+      key_count = ASIZE (keys);
     }
 
   /* Save this now, since use of minibuffer will clobber it. */

=== modified file 'src/ccl.c'
--- a/src/ccl.c 2011-04-14 05:04:02 +0000
+++ b/src/ccl.c 2011-04-25 07:14:46 +0000
@@ -1903,7 +1903,7 @@
       if (! VECTORP (ccl_prog))
        return -1;
       vp = XVECTOR (ccl_prog);
-      ccl->size = vp->size;
+      ccl->size = vp->header.size;
       ccl->prog = vp->contents;
       ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]);
       ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]);

=== modified file 'src/character.c'
--- a/src/character.c   2011-04-24 07:11:56 +0000
+++ b/src/character.c   2011-04-26 06:17:52 +0000
@@ -356,7 +356,7 @@
        {
          val = DISP_CHAR_VECTOR (dp, c);
          if (VECTORP (val))
-           thiswidth = XVECTOR (val)->size;
+           thiswidth = ASIZE (val);
          else
            thiswidth = CHAR_WIDTH (c);
        }
@@ -445,7 +445,7 @@
            {
              val = DISP_CHAR_VECTOR (dp, c);
              if (VECTORP (val))
-               thiswidth = XVECTOR (val)->size;
+               thiswidth = ASIZE (val);
              else
                thiswidth = CHAR_WIDTH (c);
            }

=== modified file 'src/charset.c'
--- a/src/charset.c     2011-04-23 10:33:28 +0000
+++ b/src/charset.c     2011-04-26 06:17:52 +0000
@@ -999,7 +999,7 @@
     {
       CHECK_NUMBER (val);
       if (XINT (val) < '0' || XINT (val) > 127)
-       error ("Invalid iso-final-char: %"pEd, XINT (val));
+       error ("Invalid iso-final-char: %"pI"d", XINT (val));
       charset.iso_final = XINT (val);
     }
 
@@ -1021,7 +1021,7 @@
     {
       CHECK_NATNUM (val);
       if ((XINT (val) > 0 && XINT (val) <= 128) || XINT (val) >= 256)
-       error ("Invalid emacs-mule-id: %"pEd, XINT (val));
+       error ("Invalid emacs-mule-id: %"pI"d", XINT (val));
       charset.emacs_mule_id = XINT (val);
     }
 
@@ -1439,10 +1439,10 @@
   CHECK_CHARACTER (final_char);
 
   if (XINT (dimension) > 3)
-    error ("Invalid DIMENSION %"pEd", it should be 1, 2, or 3",
+    error ("Invalid DIMENSION %"pI"d, it should be 1, 2, or 3",
           XINT (dimension));
   if (XINT (chars) != 94 && XINT (chars) != 96)
-    error ("Invalid CHARS %"pEd", it should be 94 or 96", XINT (chars));
+    error ("Invalid CHARS %"pI"d, it should be 94 or 96", XINT (chars));
   if (XINT (final_char) < '0' || XINT (final_char) > '~')
     error ("Invalid FINAL-CHAR %c, it should be `0'..`~'",
           (int)XINT (final_char));

=== modified file 'src/chartab.c'
--- a/src/chartab.c     2011-04-14 05:04:02 +0000
+++ b/src/chartab.c     2011-04-25 07:14:46 +0000
@@ -146,7 +146,7 @@
 copy_char_table (Lisp_Object table)
 {
   Lisp_Object copy;
-  int size = XCHAR_TABLE (table)->size & PSEUDOVECTOR_SIZE_MASK;
+  int size = XCHAR_TABLE (table)->header.size & PSEUDOVECTOR_SIZE_MASK;
   int i;
 
   copy = Fmake_vector (make_number (size), Qnil);

=== modified file 'src/coding.c'
--- a/src/coding.c      2011-04-23 10:33:28 +0000
+++ b/src/coding.c      2011-04-26 06:17:52 +0000
@@ -7125,7 +7125,7 @@
              components = COMPOSITION_COMPONENTS (prop);
              if (VECTORP (components))
                {
-                 len = XVECTOR (components)->size;
+                 len = ASIZE (components);
                  for (i = 0; i < len; i++)
                    *buf++ = XINT (AREF (components, i));
                }
@@ -9037,14 +9037,14 @@
 
       if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF
          || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC)
-       error ("Invalid code: %"pEd, ch);
+       error ("Invalid code: %"pI"d", ch);
       c = ch;
       SJIS_TO_JIS (c);
       charset = charset_kanji;
     }
   c = DECODE_CHAR (charset, c);
   if (c < 0)
-    error ("Invalid code: %"pEd, ch);
+    error ("Invalid code: %"pI"d", ch);
   return make_number (c);
 }
 
@@ -9111,13 +9111,13 @@
       int b2 = ch & 0x7F;
       if (b1 < 0xA1 || b1 > 0xFE
          || b2 < 0x40 || (b2 > 0x7E && b2 < 0xA1) || b2 > 0xFE)
-       error ("Invalid code: %"pEd, ch);
+       error ("Invalid code: %"pI"d", ch);
       c = ch;
       charset = charset_big5;
     }
   c = DECODE_CHAR (charset, c);
   if (c < 0)
-    error ("Invalid code: %"pEd, ch);
+    error ("Invalid code: %"pI"d", ch);
   return make_number (c);
 }
 
@@ -9289,7 +9289,7 @@
        || (EQ (operation, Qinsert_file_contents) && CONSP (target)
            && STRINGP (XCAR (target)) && BUFFERP (XCDR (target)))
        || (EQ (operation, Qopen_network_stream) && INTEGERP (target))))
-    error ("Invalid %"pEd"th argument", XFASTINT (target_idx) + 1);
+    error ("Invalid %"pI"dth argument", XFASTINT (target_idx) + 1);
   if (CONSP (target))
     target = XCAR (target);
 
@@ -9765,7 +9765,7 @@
          CHECK_CHARSET_GET_ID (tmp1, id);
          CHECK_NATNUM_CDR (val);
          if (XINT (XCDR (val)) >= 4)
-           error ("Invalid graphic register number: %"pEd, XINT (XCDR (val)));
+           error ("Invalid graphic register number: %"pI"d", XINT (XCDR 
(val)));
          XSETCAR (val, make_number (id));
        }
 

=== modified file 'src/composite.c'
--- a/src/composite.c   2011-04-14 19:34:42 +0000
+++ b/src/composite.c   2011-04-25 21:34:39 +0000
@@ -293,7 +293,7 @@
     }
   else if (VECTORP (components) || CONSP (components))
     {
-      EMACS_UINT len = XVECTOR (key)->size;
+      EMACS_UINT len = ASIZE (key);
 
       /* The number of elements should be odd.  */
       if ((len % 2) == 0)
@@ -326,8 +326,8 @@
                    : COMPOSITION_WITH_RULE_ALTCHARS));
   cmp->hash_index = hash_index;
   glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
-              ? (XVECTOR (key)->size + 1) / 2
-              : XVECTOR (key)->size);
+              ? (ASIZE (key) + 1) / 2
+              : ASIZE (key));
   cmp->glyph_len = glyph_len;
   cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2);
   cmp->font = NULL;

=== modified file 'src/data.c'
--- a/src/data.c        2011-04-16 21:48:36 +0000
+++ b/src/data.c        2011-04-25 21:34:39 +0000
@@ -48,10 +48,6 @@
 
 #include <math.h>
 
-#if !defined (atof)
-extern double atof (const char *);
-#endif /* !atof */
-
 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
 static Lisp_Object Qsubr;
 Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
@@ -1393,7 +1389,7 @@
              {
                struct buffer *b;
 
-               for (b = all_buffers; b; b = b->next)
+               for (b = all_buffers; b; b = b->header.next.buffer)
                  if (!PER_BUFFER_VALUE_P (b, idx))
                    PER_BUFFER_VALUE (b, offset) = value;
              }
@@ -2097,9 +2093,9 @@
     {
       int size = 0;
       if (VECTORP (array))
-       size = XVECTOR (array)->size;
+       size = ASIZE (array);
       else if (COMPILEDP (array))
-       size = XVECTOR (array)->size & PSEUDOVECTOR_SIZE_MASK;
+       size = ASIZE (array) & PSEUDOVECTOR_SIZE_MASK;
       else
        wrong_type_argument (Qarrayp, array);
 
@@ -2124,7 +2120,7 @@
 
   if (VECTORP (array))
     {
-      if (idxval < 0 || idxval >= XVECTOR (array)->size)
+      if (idxval < 0 || idxval >= ASIZE (array))
        args_out_of_range (array, idx);
       XVECTOR (array)->contents[idxval] = newelt;
     }
@@ -2374,35 +2370,10 @@
       return build_string (pigbuf);
     }
 
-  if (sizeof (int) == sizeof (EMACS_INT))
-    sprintf (buffer, "%d", (int) XINT (number));
-  else if (sizeof (long) == sizeof (EMACS_INT))
-    sprintf (buffer, "%ld", (long) XINT (number));
-  else
-    abort ();
+  sprintf (buffer, "%"pI"d", XINT (number));
   return build_string (buffer);
 }
 
-INLINE static int
-digit_to_number (int character, int base)
-{
-  int digit;
-
-  if (character >= '0' && character <= '9')
-    digit = character - '0';
-  else if (character >= 'a' && character <= 'z')
-    digit = character - 'a' + 10;
-  else if (character >= 'A' && character <= 'Z')
-    digit = character - 'A' + 10;
-  else
-    return -1;
-
-  if (digit >= base)
-    return -1;
-  else
-    return digit;
-}
-
 DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
        doc: /* Parse STRING as a decimal number and return the number.
 This parses both integers and floating point numbers.
@@ -2415,7 +2386,6 @@
 {
   register char *p;
   register int b;
-  int sign = 1;
   Lisp_Object val;
 
   CHECK_STRING (string);
@@ -2430,40 +2400,13 @@
        xsignal1 (Qargs_out_of_range, base);
     }
 
-  /* Skip any whitespace at the front of the number.  Some versions of
-     atoi do this anyway, so we might as well make Emacs lisp consistent.  */
   p = SSDATA (string);
   while (*p == ' ' || *p == '\t')
     p++;
 
-  if (*p == '-')
-    {
-      sign = -1;
-      p++;
-    }
-  else if (*p == '+')
-    p++;
-
-  if (isfloat_string (p, 1) && b == 10)
-    val = make_float (sign * atof (p));
-  else
-    {
-      double v = 0;
-
-      while (1)
-       {
-         int digit = digit_to_number (*p++, b);
-         if (digit < 0)
-           break;
-         v = v * b + digit;
-       }
-
-      val = make_fixnum_or_float (sign * v);
-    }
-
-  return val;
+  val = string_to_number (p, b, 1);
+  return NILP (val) ? make_number (0) : val;
 }
-
 
 enum arithop
   {

=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c    2011-04-12 05:20:44 +0000
+++ b/src/dbusbind.c    2011-04-19 00:34:42 +0000
@@ -506,7 +506,7 @@
        CHECK_NUMBER (object);
        {
          dbus_uint64_t val = XUINT (object);
-         XD_DEBUG_MESSAGE ("%c %u", dtype, (unsigned int) val);
+         XD_DEBUG_MESSAGE ("%c %"pI"u", dtype, XUINT (object));
          if (!dbus_message_iter_append_basic (iter, dtype, &val))
            XD_SIGNAL2 (build_string ("Unable to append argument"), object);
          return;
@@ -1377,7 +1377,7 @@
   CHECK_STRING (service);
   GCPRO3 (bus, serial, service);
 
-  XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long) XUINT (serial), SDATA 
(service));
+  XD_DEBUG_MESSAGE ("%"pI"u %s ", XUINT (serial), SDATA (service));
 
   /* Open a connection to the bus.  */
   connection = xd_initialize (bus, TRUE);
@@ -1465,7 +1465,7 @@
   CHECK_STRING (service);
   GCPRO3 (bus, serial, service);
 
-  XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long) XUINT (serial), SDATA 
(service));
+  XD_DEBUG_MESSAGE ("%"pI"u %s ", XUINT (serial), SDATA (service));
 
   /* Open a connection to the bus.  */
   connection = xd_initialize (bus, TRUE);

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2011-04-14 05:04:02 +0000
+++ b/src/dispnew.c     2011-04-25 21:34:39 +0000
@@ -6073,7 +6073,7 @@
     state = frame_and_buffer_state;
 
   vecp = XVECTOR (state)->contents;
-  end = vecp + XVECTOR (state)->size;
+  end = vecp + ASIZE (state);
 
   FOR_EACH_FRAME (tail, frame)
     {
@@ -6124,8 +6124,8 @@
   /* Reallocate the vector if data has grown to need it,
      or if it has shrunk a lot.  */
   if (! VECTORP (state)
-      || n > XVECTOR (state)->size
-      || n + 20 < XVECTOR (state)->size / 2)
+      || n > ASIZE (state)
+      || n + 20 < ASIZE (state) / 2)
     /* Add 20 extra so we grow it less often.  */
     {
       state = Fmake_vector (make_number (n + 20), Qlambda);
@@ -6155,11 +6155,11 @@
   /* Fill up the vector with lambdas (always at least one).  */
   *vecp++ = Qlambda;
   while (vecp - XVECTOR (state)->contents
-        < XVECTOR (state)->size)
+        < ASIZE (state))
     *vecp++ = Qlambda;
   /* Make sure we didn't overflow the vector.  */
   if (vecp - XVECTOR (state)->contents
-      > XVECTOR (state)->size)
+      > ASIZE (state))
     abort ();
   return Qt;
 }

=== modified file 'src/disptab.h'
--- a/src/disptab.h     2011-01-25 04:08:28 +0000
+++ b/src/disptab.h     2011-04-25 21:34:39 +0000
@@ -54,7 +54,7 @@
 /* Return the current length of the GLYPH table,
    or 0 if the table isn't currently valid.  */
 #define GLYPH_TABLE_LENGTH  \
-  ((VECTORP (Vglyph_table)) ? XVECTOR (Vglyph_table)->size : 0)
+  ((VECTORP (Vglyph_table)) ? ASIZE (Vglyph_table) : 0)
 
 /* Return the current base (for indexing) of the GLYPH table,
    or 0 if the table isn't currently valid.  */
@@ -95,4 +95,3 @@
 
 #define SET_GLYPH_FROM_CHAR(glyph, c) \
   SET_GLYPH (glyph, c, DEFAULT_FACE_ID)
-

=== modified file 'src/doc.c'
--- a/src/doc.c 2011-04-24 09:00:03 +0000
+++ b/src/doc.c 2011-04-26 06:17:52 +0000
@@ -156,7 +156,7 @@
   if (0 > lseek (fd, position - offset, 0))
     {
       emacs_close (fd);
-      error ("Position %"pEd" out of range in doc string file \"%s\"",
+      error ("Position %"pI"d out of range in doc string file \"%s\"",
             position, name);
     }
 
@@ -673,7 +673,7 @@
                ; /* Just a source file name boundary marker.  Ignore it.  */
 
              else
-               error ("DOC file invalid at position %"pEd, pos);
+               error ("DOC file invalid at position %"pI"d", pos);
            }
        }
       pos += end - buf;
@@ -789,7 +789,7 @@
        do_remap:
          tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
 
-         if (VECTORP (tem) && XVECTOR (tem)->size > 1
+         if (VECTORP (tem) && ASIZE (tem) > 1
              && EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1))
              && follow_remap)
            {

=== modified file 'src/fns.c'
--- a/src/fns.c 2011-04-16 03:13:28 +0000
+++ b/src/fns.c 2011-04-25 07:14:46 +0000
@@ -1072,7 +1072,7 @@
       EMACS_INT converted = str_to_unibyte (SDATA (string), str, chars, 0);
 
       if (converted < chars)
-       error ("Can't convert the %"pEd"th character to unibyte", converted);
+       error ("Can't convert the %"pI"dth character to unibyte", converted);
       string = make_unibyte_string ((char *) str, chars);
       xfree (str);
     }
@@ -2063,14 +2063,12 @@
        /* Boolvectors are compared much like strings.  */
        if (BOOL_VECTOR_P (o1))
          {
-           int size_in_chars
-             = ((XBOOL_VECTOR (o1)->size + BOOL_VECTOR_BITS_PER_CHAR - 1)
-                / BOOL_VECTOR_BITS_PER_CHAR);
-
            if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size)
              return 0;
            if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data,
-                       size_in_chars))
+                       ((XBOOL_VECTOR (o1)->size
+                         + BOOL_VECTOR_BITS_PER_CHAR - 1)
+                        / BOOL_VECTOR_BITS_PER_CHAR)))
              return 0;
            return 1;
          }
@@ -3683,9 +3681,9 @@
   struct Lisp_Vector *next;
 
   h2 = allocate_hash_table ();
-  next = h2->vec_next;
+  next = h2->header.next.vector;
   memcpy (h2, h1, sizeof *h2);
-  h2->vec_next = next;
+  h2->header.next.vector = next;
   h2->key_and_value = Fcopy_sequence (h1->key_and_value);
   h2->hash = Fcopy_sequence (h1->hash);
   h2->next = Fcopy_sequence (h1->next);
@@ -4028,7 +4026,7 @@
       marked = 0;
       for (h = weak_hash_tables; h; h = h->next_weak)
        {
-         if (h->size & ARRAY_MARK_FLAG)
+         if (h->header.size & ARRAY_MARK_FLAG)
            marked |= sweep_weak_table (h, 0);
        }
     }
@@ -4039,7 +4037,7 @@
     {
       next = h->next_weak;
 
-      if (h->size & ARRAY_MARK_FLAG)
+      if (h->header.size & ARRAY_MARK_FLAG)
        {
          /* TABLE is marked as used.  Sweep its contents.  */
          if (h->count > 0)
@@ -4155,7 +4153,7 @@
   unsigned hash = XBOOL_VECTOR (vec)->size;
   int i, n;
 
-  n = min (SXHASH_MAX_LEN, XBOOL_VECTOR (vec)->vector_size);
+  n = min (SXHASH_MAX_LEN, XBOOL_VECTOR (vec)->header.size);
   for (i = 0; i < n; ++i)
     hash = SXHASH_COMBINE (hash, XBOOL_VECTOR (vec)->data[i]);
 

=== modified file 'src/font.c'
--- a/src/font.c        2011-04-23 10:33:28 +0000
+++ b/src/font.c        2011-04-26 06:17:52 +0000
@@ -253,7 +253,7 @@
   /* The following code is copied from the function intern (in
      lread.c), and modified to suite our purpose.  */
   obarray = Vobarray;
-  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || ASIZE (obarray) == 0)
     obarray = check_obarray (obarray);
   parse_str_as_multibyte ((unsigned char *) str, len, &nchars, &nbytes);
   if (len == nchars || len != nbytes)
@@ -1271,9 +1271,9 @@
     f[XLFD_SPACING_INDEX] = "*", len += 2;
   if (INTEGERP (AREF (font,  FONT_AVGWIDTH_INDEX)))
     {
-      f[XLFD_AVGWIDTH_INDEX] = p = alloca (11);
-      len += sprintf (p, "%ld",
-                      (long) XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1;
+      f[XLFD_AVGWIDTH_INDEX] = p = alloca (22);
+      len += sprintf (p, "%"pI"d",
+                     XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1;
     }
   else
     f[XLFD_AVGWIDTH_INDEX] = "*", len += 2;
@@ -1598,7 +1598,7 @@
     }
 
   if (INTEGERP (AREF (font, FONT_DPI_INDEX)))
-    len += sprintf (work, ":dpi=%ld", (long)XINT (AREF (font, 
FONT_DPI_INDEX)));
+    len += sprintf (work, ":dpi=%"pI"d", XINT (AREF (font, FONT_DPI_INDEX)));
   if (INTEGERP (AREF (font, FONT_SPACING_INDEX)))
     len += strlen (":spacing=100");
   if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX)))
@@ -1611,7 +1611,7 @@
       if (STRINGP (value))
        len += SBYTES (value);
       else if (INTEGERP (value))
-       len += sprintf (work, "%ld", (long) XINT (value));
+       len += sprintf (work, "%"pI"d", XINT (value));
       else if (SYMBOLP (value))
        len += (NILP (value) ? 5 : 4); /* for "false" or "true" */
     }
@@ -1638,10 +1638,9 @@
       p += sprintf (p, ":%s=%s", style_names[i],
                    SDATA (SYMBOL_NAME (styles[i])));
   if (INTEGERP (AREF (font, FONT_DPI_INDEX)))
-    p += sprintf (p, ":dpi=%ld", (long) XINT (AREF (font, FONT_DPI_INDEX)));
+    p += sprintf (p, ":dpi=%"pI"d", XINT (AREF (font, FONT_DPI_INDEX)));
   if (INTEGERP (AREF (font, FONT_SPACING_INDEX)))
-    p += sprintf (p, ":spacing=%ld",
-                  (long) XINT (AREF (font, FONT_SPACING_INDEX)));
+    p += sprintf (p, ":spacing=%"pI"d", XINT (AREF (font, 
FONT_SPACING_INDEX)));
   if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX)))
     {
       if (XINT (AREF (font, FONT_AVGWIDTH_INDEX)) == 0)

=== modified file 'src/font.h'
--- a/src/font.h        2011-04-13 23:22:35 +0000
+++ b/src/font.h        2011-04-25 19:40:22 +0000
@@ -254,8 +254,7 @@
 
 struct font_spec
 {
-  EMACS_UINT size;
-  struct Lisp_Vector *next;
+  struct vectorlike_header header;
   Lisp_Object props[FONT_SPEC_MAX];
 };
 
@@ -263,8 +262,7 @@
 
 struct font_entity
 {
-  EMACS_UINT size;
-  struct Lisp_Vector *next;
+  struct vectorlike_header header;
   Lisp_Object props[FONT_ENTITY_MAX];
 };
 
@@ -277,8 +275,7 @@
 
 struct font
 {
-  EMACS_UINT size;
-  struct Lisp_Vector *next;
+  struct vectorlike_header header;
 
   /* All Lisp_Object components must come first.
      That ensures they are all aligned normally.  */

=== modified file 'src/frame.c'
--- a/src/frame.c       2011-04-16 08:36:41 +0000
+++ b/src/frame.c       2011-04-19 01:15:59 +0000
@@ -2154,16 +2154,12 @@
 static int
 frame_name_fnn_p (char *str, EMACS_INT len)
 {
-  if (len > 1 && str[0] == 'F')
+  if (len > 1 && str[0] == 'F' && '0' <= str[1] && str[1] <= '9')
     {
-      char *end_ptr;
-      long int n;
-      errno = 0;
-      n = strtol (str + 1, &end_ptr, 10);
-
-      if (end_ptr == str + len
-         && INT_MIN <= n && n <= INT_MAX
-         && ((LONG_MIN < n && n < LONG_MAX) || errno != ERANGE))
+      char *p = str + 2;
+      while ('0' <= *p && *p <= '9')
+       p++;
+      if (p == str + len)
        return 1;
     }
   return 0;

=== modified file 'src/frame.h'
--- a/src/frame.h       2011-04-16 08:36:41 +0000
+++ b/src/frame.h       2011-04-25 19:40:22 +0000
@@ -82,8 +82,7 @@
 
 struct frame
 {
-  EMACS_UINT size;
-  struct Lisp_Vector *next;
+  struct vectorlike_header header;
 
   /* All Lisp_Object components must come first.
      That ensures they are all aligned normally.  */

=== modified file 'src/fringe.c'
--- a/src/fringe.c      2011-04-13 23:38:13 +0000
+++ b/src/fringe.c      2011-04-25 21:34:39 +0000
@@ -1531,7 +1531,7 @@
   if (STRINGP (bits))
     h = SCHARS (bits);
   else if (VECTORP (bits))
-    h = XVECTOR (bits)->size;
+    h = ASIZE (bits);
   else
     wrong_type_argument (Qsequencep, bits);
 

=== modified file 'src/gnutls.c'
--- a/src/gnutls.c      2011-04-26 12:59:12 +0000
+++ b/src/gnutls.c      2011-04-26 17:50:51 +0000
@@ -133,7 +133,7 @@
 emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf,
                     EMACS_INT nbyte)
 {
-  ssize_t rtnval;
+  ssize_t rtnval = 0;
   EMACS_INT bytes_written;
   gnutls_session_t state = proc->gnutls_state;
 
@@ -202,7 +202,7 @@
   Lisp_Object gnutls_log_level = Fsymbol_value (Qgnutls_log_level);
   int max_log_level = 0;
 
-  int alert, ret;
+  int ret;
   const char *str;
 
   /* TODO: use a Lisp_Object generated by gnutls_make_error?  */
@@ -249,9 +249,9 @@
    simply the integer value of the error.  GNUTLS_E_SUCCESS is mapped
    to Qt.  */
 static Lisp_Object
-gnutls_make_error (int error)
+gnutls_make_error (int err)
 {
-  switch (error)
+  switch (err)
     {
     case GNUTLS_E_SUCCESS:
       return Qt;
@@ -263,7 +263,7 @@
       return Qgnutls_e_invalid_session;
     }
 
-  return make_number (error);
+  return make_number (err);
 }
 
 DEFUN ("gnutls-get-initstage", Fgnutls_get_initstage, Sgnutls_get_initstage, 
1, 1, 0,
@@ -383,6 +383,7 @@
   return gnutls_make_error (ret);
 }
 
+#if 0
 /* Deinitializes global GnuTLS state.
 See also `gnutls-global-init'.  */
 static Lisp_Object
@@ -395,6 +396,7 @@
 
   return gnutls_make_error (GNUTLS_E_SUCCESS);
 }
+#endif
 
 DEFUN ("gnutls-boot", Fgnutls_boot, Sgnutls_boot, 3, 3, 0,
        doc: /* Initialize GnuTLS client for process PROC with TYPE+PROPLIST.
@@ -461,20 +463,20 @@
   gnutls_certificate_credentials_t x509_cred;
   gnutls_anon_client_credentials_t anon_cred;
   Lisp_Object global_init;
-  char* priority_string_ptr = "NORMAL"; /* default priority string.  */
+  char const *priority_string_ptr = "NORMAL"; /* default priority string.  */
   Lisp_Object tail;
-  int peer_verification;
+  unsigned int peer_verification;
   char* c_hostname;
 
   /* Placeholders for the property list elements.  */
   Lisp_Object priority_string;
   Lisp_Object trustfiles;
   Lisp_Object keyfiles;
-  Lisp_Object callbacks;
+  /* Lisp_Object callbacks; */
   Lisp_Object loglevel;
   Lisp_Object hostname;
   Lisp_Object verify_flags;
-  Lisp_Object verify_error;
+  /* Lisp_Object verify_error; */
   Lisp_Object verify_hostname_error;
 
   CHECK_PROCESS (proc);
@@ -485,10 +487,10 @@
   priority_string       = Fplist_get (proplist, Qgnutls_bootprop_priority);
   trustfiles            = Fplist_get (proplist, Qgnutls_bootprop_trustfiles);
   keyfiles              = Fplist_get (proplist, Qgnutls_bootprop_keyfiles);
-  callbacks             = Fplist_get (proplist, Qgnutls_bootprop_callbacks);
+  /* callbacks          = Fplist_get (proplist, Qgnutls_bootprop_callbacks); */
   loglevel              = Fplist_get (proplist, Qgnutls_bootprop_loglevel);
   verify_flags          = Fplist_get (proplist, Qgnutls_bootprop_verify_flags);
-  verify_error          = Fplist_get (proplist, Qgnutls_bootprop_verify_error);
+  /* verify_error    = Fplist_get (proplist, Qgnutls_bootprop_verify_error); */
   verify_hostname_error = Fplist_get (proplist, 
Qgnutls_bootprop_verify_hostname_error);
 
   if (!STRINGP (hostname))
@@ -596,10 +598,10 @@
           if (STRINGP (trustfile))
             {
               GNUTLS_LOG2 (1, max_log_level, "setting the trustfile: ",
-                           SDATA (trustfile));
+                           SSDATA (trustfile));
               ret = gnutls_certificate_set_x509_trust_file
                 (x509_cred,
-                 SDATA (trustfile),
+                 SSDATA (trustfile),
                  file_format);
 
               if (ret < GNUTLS_E_SUCCESS)
@@ -618,10 +620,10 @@
           if (STRINGP (keyfile))
             {
               GNUTLS_LOG2 (1, max_log_level, "setting the keyfile: ",
-                           SDATA (keyfile));
+                           SSDATA (keyfile));
               ret = gnutls_certificate_set_x509_crl_file
                 (x509_cred,
-                 SDATA (keyfile),
+                 SSDATA (keyfile),
                  file_format);
 
               if (ret < GNUTLS_E_SUCCESS)
@@ -717,19 +719,19 @@
 
   if (ret < GNUTLS_E_SUCCESS)
     return gnutls_make_error (ret);
-  
+
   if (XINT (loglevel) > 0 && peer_verification & GNUTLS_CERT_INVALID)
-    message ("%s certificate could not be verified.", 
+    message ("%s certificate could not be verified.",
              c_hostname);
- 
+
  if (peer_verification & GNUTLS_CERT_REVOKED)
    GNUTLS_LOG2 (1, max_log_level, "certificate was revoked (CRL):",
                 c_hostname);
- 
+
  if (peer_verification & GNUTLS_CERT_SIGNER_NOT_FOUND)
    GNUTLS_LOG2 (1, max_log_level, "certificate signer was not found:",
                 c_hostname);
- 
+
  if (peer_verification & GNUTLS_CERT_SIGNER_NOT_CA)
    GNUTLS_LOG2 (1, max_log_level, "certificate signer is not a CA:",
                 c_hostname);
@@ -771,7 +773,7 @@
       if (ret < GNUTLS_E_SUCCESS)
         return gnutls_make_error (ret);
 
-      gnutls_verify_cert_list = 
+      gnutls_verify_cert_list =
         gnutls_certificate_get_peers (state, &gnutls_verify_cert_list_size);
 
       if (NULL == gnutls_verify_cert_list)

=== modified file 'src/gtkutil.c'
--- a/src/gtkutil.c     2011-04-02 02:39:52 +0000
+++ b/src/gtkutil.c     2011-04-19 07:10:55 +0000
@@ -81,8 +81,10 @@
   gdk_window_get_geometry (w, a, b, c, d, 0)
 #define gdk_x11_window_lookup_for_display(d, w) \
   gdk_xid_table_lookup_for_display (d, w)
+#ifndef GDK_KEY_g
 #define GDK_KEY_g GDK_g
 #endif
+#endif
 
 #define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
 
@@ -703,7 +705,7 @@
      hierarchy-changed.  */
   gtk_tooltip_set_custom (x->ttip_widget, widget);
 
-  gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string));
+  gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
   gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
   if (width) *width = req.width;
   if (height) *height = req.height;
@@ -3527,6 +3529,7 @@
       gdouble shown;
       gdouble top;
       int size, value;
+      int old_size;
       int new_step;
       int changed = 0;
 
@@ -3559,15 +3562,19 @@
       /* Assume all lines are of equal size.  */
       new_step = size / max (1, FRAME_LINES (f));
 
-      if ((int) gtk_adjustment_get_page_size (adj) != size
-          || (int) gtk_adjustment_get_step_increment (adj) != new_step)
-        {
-          gtk_adjustment_set_page_size (adj, size);
-          gtk_adjustment_set_step_increment (adj, new_step);
-          /* Assume a page increment is about 95% of the page size  */
-          gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
-          changed = 1;
-        }
+      old_size = gtk_adjustment_get_page_size (adj);
+      if (old_size != size)
+       {
+         int old_step = gtk_adjustment_get_step_increment (adj);
+         if (old_step != new_step)
+           {
+             gtk_adjustment_set_page_size (adj, size);
+             gtk_adjustment_set_step_increment (adj, new_step);
+             /* Assume a page increment is about 95% of the page size  */
+             gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
+             changed = 1;
+           }
+       }
 
       if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
       {

=== modified file 'src/image.c'
--- a/src/image.c       2011-04-14 19:34:42 +0000
+++ b/src/image.c       2011-04-25 21:34:39 +0000
@@ -2359,7 +2359,7 @@
          int i;
 
          /* Number of elements of the vector must be >= height.  */
-         if (XVECTOR (data)->size < height)
+         if (ASIZE (data) < height)
            return 0;
 
          /* Each string or bool-vector in data must be large enough
@@ -8398,7 +8398,7 @@
     }
   else if (VECTORP (tem))
     {
-      if (XVECTOR (tem)->size != 4)
+      if (ASIZE (tem) != 4)
        return 0;
       for (i = 0; i < 4; ++i)
        if (!INTEGERP (XVECTOR (tem)->contents[i]))

=== modified file 'src/indent.c'
--- a/src/indent.c      2011-04-16 18:26:30 +0000
+++ b/src/indent.c      2011-04-25 21:34:39 +0000
@@ -93,7 +93,7 @@
   /* Everything can be handled by the display table, if it's
      present and the element is right.  */
   if (dp && (elt = DISP_CHAR_VECTOR (dp, c), VECTORP (elt)))
-    return XVECTOR (elt)->size;
+    return ASIZE (elt);
 
   /* Some characters are special.  */
   if (c == '\n' || c == '\t' || c == '\015')
@@ -121,7 +121,7 @@
 {
   int i;
 
-  if (widthtab->size != 256)
+  if (widthtab->header.size != 256)
     abort ();
 
   for (i = 0; i < 256; i++)
@@ -143,7 +143,7 @@
   if (!VECTORP (BVAR (buf, width_table)))
     BVAR (buf, width_table) = Fmake_vector (make_number (256), make_number 
(0));
   widthtab = XVECTOR (BVAR (buf, width_table));
-  if (widthtab->size != 256)
+  if (widthtab->header.size != 256)
     abort ();
 
   for (i = 0; i < 256; i++)
@@ -284,7 +284,7 @@
     else                                                               \
       {                                                                        
\
        if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch)))             \
-         width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size;            \
+         width = ASIZE (DISP_CHAR_VECTOR (dp, ch));                    \
        else                                                            \
          width = CHAR_WIDTH (ch);                                      \
       }                                                                        
\
@@ -766,7 +766,7 @@
 
       c = *--ptr;
       if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
-       col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
+       col += ASIZE (DISP_CHAR_VECTOR (dp, c));
       else if (c >= 040 && c < 0177)
        col++;
       else if (c == '\n')
@@ -1127,7 +1127,7 @@
        : !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
   int selective_rlen
     = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
-       ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
+       ? ASIZE (DISP_INVIS_VECTOR (dp)) : 0);
   /* The next location where the `invisible' property changes, or an
      overlay starts or ends.  */
   EMACS_INT next_boundary = from;

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2011-04-16 18:26:30 +0000
+++ b/src/intervals.c   2011-04-20 08:30:52 +0000
@@ -39,6 +39,7 @@
 
 #include <config.h>
 #include <setjmp.h>
+#include <intprops.h>
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
@@ -778,7 +779,7 @@
              i = i->right;             /* Move to the right child */
            }
          else if (NULL_PARENT (i))
-           error ("Point %"pEd" after end of properties", pos);
+           error ("Point %"pI"d after end of properties", pos);
          else
             i = INTERVAL_PARENT (i);
          continue;
@@ -1313,7 +1314,7 @@
    Do this by recursing down TREE to the interval in question, and
    deleting the appropriate amount of text.  */
 
-static EMACS_UINT
+static EMACS_INT
 interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from,
                              register EMACS_INT amount)
 {
@@ -1325,9 +1326,9 @@
   /* Left branch */
   if (relative_position < LEFT_TOTAL_LENGTH (tree))
     {
-      EMACS_UINT subtract = interval_deletion_adjustment (tree->left,
-                                                         relative_position,
-                                                         amount);
+      EMACS_INT subtract = interval_deletion_adjustment (tree->left,
+                                                        relative_position,
+                                                        amount);
       tree->total_length -= subtract;
       CHECK_TOTAL_LENGTH (tree);
       return subtract;
@@ -1336,7 +1337,7 @@
   else if (relative_position >= (TOTAL_LENGTH (tree)
                                 - RIGHT_TOTAL_LENGTH (tree)))
     {
-      EMACS_UINT subtract;
+      EMACS_INT subtract;
 
       relative_position -= (tree->total_length
                            - RIGHT_TOTAL_LENGTH (tree));
@@ -1378,7 +1379,7 @@
 adjust_intervals_for_deletion (struct buffer *buffer,
                               EMACS_INT start, EMACS_INT length)
 {
-  register EMACS_UINT left_to_delete = length;
+  register EMACS_INT left_to_delete = length;
   register INTERVAL tree = BUF_INTERVALS (buffer);
   Lisp_Object parent;
   EMACS_INT offset;
@@ -1435,7 +1436,10 @@
   if (length > 0)
     adjust_intervals_for_insertion (BUF_INTERVALS (buffer), start, length);
   else
-    adjust_intervals_for_deletion (buffer, start, -length);
+    {
+      IF_LINT (if (length < - TYPE_MAXIMUM (EMACS_INT)) abort ();)
+      adjust_intervals_for_deletion (buffer, start, -length);
+    }
 }
 
 /* Merge interval I with its lexicographic successor. The resulting

=== modified file 'src/intervals.h'
--- a/src/intervals.h   2011-04-16 18:26:30 +0000
+++ b/src/intervals.h   2011-04-20 08:04:17 +0000
@@ -27,8 +27,8 @@
 {
   /* The first group of entries deal with the tree structure.  */
 
-  EMACS_UINT total_length;      /* Length of myself and both children.  */
-  EMACS_UINT position;         /* Cache of interval's character position.  */
+  EMACS_INT total_length;       /* Length of myself and both children.  */
+  EMACS_INT position;          /* Cache of interval's character position.  */
                                /* This field is usually updated
                                   simultaneously with an interval
                                   traversal, there is no guarantee
@@ -164,7 +164,7 @@
 #define CHECK_TOTAL_LENGTH(i)               \
   do                                        \
     {                                       \
-      if ((EMACS_INT) (i)->total_length < 0) \
+      if ((i)->total_length < 0)            \
        abort ();                            \
     }                                       \
   while (0)

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2011-04-26 14:02:55 +0000
+++ b/src/keyboard.c    2011-04-26 18:02:10 +0000
@@ -134,7 +134,7 @@
 static int raw_keybuf_count;
 
 #define GROW_RAW_KEYBUF                                                        
\
- if (raw_keybuf_count == XVECTOR (raw_keybuf)->size)                   \
+ if (raw_keybuf_count == ASIZE (raw_keybuf))                           \
    raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil)  \
 
 /* Number of elements of this_command_keys
@@ -2898,7 +2898,7 @@
       if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
           && SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > 
(unsigned) XFASTINT (c))
          || (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
-             && XVECTOR (KVAR (current_kboard, 
Vkeyboard_translate_table))->size > (unsigned) XFASTINT (c))
+             && ASIZE (KVAR (current_kboard, Vkeyboard_translate_table)) > 
(unsigned) XFASTINT (c))
          || (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
              && CHARACTERP (c)))
        {
@@ -3313,7 +3313,7 @@
          if (XUINT (c) < 0x100)
            putc (XINT (c), dribble);
          else
-           fprintf (dribble, " 0x%x", (int) XUINT (c));
+           fprintf (dribble, " 0x%"pI"x", XUINT (c));
        }
       else
        {
@@ -4198,7 +4198,7 @@
 
       timer = XCAR (timers);
 
-      if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+      if (!VECTORP (timer) || ASIZE (timer) != 8)
        continue;
       XVECTOR (timer)->contents[0] = Qnil;
     }
@@ -4293,7 +4293,7 @@
       if (CONSP (timers))
        {
          timer = XCAR (timers);
-         if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+         if (!VECTORP (timer) || ASIZE (timer) != 8)
            {
              timers = XCDR (timers);
              continue;
@@ -4311,7 +4311,7 @@
       if (CONSP (idle_timers))
        {
          timer = XCAR (idle_timers);
-         if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+         if (!VECTORP (timer) || ASIZE (timer) != 8)
            {
              idle_timers = XCDR (idle_timers);
              continue;
@@ -5459,7 +5459,7 @@
                /* Find the menu bar item under `column'.  */
                item = Qnil;
                items = FRAME_MENU_BAR_ITEMS (f);
-               for (i = 0; i < XVECTOR (items)->size; i += 4)
+               for (i = 0; i < ASIZE (items); i += 4)
                  {
                    Lisp_Object pos, string;
                    string = AREF (items, i + 1);
@@ -5652,7 +5652,7 @@
                                      Qmouse_click, Vlispy_mouse_stem,
                                      NULL,
                                      &mouse_syms,
-                                     XVECTOR (mouse_syms)->size);
+                                     ASIZE (mouse_syms));
          if (event->modifiers & drag_modifier)
            return Fcons (head,
                          Fcons (start_pos,
@@ -5823,7 +5823,7 @@
                                    Qmouse_click,
                                    Vlispy_mouse_stem,
                                    NULL, &mouse_syms,
-                                   XVECTOR (mouse_syms)->size);
+                                   ASIZE (mouse_syms));
        return Fcons (head, Fcons (position, Qnil));
       }
 
@@ -5943,7 +5943,7 @@
                                    Qmouse_click, Vlispy_mouse_stem,
                                    NULL,
                                    &mouse_syms,
-                                   XVECTOR (mouse_syms)->size);
+                                   ASIZE (mouse_syms));
 
        if (event->modifiers & drag_modifier)
          return Fcons (head,
@@ -6422,7 +6422,7 @@
   else
     {
       if (! VECTORP (*symbol_table)
-         || XVECTOR (*symbol_table)->size != table_size)
+         || ASIZE (*symbol_table) != table_size)
        {
          Lisp_Object size;
 
@@ -6443,8 +6443,8 @@
        {
          int len = SBYTES (name_alist_or_stem);
          char *buf = (char *) alloca (len + 50);
-          sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
-                   (long) XINT (symbol_int) + 1);
+          sprintf (buf, "%s-%"pI"d", SDATA (name_alist_or_stem),
+                   XINT (symbol_int) + 1);
          value = intern (buf);
        }
       else if (name_table != 0 && name_table[symbol_num])
@@ -6462,7 +6462,7 @@
       if (NILP (value))
        {
          char buf[20];
-         sprintf (buf, "key-%ld", (long)symbol_num);
+         sprintf (buf, "key-%"pI"d", symbol_num);
          value = intern (buf);
        }
 
@@ -7228,13 +7228,13 @@
 {
   int old_errno = errno;
   struct user_signal_info *p;
-  const char* special_event_name = NULL;
+  const char *special_event_name = NULL;
 
   SIGNAL_THREAD_CHECK (sig);
-  
+
   if (SYMBOLP (Vdebug_on_event))
-    special_event_name = SDATA (SYMBOL_NAME (Vdebug_on_event));
-  
+    special_event_name = SSDATA (SYMBOL_NAME (Vdebug_on_event));
+
   for (p = user_signals; p; p = p->next)
     if (p->sig == sig)
       {
@@ -7250,7 +7250,7 @@
             /* Eat the event.  */
             break;
           }
-        
+
        p->npending++;
 #ifdef SIGIO
        if (interrupt_input)
@@ -7496,7 +7496,7 @@
   /* Add nil, nil, nil, nil at the end.  */
   {
     int i = menu_bar_items_index;
-    if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
+    if (i + 4 > ASIZE (menu_bar_items_vector))
       menu_bar_items_vector =
        larger_vector (menu_bar_items_vector, 2 * i, Qnil);
     /* Add this item.  */
@@ -7568,7 +7568,7 @@
   if (i == menu_bar_items_index)
     {
       /* If vector is too small, get a bigger one.  */
-      if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
+      if (i + 4 > ASIZE (menu_bar_items_vector))
        menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, 
Qnil);
       /* Add this item.  */
       XVECTOR (menu_bar_items_vector)->contents[i++] = key;
@@ -8236,7 +8236,7 @@
        }
       else if (EQ (ikey, QCimage)
               && (CONSP (value)
-                  || (VECTORP (value) && XVECTOR (value)->size == 4)))
+                  || (VECTORP (value) && ASIZE (value) == 4)))
        /* Value is either a single image specification or a vector
           of 4 such specifications for the different button states.  */
        PROP (TOOL_BAR_ITEM_IMAGES) = value;
@@ -8340,10 +8340,10 @@
 
   /* Enlarge tool_bar_items_vector if necessary.  */
   if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
-      >= XVECTOR (tool_bar_items_vector)->size)
+      >= ASIZE (tool_bar_items_vector))
     tool_bar_items_vector
       = larger_vector (tool_bar_items_vector,
-                      2 * XVECTOR (tool_bar_items_vector)->size, Qnil);
+                      2 * ASIZE (tool_bar_items_vector), Qnil);
 
   /* Append entries from tool_bar_item_properties to the end of
      tool_bar_items_vector.  */
@@ -8665,7 +8665,7 @@
                }
 
              /* Move past this element.  */
-             if (idx >= 0 && idx + 1 >= XVECTOR (vector)->size)
+             if (idx >= 0 && idx + 1 >= ASIZE (vector))
                /* Handle reaching end of dense table.  */
                idx = -1;
              if (idx >= 0)
@@ -9943,7 +9943,7 @@
              /* Treat uppercase keys as shifted.  */
              || (INTEGERP (key)
                  && (KEY_TO_CHAR (key)
-                     < XCHAR_TABLE (BVAR (current_buffer, 
downcase_table))->size)
+                     < XCHAR_TABLE (BVAR (current_buffer, 
downcase_table))->header.size)
                  && uppercasep (KEY_TO_CHAR (key))))
            {
              Lisp_Object new_key
@@ -10309,7 +10309,7 @@
     this_single_command_key_start = 0;
 
     keys = XVECTOR (saved_keys)->contents;
-    for (i = 0; i < XVECTOR (saved_keys)->size; i++)
+    for (i = 0; i < ASIZE (saved_keys); i++)
       add_command_key (keys[i]);
 
     for (i = 0; i < SCHARS (function); i++)
@@ -10602,7 +10602,7 @@
 
   if (NILP (keep_record))
     {
-      for (i = 0; i < XVECTOR (recent_keys)->size; ++i)
+      for (i = 0; i < ASIZE (recent_keys); ++i)
        XVECTOR (recent_keys)->contents[i] = Qnil;
       total_keys = 0;
       recent_keys_index = 0;

=== modified file 'src/keymap.c'
--- a/src/keymap.c      2011-04-14 19:34:42 +0000
+++ b/src/keymap.c      2011-04-25 21:34:39 +0000
@@ -359,7 +359,7 @@
                                XCDR (XCAR (list)));
 
       if (VECTORP (XCAR (list)))
-       for (i = 0; i < XVECTOR (XCAR (list))->size; i++)
+       for (i = 0; i < ASIZE (XCAR (list)); i++)
          if (CONSP (XVECTOR (XCAR (list))->contents[i]))
            fix_submap_inheritance (keymap, make_number (i),
                                    XVECTOR (XCAR (list))->contents[i]);
@@ -2226,7 +2226,7 @@
   if (STRINGP (list))
     size = SCHARS (list);
   else if (VECTORP (list))
-    size = XVECTOR (list)->size;
+    size = ASIZE (list);
   else if (CONSP (list))
     size = XINT (Flength (list));
   else
@@ -3125,7 +3125,7 @@
 
          elt = XCAR (list);
          elt_prefix = Fcar (elt);
-         if (XVECTOR (elt_prefix)->size >= 1)
+         if (ASIZE (elt_prefix) >= 1)
            {
              tem = Faref (elt_prefix, make_number (0));
              if (EQ (tem, Qmenu_bar))
@@ -3168,7 +3168,7 @@
          /* If the sequence by which we reach this keymap is zero-length,
             then the shadow map for this keymap is just SHADOW.  */
          if ((STRINGP (elt_prefix) && SCHARS (elt_prefix) == 0)
-             || (VECTORP (elt_prefix) && XVECTOR (elt_prefix)->size == 0))
+             || (VECTORP (elt_prefix) && ASIZE (elt_prefix) == 0))
            ;
          /* If the sequence by which we reach this keymap actually has
             some elements, then the sequence's definition in SHADOW is
@@ -3592,7 +3592,7 @@
   if (CHAR_TABLE_P (vector))
     stop = MAX_5_BYTE_CHAR + 1, to = MAX_CHAR + 1;
   else
-    stop = to = XVECTOR (vector)->size;
+    stop = to = ASIZE (vector);
 
   for (i = from; ; i++)
     {

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2011-04-26 11:26:05 +0000
+++ b/src/lisp.h        2011-04-26 19:14:07 +0000
@@ -38,7 +38,7 @@
 #ifndef EMACS_INT
 #define EMACS_INT long
 #define BITS_PER_EMACS_INT BITS_PER_LONG
-#define pEd "ld"
+#define pI "l"
 #endif
 #ifndef EMACS_UINT
 #define EMACS_UINT unsigned long
@@ -47,7 +47,7 @@
 #ifndef EMACS_INT
 #define EMACS_INT int
 #define BITS_PER_EMACS_INT BITS_PER_INT
-#define pEd "d"
+#define pI ""
 #endif
 #ifndef EMACS_UINT
 #define EMACS_UINT unsigned int
@@ -601,17 +601,30 @@
 
 /* Pseudovector types.  */
 
-#define XSETPVECTYPE(v,code) ((v)->size |= PSEUDOVECTOR_FLAG | (code))
+#define XSETPVECTYPE(v, code) XSETTYPED_PVECTYPE(v, header.size, code)
+#define XSETTYPED_PVECTYPE(v, size_member, code) \
+  ((v)->size_member |= PSEUDOVECTOR_FLAG | (code))
+#define XSETPVECTYPESIZE(v, code, sizeval) \
+  ((v)->header.size = PSEUDOVECTOR_FLAG | (code) | (sizeval))
+
+/* The cast to struct vectorlike_header * avoids aliasing issues.  */
 #define XSETPSEUDOVECTOR(a, b, code) \
+  XSETTYPED_PSEUDOVECTOR(a, b,       \
+                        ((struct vectorlike_header *) XPNTR (a))->size, \
+                        code)
+#define XSETTYPED_PSEUDOVECTOR(a, b, size, code)                       \
   (XSETVECTOR (a, b),                                                  \
-   eassert ((XVECTOR (a)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
+   eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK))              \
            == (PSEUDOVECTOR_FLAG | (code))))
+
 #define XSETWINDOW_CONFIGURATION(a, b) \
   (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
 #define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
 #define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
 #define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL))
-#define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
+/* XSETSUBR is special since Lisp_Subr lacks struct vectorlike_header.  */
+#define XSETSUBR(a, b) \
+  XSETTYPED_PSEUDOVECTOR (a, b, XSUBR (a)->size, PVEC_SUBR)
 #define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
 #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
 #define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
@@ -621,7 +634,7 @@
 /* Convenience macros for dealing with Lisp arrays.  */
 
 #define AREF(ARRAY, IDX)       XVECTOR ((ARRAY))->contents[IDX]
-#define ASIZE(ARRAY)           XVECTOR ((ARRAY))->size
+#define ASIZE(ARRAY)           XVECTOR ((ARRAY))->header.size
 /* The IDX==IDX tries to detect when the macro argument is side-effecting.  */
 #define ASET(ARRAY, IDX, VAL)  \
   (eassert ((IDX) == (IDX)),                           \
@@ -778,10 +791,30 @@
     unsigned char *data;
   };
 
+/* Header of vector-like objects.  This documents the layout constraints on
+   vectors and pseudovectors other than struct Lisp_Subr.  It also prevents
+   compilers from being fooled by Emacs's type punning: the XSETPSEUDOVECTOR
+   and PSEUDOVECTORP macros cast their pointers to struct vectorlike_header *,
+   because when two such pointers potentially alias, a compiler won't
+   incorrectly reorder loads and stores to their size fields.  See
+   <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>.  */
+struct vectorlike_header
+  {
+    EMACS_UINT size;
+
+    /* Pointer to the next vector-like object.  It is generally a buffer or a
+       Lisp_Vector alias, so for convenience it is a union instead of a
+       pointer: this way, one can write P->next.vector instead of ((struct
+       Lisp_Vector *) P->next).  */
+    union {
+      struct buffer *buffer;
+      struct Lisp_Vector *vector;
+    } next;
+  };
+
 struct Lisp_Vector
   {
-    EMACS_UINT size;
-    struct Lisp_Vector *next;
+    struct vectorlike_header header;
     Lisp_Object contents[1];
   };
 
@@ -817,7 +850,7 @@
 /* Return the number of "extra" slots in the char table CT.  */
 
 #define CHAR_TABLE_EXTRA_SLOTS(CT)     \
-  (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
+  (((CT)->header.size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
 
 #ifdef __GNUC__
 
@@ -882,12 +915,11 @@
 
 struct Lisp_Char_Table
   {
-    /* This is the vector's size field, which also holds the
+    /* HEADER.SIZE is the vector's size field, which also holds the
        pseudovector type information.  It holds the size, too.
        The size counts the defalt, parent, purpose, ascii,
        contents, and extras slots.  */
-    EMACS_UINT size;
-    struct Lisp_Vector *next;
+    struct vectorlike_header header;
 
     /* This holds a default value,
        which is used whenever the value for a specific character is nil.  */
@@ -914,10 +946,9 @@
 
 struct Lisp_Sub_Char_Table
   {
-    /* This is the vector's size field, which also holds the
+    /* HEADER.SIZE is the vector's size field, which also holds the
        pseudovector type information.  It holds the size, too.  */
-    EMACS_INT size;
-    struct Lisp_Vector *next;
+    struct vectorlike_header header;
 
     /* Depth of this sub char-table.  It should be 1, 2, or 3.  A sub
        char-table of depth 1 contains 16 elements, and each element
@@ -936,10 +967,9 @@
 /* A boolvector is a kind of vectorlike, with contents are like a string.  */
 struct Lisp_Bool_Vector
   {
-    /* This is the vector's size field.  It doesn't have the real size,
+    /* HEADER.SIZE is the vector's size field.  It doesn't have the real size,
        just the subtype information.  */
-    EMACS_UINT vector_size;
-    struct Lisp_Vector *next;
+    struct vectorlike_header header;
     /* This is the size in bits.  */
     EMACS_UINT size;
     /* This contains the actual bits, packed into bytes.  */
@@ -952,7 +982,7 @@
 
    This type is treated in most respects as a pseudovector,
    but since we never dynamically allocate or free them,
-   we don't need a next-vector field.  */
+   we don't need a struct vectorlike_header and its 'next' field.  */
 
 struct Lisp_Subr
   {
@@ -1099,9 +1129,8 @@
 
 struct Lisp_Hash_Table
 {
-  /* Vector fields.  The hash table code doesn't refer to these.  */
-  EMACS_UINT size;
-  struct Lisp_Vector *vec_next;
+  /* This is for Lisp; the hash table code does not refer to it.  */
+  struct vectorlike_header header;
 
   /* Function used to compare keys.  */
   Lisp_Object test;
@@ -1202,7 +1231,7 @@
 
 /* Value is the size of hash table H.  */
 
-#define HASH_TABLE_SIZE(H) XVECTOR ((H)->next)->size
+#define HASH_TABLE_SIZE(H) ASIZE ((H)->next)
 
 /* Default size for hash tables if not specified.  */
 
@@ -1620,7 +1649,7 @@
 #define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
 
 #define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
-#define VECTORP(x)    (VECTORLIKEP (x) && !(XVECTOR (x)->size & 
PSEUDOVECTOR_FLAG))
+#define VECTORP(x) (VECTORLIKEP (x) && !(ASIZE (x) & PSEUDOVECTOR_FLAG))
 #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
 #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
 #define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
@@ -1631,10 +1660,17 @@
 #define BUFFER_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Buffer_Obj)
 #define KBOARD_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Kboard_Obj)
 
-/* True if object X is a pseudovector whose code is CODE.  */
+/* True if object X is a pseudovector whose code is CODE.  The cast to struct
+   vectorlike_header * avoids aliasing issues.  */
 #define PSEUDOVECTORP(x, code)                                 \
+  TYPED_PSEUDOVECTORP(x, vectorlike_header, code)
+
+/* True if object X, with internal type struct T *, is a pseudovector whose
+   code is CODE.  */
+#define TYPED_PSEUDOVECTORP(x, t, code)                                \
   (VECTORLIKEP (x)                                             \
-   && (((XVECTOR (x)->size & (PSEUDOVECTOR_FLAG | (code))))    \
+   && (((((struct t *) XPNTR (x))->size                                \
+        & (PSEUDOVECTOR_FLAG | (code))))                       \
        == (PSEUDOVECTOR_FLAG | (code))))
 
 /* Test for specific pseudovector types.  */
@@ -1642,7 +1678,8 @@
 #define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS)
 #define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
 #define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL)
-#define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
+/* SUBRP is special since Lisp_Subr lacks struct vectorlike_header.  */
+#define SUBRP(x) TYPED_PSEUDOVECTORP (x, Lisp_Subr, PVEC_SUBR)
 #define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
 #define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
 #define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
@@ -2785,7 +2822,7 @@
   } while (0)
 extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
                   Lisp_Object *, Lisp_Object);
-extern int isfloat_string (const char *, int);
+Lisp_Object string_to_number (char const *, int, int);
 extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
                          Lisp_Object);
 extern void dir_warning (const char *, Lisp_Object);

=== modified file 'src/lread.c'
--- a/src/lread.c       2011-04-14 05:04:02 +0000
+++ b/src/lread.c       2011-04-25 21:34:39 +0000
@@ -19,6 +19,7 @@
 
 
 #include <config.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1411,16 +1412,16 @@
 openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object 
*storeptr, Lisp_Object predicate)
 {
   register int fd;
-  int fn_size = 100;
+  EMACS_INT fn_size = 100;
   char buf[100];
   register char *fn = buf;
   int absolute = 0;
-  int want_size;
+  EMACS_INT want_length;
   Lisp_Object filename;
   struct stat st;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   Lisp_Object string, tail, encoded_fn;
-  int max_suffix_len = 0;
+  EMACS_INT max_suffix_len = 0;
 
   CHECK_STRING (str);
 
@@ -1454,11 +1455,11 @@
            continue;
        }
 
-      /* Calculate maximum size of any filename made from
+      /* Calculate maximum length of any filename made from
         this path element/specified file name and any possible suffix.  */
-      want_size = max_suffix_len + SBYTES (filename) + 1;
-      if (fn_size < want_size)
-       fn = (char *) alloca (fn_size = 100 + want_size);
+      want_length = max_suffix_len + SBYTES (filename);
+      if (fn_size <= want_length)
+       fn = (char *) alloca (fn_size = 100 + want_length);
 
       /* Loop over suffixes.  */
       for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : 
suffixes;
@@ -2429,7 +2430,7 @@
            {
              Lisp_Object tmp;
              tmp = read_vector (readcharfun, 0);
-             if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS)
+             if (ASIZE (tmp) < CHAR_TABLE_STANDARD_SLOTS)
                error ("Invalid size char-table");
              XSETPVECTYPE (XVECTOR (tmp), PVEC_CHAR_TABLE);
              return tmp;
@@ -2448,7 +2449,7 @@
                  depth = XINT (AREF (tmp, 0));
                  if (depth < 1 || depth > 3)
                    error ("Invalid depth in char-table");
-                 size = XVECTOR (tmp)->size - 2;
+                 size = ASIZE (tmp) - 2;
                  if (chartab_size [depth] != size)
                    error ("Invalid size char-table");
                  XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE);
@@ -2498,7 +2499,7 @@
             build them using function calls.  */
          Lisp_Object tmp;
          tmp = read_vector (readcharfun, 1);
-         return Fmake_byte_code (XVECTOR (tmp)->size,
+         return Fmake_byte_code (ASIZE (tmp),
                                  XVECTOR (tmp)->contents);
        }
       if (c == '(')
@@ -3005,86 +3006,9 @@
 
        if (!quoted && !uninterned_symbol)
          {
-           register char *p1;
-           p1 = read_buffer;
-           if (*p1 == '+' || *p1 == '-') p1++;
-           /* Is it an integer? */
-           if (p1 != p)
-             {
-               while (p1 != p && (c = *p1) >= '0' && c <= '9') p1++;
-               /* Integers can have trailing decimal points.  */
-               if (p1 > read_buffer && p1 < p && *p1 == '.') p1++;
-               if (p1 == p)
-                 /* It is an integer. */
-                 {
-                   if (p1[-1] == '.')
-                     p1[-1] = '\0';
-                   {
-                     /* EMACS_INT n = atol (read_buffer); */
-                     char *endptr = NULL;
-                     EMACS_INT n = (errno = 0,
-                                    strtol (read_buffer, &endptr, 10));
-                     if (errno == ERANGE && endptr)
-                       {
-                         Lisp_Object args
-                           = Fcons (make_string (read_buffer,
-                                                 endptr - read_buffer),
-                                    Qnil);
-                         xsignal (Qoverflow_error, args);
-                       }
-                     return make_fixnum_or_float (n);
-                   }
-                 }
-             }
-           if (isfloat_string (read_buffer, 0))
-             {
-               /* Compute NaN and infinities using 0.0 in a variable,
-                  to cope with compilers that think they are smarter
-                  than we are.  */
-               double zero = 0.0;
-
-               double value;
-
-               /* Negate the value ourselves.  This treats 0, NaNs,
-                  and infinity properly on IEEE floating point hosts,
-                  and works around a common bug where atof ("-0.0")
-                  drops the sign.  */
-               int negative = read_buffer[0] == '-';
-
-               /* The only way p[-1] can be 'F' or 'N', after isfloat_string
-                  returns 1, is if the input ends in e+INF or e+NaN.  */
-               switch (p[-1])
-                 {
-                 case 'F':
-                   value = 1.0 / zero;
-                   break;
-                 case 'N':
-                   value = zero / zero;
-
-                   /* If that made a "negative" NaN, negate it.  */
-
-                   {
-                     int i;
-                     union { double d; char c[sizeof (double)]; } u_data, 
u_minus_zero;
-
-                     u_data.d = value;
-                     u_minus_zero.d = - 0.0;
-                     for (i = 0; i < sizeof (double); i++)
-                       if (u_data.c[i] & u_minus_zero.c[i])
-                         {
-                           value = - value;
-                           break;
-                         }
-                   }
-                   /* Now VALUE is a positive NaN.  */
-                   break;
-                 default:
-                   value = atof (read_buffer + negative);
-                   break;
-                 }
-
-               return make_float (negative ? - value : value);
-             }
+           Lisp_Object result = string_to_number (read_buffer, 10, 0);
+           if (! NILP (result))
+             return result;
          }
        {
          Lisp_Object name, result;
@@ -3242,74 +3166,179 @@
 }
 
 
+static inline int
+digit_to_number (int character, int base)
+{
+  int digit;
+
+  if ('0' <= character && character <= '9')
+    digit = character - '0';
+  else if ('a' <= character && character <= 'z')
+    digit = character - 'a' + 10;
+  else if ('A' <= character && character <= 'Z')
+    digit = character - 'A' + 10;
+  else
+    return -1;
+
+  return digit < base ? digit : -1;
+}
+
 #define LEAD_INT 1
 #define DOT_CHAR 2
 #define TRAIL_INT 4
-#define E_CHAR 8
-#define EXP_INT 16
-
-int
-isfloat_string (const char *cp, int ignore_trailing)
+#define E_EXP 16
+
+
+/* Convert STRING to a number, assuming base BASE.  Return a fixnum if CP has
+   integer syntax and fits in a fixnum, else return the nearest float if CP has
+   either floating point or integer syntax and BASE is 10, else return nil.  If
+   IGNORE_TRAILING is nonzero, consider just the longest prefix of CP that has
+   valid floating point syntax.  Signal an overflow if BASE is not 10 and the
+   number has integer syntax but does not fit.  */
+
+Lisp_Object
+string_to_number (char const *string, int base, int ignore_trailing)
 {
   int state;
-  const char *start = cp;
+  char const *cp = string;
+  int leading_digit;
+  int float_syntax = 0;
+  double value = 0;
+
+  /* Compute NaN and infinities using a variable, to cope with compilers that
+     think they are smarter than we are.  */
+  double zero = 0;
+
+  /* Negate the value ourselves.  This treats 0, NaNs, and infinity properly on
+     IEEE floating point hosts, and works around a formerly-common bug where
+     atof ("-0.0") drops the sign.  */
+  int negative = *cp == '-';
+
+  int signedp = negative || *cp == '+';
+  cp += signedp;
 
   state = 0;
-  if (*cp == '+' || *cp == '-')
-    cp++;
 
-  if (*cp >= '0' && *cp <= '9')
+  leading_digit = digit_to_number (*cp, base);
+  if (0 <= leading_digit)
     {
       state |= LEAD_INT;
-      while (*cp >= '0' && *cp <= '9')
-       cp++;
+      do
+       ++cp;
+      while (0 <= digit_to_number (*cp, base));
     }
   if (*cp == '.')
     {
       state |= DOT_CHAR;
       cp++;
     }
-  if (*cp >= '0' && *cp <= '9')
-    {
-      state |= TRAIL_INT;
-      while (*cp >= '0' && *cp <= '9')
-       cp++;
-    }
-  if (*cp == 'e' || *cp == 'E')
-    {
-      state |= E_CHAR;
-      cp++;
-      if (*cp == '+' || *cp == '-')
-       cp++;
-    }
-
-  if (*cp >= '0' && *cp <= '9')
-    {
-      state |= EXP_INT;
-      while (*cp >= '0' && *cp <= '9')
-       cp++;
-    }
-  else if (cp == start)
-    ;
-  else if (cp[-1] == '+' && cp[0] == 'I' && cp[1] == 'N' && cp[2] == 'F')
-    {
-      state |= EXP_INT;
-      cp += 3;
-    }
-  else if (cp[-1] == '+' && cp[0] == 'N' && cp[1] == 'a' && cp[2] == 'N')
-    {
-      state |= EXP_INT;
-      cp += 3;
-    }
-
-  return ((ignore_trailing
-          || *cp == 0 || *cp == ' ' || *cp == '\t' || *cp == '\n'
-          || *cp == '\r' || *cp == '\f')
-         && (state == (LEAD_INT|DOT_CHAR|TRAIL_INT)
-             || state == (DOT_CHAR|TRAIL_INT)
-             || state == (LEAD_INT|E_CHAR|EXP_INT)
-             || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)
-             || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)));
+
+  if (base == 10)
+    {
+      if ('0' <= *cp && *cp <= '9')
+       {
+         state |= TRAIL_INT;
+         do
+           cp++;
+         while ('0' <= *cp && *cp <= '9');
+       }
+      if (*cp == 'e' || *cp == 'E')
+       {
+         char const *ecp = cp;
+         cp++;
+         if (*cp == '+' || *cp == '-')
+           cp++;
+         if ('0' <= *cp && *cp <= '9')
+           {
+             state |= E_EXP;
+             do
+               cp++;
+             while ('0' <= *cp && *cp <= '9');
+           }
+         else if (cp[-1] == '+'
+                  && cp[0] == 'I' && cp[1] == 'N' && cp[2] == 'F')
+           {
+             state |= E_EXP;
+             cp += 3;
+             value = 1.0 / zero;
+           }
+         else if (cp[-1] == '+'
+                  && cp[0] == 'N' && cp[1] == 'a' && cp[2] == 'N')
+           {
+             state |= E_EXP;
+             cp += 3;
+             value = zero / zero;
+
+             /* If that made a "negative" NaN, negate it.  */
+             {
+               int i;
+               union { double d; char c[sizeof (double)]; }
+                 u_data, u_minus_zero;
+               u_data.d = value;
+               u_minus_zero.d = -0.0;
+               for (i = 0; i < sizeof (double); i++)
+                 if (u_data.c[i] & u_minus_zero.c[i])
+                   {
+                     value = -value;
+                     break;
+                   }
+             }
+             /* Now VALUE is a positive NaN.  */
+           }
+         else
+           cp = ecp;
+       }
+
+      float_syntax = ((state & (DOT_CHAR|TRAIL_INT)) == (DOT_CHAR|TRAIL_INT)
+                     || state == (LEAD_INT|E_EXP));
+    }
+
+  /* Return nil if the number uses invalid syntax.  If IGNORE_TRAILING, accept
+     any prefix that matches.  Otherwise, the entire string must match.  */
+  if (! (ignore_trailing
+        ? ((state & LEAD_INT) != 0 || float_syntax)
+        : (!*cp && ((state & ~DOT_CHAR) == LEAD_INT || float_syntax))))
+    return Qnil;
+
+  /* If the number uses integer and not float syntax, and is in C-language
+     range, use its value, preferably as a fixnum.  */
+  if (0 <= leading_digit && ! float_syntax)
+    {
+      uintmax_t n;
+
+      /* Fast special case for single-digit integers.  This also avoids a
+        glitch when BASE is 16 and IGNORE_TRAILING is nonzero, because in that
+        case some versions of strtoumax accept numbers like "0x1" that Emacs
+        does not allow.  */
+      if (digit_to_number (string[signedp + 1], base) < 0)
+       return make_number (negative ? -leading_digit : leading_digit);
+
+      errno = 0;
+      n = strtoumax (string + signedp, NULL, base);
+      if (errno == ERANGE)
+       {
+         /* Unfortunately there's no simple and accurate way to convert
+            non-base-10 numbers that are out of C-language range.  */
+         if (base != 10)
+           xsignal (Qoverflow_error, list1 (build_string (string)));
+       }
+      else if (n <= (negative ? -MOST_NEGATIVE_FIXNUM : MOST_POSITIVE_FIXNUM))
+       {
+         EMACS_INT signed_n = n;
+         return make_number (negative ? -signed_n : signed_n);
+       }
+      else
+       value = n;
+    }
+
+  /* Either the number uses float syntax, or it does not fit into a fixnum.
+     Convert it from string to floating point, unless the value is already
+     known because it is an infinity, a NAN, or its absolute value fits in
+     uintmax_t.  */
+  if (! value)
+    value = atof (string + signedp);
+
+  return make_float (negative ? -value : value);
 }
 
 
@@ -3327,7 +3356,7 @@
   len = Flength (tem);
   vector = (read_pure ? make_pure_vector (XINT (len)) : Fmake_vector (len, 
Qnil));
 
-  size = XVECTOR (vector)->size;
+  size = ASIZE (vector);
   ptr = XVECTOR (vector)->contents;
   for (i = 0; i < size; i++)
     {
@@ -3592,7 +3621,7 @@
 Lisp_Object
 check_obarray (Lisp_Object obarray)
 {
-  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || ASIZE (obarray) == 0)
     {
       /* If Vobarray is now invalid, force it to be valid.  */
       if (EQ (Vobarray, obarray)) Vobarray = initial_obarray;
@@ -3612,7 +3641,7 @@
   Lisp_Object obarray;
 
   obarray = Vobarray;
-  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || ASIZE (obarray) == 0)
     obarray = check_obarray (obarray);
   tem = oblookup (obarray, str, len, len);
   if (SYMBOLP (tem))
@@ -3628,7 +3657,7 @@
   Lisp_Object obarray;
 
   obarray = Vobarray;
-  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || ASIZE (obarray) == 0)
     obarray = check_obarray (obarray);
   tem = oblookup (obarray, str, len, len);
   if (SYMBOLP (tem))
@@ -3801,10 +3830,10 @@
   Lisp_Object bucket, tem;
 
   if (!VECTORP (obarray)
-      || (obsize = XVECTOR (obarray)->size) == 0)
+      || (obsize = ASIZE (obarray)) == 0)
     {
       obarray = check_obarray (obarray);
-      obsize = XVECTOR (obarray)->size;
+      obsize = ASIZE (obarray);
     }
   /* This is sometimes needed in the middle of GC.  */
   obsize &= ~ARRAY_MARK_FLAG;
@@ -3852,7 +3881,7 @@
   register int i;
   register Lisp_Object tail;
   CHECK_VECTOR (obarray);
-  for (i = XVECTOR (obarray)->size - 1; i >= 0; i--)
+  for (i = ASIZE (obarray) - 1; i >= 0; i--)
     {
       tail = XVECTOR (obarray)->contents[i];
       if (SYMBOLP (tail))
@@ -3932,7 +3961,7 @@
 {
   Lisp_Object sym;
   sym = intern_c_string (sname->symbol_name);
-  XSETPVECTYPE (sname, PVEC_SUBR);
+  XSETTYPED_PVECTYPE (sname, size, PVEC_SUBR);
   XSETSUBR (XSYMBOL (sym)->function, sname);
 }
 

=== modified file 'src/m/amdx86-64.h'
--- a/src/m/amdx86-64.h 2011-04-07 03:34:05 +0000
+++ b/src/m/amdx86-64.h 2011-04-19 00:34:42 +0000
@@ -28,7 +28,7 @@
 
 /* Define the type to use.  */
 #define EMACS_INT               long
-#define pEd                    "ld"
+#define pI                     "l"
 #define EMACS_UINT              unsigned long
 
 /* Define XPNTR to avoid or'ing with DATA_SEG_BITS */

=== modified file 'src/m/ia64.h'
--- a/src/m/ia64.h      2011-04-07 03:34:05 +0000
+++ b/src/m/ia64.h      2011-04-19 00:34:42 +0000
@@ -28,7 +28,7 @@
 
 /* Define the type to use.  */
 #define EMACS_INT              long
-#define pEd                    "ld"
+#define pI                     "l"
 #define EMACS_UINT             unsigned long
 
 #ifdef REL_ALLOC

=== modified file 'src/m/ibms390x.h'
--- a/src/m/ibms390x.h  2011-04-07 03:34:05 +0000
+++ b/src/m/ibms390x.h  2011-04-19 00:34:42 +0000
@@ -24,7 +24,7 @@
 
 /* Define the type to use.  */
 #define EMACS_INT long
-#define pEd "ld"
+#define pI "l"
 #define EMACS_UINT unsigned long
 
 /* On the 64 bit architecture, we can use 60 bits for addresses */

=== modified file 'src/minibuf.c'
--- a/src/minibuf.c     2011-04-14 05:04:02 +0000
+++ b/src/minibuf.c     2011-04-25 21:34:39 +0000
@@ -1227,7 +1227,7 @@
   if (type == obarray_table)
     {
       collection = check_obarray (collection);
-      obsize = XVECTOR (collection)->size;
+      obsize = ASIZE (collection);
       bucket = XVECTOR (collection)->contents[idx];
     }
 
@@ -1490,7 +1490,7 @@
   if (type == 2)
     {
       collection = check_obarray (collection);
-      obsize = XVECTOR (collection)->size;
+      obsize = ASIZE (collection);
       bucket = XVECTOR (collection)->contents[idx];
     }
 
@@ -1804,7 +1804,7 @@
 
       if (completion_ignore_case && !SYMBOLP (tem))
        {
-         for (i = XVECTOR (collection)->size - 1; i >= 0; i--)
+         for (i = ASIZE (collection) - 1; i >= 0; i--)
            {
              tail = XVECTOR (collection)->contents[i];
              if (SYMBOLP (tail))

=== modified file 'src/print.c'
--- a/src/print.c       2011-04-14 07:09:45 +0000
+++ b/src/print.c       2011-04-25 21:34:39 +0000
@@ -808,10 +808,9 @@
   if (valid > 0)
     debug_print (arg);
   else
-    fprintf (stderr, "#<%s_LISP_OBJECT 0x%08lx>\r\n",
+    fprintf (stderr, "#<%s_LISP_OBJECT 0x%08"pI"x>\r\n",
             !valid ? "INVALID" : "SOME",
-            (unsigned long) XHASH (arg)
-            );
+            XHASH (arg));
 }
 
 
@@ -1199,7 +1198,7 @@
          goto loop;
 
        case Lisp_Vectorlike:
-         size = XVECTOR (obj)->size;
+         size = ASIZE (obj);
          if (size & PSEUDOVECTOR_FLAG)
            size &= PSEUDOVECTOR_SIZE_MASK;
          for (i = 0; i < size; i++)
@@ -1338,11 +1337,11 @@
          Lisp_Object num = Fgethash (obj, Vprint_number_table, Qnil);
          if (INTEGERP (num))
            {
-             int n = XINT (num);
+             EMACS_INT n = XINT (num);
              if (n < 0)
                { /* Add a prefix #n= if OBJ has not yet been printed;
                     that is, its status field is nil.  */
-                 sprintf (buf, "#%d=", -n);
+                 sprintf (buf, "#%"pI"d=", -n);
                  strout (buf, -1, -1, printcharfun);
                  /* OBJ is going to be printed.  Remember that fact.  */
                  Fputhash (obj, make_number (- n), Vprint_number_table);
@@ -1350,7 +1349,7 @@
              else
                {
                  /* Just print #n# if OBJ has already been printed.  */
-                 sprintf (buf, "#%d#", n);
+                 sprintf (buf, "#%"pI"d#", n);
                  strout (buf, -1, -1, printcharfun);
                  return;
                }
@@ -1363,12 +1362,7 @@
   switch (XTYPE (obj))
     {
     case_Lisp_Int:
-      if (sizeof (int) == sizeof (EMACS_INT))
-       sprintf (buf, "%d", (int) XINT (obj));
-      else if (sizeof (long) == sizeof (EMACS_INT))
-       sprintf (buf, "%ld", (long) XINT (obj));
-      else
-       abort ();
+      sprintf (buf, "%"pI"d", XINT (obj));
       strout (buf, -1, -1, printcharfun);
       break;
 
@@ -1701,7 +1695,7 @@
 
          PRINTCHAR ('#');
          PRINTCHAR ('&');
-         sprintf (buf, "%ld", (long) XBOOL_VECTOR (obj)->size);
+         sprintf (buf, "%"pI"d", XBOOL_VECTOR (obj)->size);
          strout (buf, -1, -1, printcharfun);
          PRINTCHAR ('\"');
 
@@ -1754,7 +1748,7 @@
       else if (WINDOWP (obj))
        {
          strout ("#<window ", -1, -1, printcharfun);
-         sprintf (buf, "%ld", (long) XFASTINT (XWINDOW 
(obj)->sequence_number));
+         sprintf (buf, "%"pI"d", XFASTINT (XWINDOW (obj)->sequence_number));
          strout (buf, -1, -1, printcharfun);
          if (!NILP (XWINDOW (obj)->buffer))
            {
@@ -1792,7 +1786,7 @@
              strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun);
              PRINTCHAR (' ');
              sprintf (buf, "%ld/%ld", (long) h->count,
-                      (long) XVECTOR (h->next)->size);
+                      (long) ASIZE (h->next));
              strout (buf, -1, -1, printcharfun);
            }
          sprintf (buf, " 0x%lx", (unsigned long) h);
@@ -1803,7 +1797,7 @@
            #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */
          /* Always print the size. */
          sprintf (buf, "#s(hash-table size %ld",
-                  (long) XVECTOR (h->next)->size);
+                  (long) ASIZE (h->next));
          strout (buf, -1, -1, printcharfun);
 
          if (!NILP (h->test))
@@ -1881,7 +1875,7 @@
                   ? "#<frame " : "#<dead frame "),
                  -1, -1, printcharfun);
          print_string (XFRAME (obj)->name, printcharfun);
-         sprintf (buf, " 0x%lx", (unsigned long) (XFRAME (obj)));
+         sprintf (buf, " %p", XFRAME (obj));
          strout (buf, -1, -1, printcharfun);
          PRINTCHAR ('>');
        }
@@ -1915,7 +1909,7 @@
        }
       else
        {
-         EMACS_INT size = XVECTOR (obj)->size;
+         EMACS_INT size = ASIZE (obj);
          if (COMPILEDP (obj))
            {
              PRINTCHAR ('#');
@@ -1978,7 +1972,7 @@
            strout ("in no buffer", -1, -1, printcharfun);
          else
            {
-             sprintf (buf, "at %ld", (long)marker_position (obj));
+             sprintf (buf, "at %"pI"d", marker_position (obj));
              strout (buf, -1, -1, printcharfun);
              strout (" in ", -1, -1, printcharfun);
              print_string (BVAR (XMARKER (obj)->buffer, name), printcharfun);
@@ -1992,9 +1986,9 @@
            strout ("in no buffer", -1, -1, printcharfun);
          else
            {
-             sprintf (buf, "from %ld to %ld in ",
-                      (long)marker_position (OVERLAY_START (obj)),
-                      (long)marker_position (OVERLAY_END   (obj)));
+             sprintf (buf, "from %"pI"d to %"pI"d in ",
+                      marker_position (OVERLAY_START (obj)),
+                      marker_position (OVERLAY_END   (obj)));
              strout (buf, -1, -1, printcharfun);
              print_string (BVAR (XMARKER (OVERLAY_START (obj))->buffer, name),
                            printcharfun);
@@ -2010,8 +2004,8 @@
 
        case Lisp_Misc_Save_Value:
          strout ("#<save_value ", -1, -1, printcharfun);
-         sprintf(buf, "ptr=0x%08lx int=%d",
-                 (unsigned long) XSAVE_VALUE (obj)->pointer,
+         sprintf(buf, "ptr=%p int=%d",
+                 XSAVE_VALUE (obj)->pointer,
                  XSAVE_VALUE (obj)->integer);
          strout (buf, -1, -1, printcharfun);
          PRINTCHAR ('>');
@@ -2031,7 +2025,7 @@
        if (MISCP (obj))
          sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj));
        else if (VECTORLIKEP (obj))
-         sprintf (buf, "(PVEC 0x%08x)", (int) XVECTOR (obj)->size);
+         sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) ASIZE (obj));
        else
          sprintf (buf, "(0x%02x)", (int) XTYPE (obj));
        strout (buf, -1, -1, printcharfun);

=== modified file 'src/process.c'
--- a/src/process.c     2011-04-25 01:30:51 +0000
+++ b/src/process.c     2011-04-26 06:17:52 +0000
@@ -1188,25 +1188,26 @@
   if (VECTORP (address))  /* AF_INET or AF_INET6 */
     {
       register struct Lisp_Vector *p = XVECTOR (address);
+      EMACS_UINT size = p->header.size;
       Lisp_Object args[10];
       int nargs, i;
 
-      if (p->size == 4 || (p->size == 5 && !NILP (omit_port)))
+      if (size == 4 || (size == 5 && !NILP (omit_port)))
        {
          args[0] = build_string ("%d.%d.%d.%d");
          nargs = 4;
        }
-      else if (p->size == 5)
+      else if (size == 5)
        {
          args[0] = build_string ("%d.%d.%d.%d:%d");
          nargs = 5;
        }
-      else if (p->size == 8 || (p->size == 9 && !NILP (omit_port)))
+      else if (size == 8 || (size == 9 && !NILP (omit_port)))
        {
          args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x");
          nargs = 8;
        }
-      else if (p->size == 9)
+      else if (size == 9)
        {
          args[0] = build_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d");
          nargs = 9;
@@ -2064,13 +2065,13 @@
   if (VECTORP (address))
     {
       p = XVECTOR (address);
-      if (p->size == 5)
+      if (p->header.size == 5)
        {
          *familyp = AF_INET;
          return sizeof (struct sockaddr_in);
        }
 #ifdef AF_INET6
-      else if (p->size == 9)
+      else if (p->header.size == 9)
        {
          *familyp = AF_INET6;
          return sizeof (struct sockaddr_in6);
@@ -2089,7 +2090,7 @@
       struct sockaddr *sa;
       *familyp = XINT (XCAR (address));
       p = XVECTOR (XCDR (address));
-      return p->size + sizeof (sa->sa_family);
+      return p->header.size + sizeof (sa->sa_family);
     }
   return 0;
 }
@@ -3041,7 +3042,7 @@
        portstring = "0";
       else if (INTEGERP (service))
        {
-         sprintf (portbuf, "%ld", (long) XINT (service));
+         sprintf (portbuf, "%"pI"d", XINT (service));
          portstring = portbuf;
        }
       else
@@ -3723,9 +3724,9 @@
              flags -= fp->flag_bit;
            }
        }
-      for (fnum = 0; flags && fnum < 32; fnum++)
+      for (fnum = 0; flags && fnum < 32; flags >>= 1, fnum++)
        {
-         if (flags & (1 << fnum))
+         if (flags & 1)
            {
              elt = Fcons (make_number (fnum), elt);
            }

=== modified file 'src/process.h'
--- a/src/process.h     2011-04-14 02:16:00 +0000
+++ b/src/process.h     2011-04-25 19:40:22 +0000
@@ -29,13 +29,13 @@
 /* This structure records information about a subprocess
    or network connection.
 
-   Every field in this structure except for the first two
+   Every field in this structure except for the header
    must be a Lisp_Object, for GC's sake.  */
 
 struct Lisp_Process
   {
-    EMACS_UINT size;
-    struct Lisp_Vector *v_next;
+    struct vectorlike_header header;
+
     /* Name of subprocess terminal.  */
     Lisp_Object tty_name;
     /* Name of this process */

=== modified file 'src/region-cache.c'
--- a/src/region-cache.c        2011-04-14 06:48:41 +0000
+++ b/src/region-cache.c        2011-04-19 00:34:42 +0000
@@ -790,9 +790,9 @@
   EMACS_INT end_u = c->buffer_end - c->end_unchanged;
 
   fprintf (stderr,
-           "basis: %ld..%ld    modified: %ld..%ld\n",
-           (long)c->buffer_beg, (long)c->buffer_end,
-           (long)beg_u, (long)end_u);
+           "basis: %"pI"d..%"pI"d    modified: %"pI"d..%"pI"d\n",
+           c->buffer_beg, c->buffer_end,
+           beg_u, end_u);
 
   for (i = 0; i < c->cache_len; i++)
     {
@@ -806,6 +806,6 @@
              : (pos == end_u) ? '-'
              : ' '),
             stderr);
-      fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i));
+      fprintf (stderr, "%"pI"d : %d\n", pos, BOUNDARY_VALUE (c, i));
     }
 }

=== modified file 'src/syntax.c'
--- a/src/syntax.c      2011-04-24 12:48:30 +0000
+++ b/src/syntax.c      2011-04-26 06:17:52 +0000
@@ -981,7 +981,7 @@
        break;
       }
 
-  if (val < XVECTOR (Vsyntax_code_object)->size && NILP (match))
+  if (val < ASIZE (Vsyntax_code_object) && NILP (match))
     return XVECTOR (Vsyntax_code_object)->contents[val];
   else
     /* Since we can't use a shared object, let's make a new one.  */
@@ -3372,7 +3372,7 @@
 
   /* Create objects which can be shared among syntax tables.  */
   Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil);
-  for (i = 0; i < XVECTOR (Vsyntax_code_object)->size; i++)
+  for (i = 0; i < ASIZE (Vsyntax_code_object); i++)
     XVECTOR (Vsyntax_code_object)->contents[i]
       = Fcons (make_number (i), Qnil);
 

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2011-04-23 03:07:16 +0000
+++ b/src/sysdep.c      2011-04-26 06:17:52 +0000
@@ -2383,7 +2383,7 @@
   CHECK_NUMBER (tem);
   err = cfsetspeed (&attr, XINT (tem));
   if (err != 0)
-    error ("cfsetspeed(%"pEd") failed: %s", XINT (tem),
+    error ("cfsetspeed(%"pI"d) failed: %s", XINT (tem),
           emacs_strerror (errno));
   childp2 = Fplist_put (childp2, QCspeed, tem);
 

=== modified file 'src/termhooks.h'
--- a/src/termhooks.h   2011-04-17 18:40:55 +0000
+++ b/src/termhooks.h   2011-04-25 19:40:22 +0000
@@ -322,10 +322,8 @@
 /* Terminal-local parameters. */
 struct terminal
 {
-  /* The first two fields are really the header of a vector */
-  /* The terminal code does not refer to them.  */
-  EMACS_UINT size;
-  struct Lisp_Vector *vec_next;
+  /* This is for Lisp; the terminal code does not refer to it.  */
+  struct vectorlike_header header;
 
   /* Parameter alist of this terminal.  */
   Lisp_Object param_alist;

=== modified file 'src/textprop.c'
--- a/src/textprop.c    2011-04-24 16:28:57 +0000
+++ b/src/textprop.c    2011-04-26 06:17:52 +0000
@@ -1348,15 +1348,18 @@
   register EMACS_INT s, len;
   INTERVAL unchanged;
 
-  s = XINT (start);
-  len = XINT (end) - s;
-  if (len == 0)
+  if (XINT (start) < XINT (end))
+    {
+      s = XINT (start);
+      len = XINT (end) - s;
+    }
+  else if (XINT (end) < XINT (start))
+    {
+      s = XINT (end);
+      len = XINT (start) - s;
+    }
+  else
     return;
-  if (len < 0)
-    {
-      s = s + len;
-      len = - len;
-    }
 
   if (i == 0)
     i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s);

=== modified file 'src/w32font.c'
--- a/src/w32font.c     2011-03-23 16:25:38 +0000
+++ b/src/w32font.c     2011-04-25 21:34:39 +0000
@@ -165,7 +165,7 @@
 
   /* The following code is copied from the function intern (in lread.c).  */
   obarray = Vobarray;
-  if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+  if (!VECTORP (obarray) || ASIZE (obarray) == 0)
     obarray = check_obarray (obarray);
   tem = oblookup (obarray, SDATA (str), len, len);
   if (SYMBOLP (tem))
@@ -2581,4 +2581,3 @@
   w32font_driver.type = Qgdi;
   register_font_driver (&w32font_driver, NULL);
 }
-

=== modified file 'src/w32menu.c'
--- a/src/w32menu.c     2011-03-26 01:23:15 +0000
+++ b/src/w32menu.c     2011-04-25 21:34:39 +0000
@@ -427,11 +427,11 @@
 
       menu_items = f->menu_bar_vector;
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
-      submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
-      submenu_end = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
-      submenu_n_panes = (int *) alloca (XVECTOR (items)->size * sizeof (int));
+      submenu_start = (int *) alloca (ASIZE (items) * sizeof (int *));
+      submenu_end = (int *) alloca (ASIZE (items) * sizeof (int *));
+      submenu_n_panes = (int *) alloca (ASIZE (items) * sizeof (int));
       submenu_top_level_items
-       = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
+       = (int *) alloca (ASIZE (items) * sizeof (int *));
       init_menu_items ();
       for (i = 0; i < ASIZE (items); i += 4)
        {

=== modified file 'src/window.c'
--- a/src/window.c      2011-04-14 19:34:42 +0000
+++ b/src/window.c      2011-04-25 19:40:22 +0000
@@ -5794,8 +5794,7 @@
 
 struct save_window_data
   {
-    EMACS_UINT size;
-    struct Lisp_Vector *next_from_Lisp_Vector_struct;
+    struct vectorlike_header header;
     Lisp_Object selected_frame;
     Lisp_Object current_window;
     Lisp_Object current_buffer;
@@ -5817,10 +5816,7 @@
 /* This is saved as a Lisp_Vector  */
 struct saved_window
 {
-  /* these first two must agree with struct Lisp_Vector in lisp.h */
-  EMACS_UINT size;
-  struct Lisp_Vector *next_from_Lisp_Vector_struct;
-
+  struct vectorlike_header header;
   Lisp_Object window;
   Lisp_Object buffer, start, pointm, mark;
   Lisp_Object left_col, top_line, total_cols, total_lines;
@@ -6001,7 +5997,7 @@
         dead.  */
       delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f)));
 
-      for (k = 0; k < saved_windows->size; k++)
+      for (k = 0; k < saved_windows->header.size; k++)
        {
          p = SAVED_WINDOW_N (saved_windows, k);
          w = XWINDOW (p->window);
@@ -6884,10 +6880,10 @@
     return 0;
 
   /* Verify that the two confis have the same number of windows.  */
-  if (sw1->size != sw2->size)
+  if (sw1->header.size != sw2->header.size)
     return 0;
 
-  for (i = 0; i < sw1->size; i++)
+  for (i = 0; i < sw1->header.size; i++)
     {
       struct saved_window *p1, *p2;
       int w1_is_current, w2_is_current;

=== modified file 'src/window.h'
--- a/src/window.h      2011-04-14 06:48:41 +0000
+++ b/src/window.h      2011-04-25 19:40:22 +0000
@@ -88,10 +88,9 @@
 
 struct window
   {
-    /* The first two fields are really the header of a vector */
-    /* The window code does not refer to them.  */
-    EMACS_UINT size;
-    struct Lisp_Vector *vec_next;
+    /* This is for Lisp; the terminal code does not refer to it.  */
+    struct vectorlike_header header;
+
     /* The frame this window is on.  */
     Lisp_Object frame;
     /* t if this window is a minibuffer window.  */

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-04-24 16:59:37 +0000
+++ b/src/xdisp.c       2011-04-26 06:17:52 +0000
@@ -3705,7 +3705,7 @@
     {
       struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp));
       it->dpvec = v->contents;
-      it->dpend = v->contents + v->size;
+      it->dpend = v->contents + v->header.size;
     }
   else
     {
@@ -5659,11 +5659,11 @@
              /* Return the first character from the display table
                 entry, if not empty.  If empty, don't display the
                 current character.  */
-             if (v->size)
+             if (v->header.size)
                {
                  it->dpvec_char_len = it->len;
                  it->dpvec = v->contents;
-                 it->dpend = v->contents + v->size;
+                 it->dpend = v->contents + v->header.size;
                  it->current.dpvec_index = 0;
                  it->dpvec_face_id = -1;
                  it->saved_face_id = it->face_id;
@@ -18124,7 +18124,7 @@
 
   /* Display all items of the menu bar.  */
   items = FRAME_MENU_BAR_ITEMS (it.f);
-  for (i = 0; i < XVECTOR (items)->size; i += 4)
+  for (i = 0; i < ASIZE (items); i += 4)
     {
       Lisp_Object string;
 
@@ -19562,7 +19562,7 @@
               so get us a 2-digit number that is close.  */
            if (total == 100)
              total = 99;
-           sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
+           sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
            return decode_mode_spec_buf;
          }
       }
@@ -19593,9 +19593,9 @@
            if (total == 100)
              total = 99;
            if (toppos <= BUF_BEGV (b))
-             sprintf (decode_mode_spec_buf, "Top%2ld%%", (long)total);
+             sprintf (decode_mode_spec_buf, "Top%2"pI"d%%", total);
            else
-             sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
+             sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
            return decode_mode_spec_buf;
          }
       }
@@ -24816,7 +24816,7 @@
        {
          struct Lisp_Vector *v = XVECTOR (XCDR (hot_spot));
          Lisp_Object *poly = v->contents;
-         int n = v->size;
+         int n = v->header.size;
          int i;
          int inside = 0;
          Lisp_Object lx, ly;

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2011-04-24 12:48:30 +0000
+++ b/src/xfaces.c      2011-04-26 06:17:52 +0000
@@ -1848,7 +1848,7 @@
 
 #define LFACEP(LFACE)                                  \
      (VECTORP (LFACE)                                  \
-      && XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE    \
+      && ASIZE (LFACE) == LFACE_VECTOR_SIZE            \
       && EQ (AREF (LFACE, 0), Qface))
 #endif
 

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2011-04-16 20:07:17 +0000
+++ b/src/xfns.c        2011-04-19 06:34:43 +0000
@@ -216,7 +216,7 @@
       struct terminal *t = get_terminal (object, 1);
 
       if (t->type != output_x_window)
-        error ("Terminal %"pEd" is not an X display", XINT (object));
+        error ("Terminal %"pI"d is not an X display", XINT (object));
 
       dpyinfo = t->display_info.x;
     }
@@ -4352,7 +4352,7 @@
              property and those are indeed in 32 bit quantities if format is
              32.  */
 
-          if (actual_format == 32 && actual_format < BITS_PER_LONG)
+          if (32 < BITS_PER_LONG && actual_format == 32)
             {
               unsigned long i;
               int  *idata = (int *) tmp_data;

=== modified file 'src/xmenu.c'
--- a/src/xmenu.c       2011-04-16 15:38:15 +0000
+++ b/src/xmenu.c       2011-04-25 21:34:39 +0000
@@ -1011,7 +1011,7 @@
 
       menu_items = f->menu_bar_vector;
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
-      subitems = XVECTOR (items)->size / 4;
+      subitems = ASIZE (items) / 4;
       submenu_start = (int *) alloca (subitems * sizeof (int *));
       submenu_end = (int *) alloca (subitems * sizeof (int *));
       submenu_n_panes = (int *) alloca (subitems * sizeof (int));
@@ -1097,7 +1097,7 @@
       /* Now GC cannot happen during the lifetime of the widget_value,
         so it's safe to store data from a Lisp_String.  */
       wv = first_wv->contents;
-      for (i = 0; i < XVECTOR (items)->size; i += 4)
+      for (i = 0; i < ASIZE (items); i += 4)
        {
          Lisp_Object string;
          string = XVECTOR (items)->contents[i + 1];
@@ -1123,7 +1123,7 @@
       first_wv = wv;
 
       items = FRAME_MENU_BAR_ITEMS (f);
-      for (i = 0; i < XVECTOR (items)->size; i += 4)
+      for (i = 0; i < ASIZE (items); i += 4)
        {
          Lisp_Object string;
 

=== modified file 'src/xrdb.c'
--- a/src/xrdb.c        2011-04-16 04:37:14 +0000
+++ b/src/xrdb.c        2011-04-19 00:34:42 +0000
@@ -536,10 +536,10 @@
      dialog from `double-click-time'.  */
   if (INTEGERP (Vdouble_click_time) && XINT (Vdouble_click_time) > 0)
     {
-      sprintf (line, "%s*fsb*DirList.doubleClickInterval: %d",
+      sprintf (line, "%s*fsb*DirList.doubleClickInterval: %"pI"d",
               myclass, XFASTINT (Vdouble_click_time));
       XrmPutLineResource (&rdb, line);
-      sprintf (line, "%s*fsb*ItemsList.doubleClickInterval: %d",
+      sprintf (line, "%s*fsb*ItemsList.doubleClickInterval: %"pI"d",
               myclass, XFASTINT (Vdouble_click_time));
       XrmPutLineResource (&rdb, line);
     }

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2011-04-11 03:39:45 +0000
+++ b/src/xselect.c     2011-04-25 21:34:39 +0000
@@ -169,7 +169,7 @@
     {
       if (!memcmp (&queue_tmp->event, event, sizeof (*event)))
        {
-         TRACE1 ("DECLINE DUP SELECTION EVENT %08lx", (unsigned 
long)queue_tmp);
+         TRACE1 ("DECLINE DUP SELECTION EVENT %p", queue_tmp);
          x_decline_selection_request (event);
          return;
        }
@@ -180,7 +180,7 @@
 
   if (queue_tmp != NULL)
     {
-      TRACE1 ("QUEUE SELECTION EVENT %08lx", (unsigned long)queue_tmp);
+      TRACE1 ("QUEUE SELECTION EVENT %p", queue_tmp);
       queue_tmp->event = *event;
       queue_tmp->next = selection_queue;
       selection_queue = queue_tmp;
@@ -213,7 +213,7 @@
   while (selection_queue != NULL)
     {
       struct selection_event_queue *queue_tmp = selection_queue;
-      TRACE1 ("RESTORE SELECTION EVENT %08lx", (unsigned long)queue_tmp);
+      TRACE1 ("RESTORE SELECTION EVENT %p", queue_tmp);
       kbd_buffer_unget_event (&queue_tmp->event);
       selection_queue = queue_tmp->next;
       xfree ((char *)queue_tmp);
@@ -423,7 +423,7 @@
       int size;
       int i;
       pairs = XCDR (target_type);
-      size = XVECTOR (pairs)->size;
+      size = ASIZE (pairs);
       /* If the target is MULTIPLE, then target_type looks like
          (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ])
         We modify the second element of each pair in the vector and
@@ -1261,12 +1261,12 @@
     return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));
 
   CHECK_VECTOR (obj);
-  vec = Fmake_vector (size = XVECTOR (obj)->size, Qnil);
+  vec = Fmake_vector (size = ASIZE (obj), Qnil);
   for (i = 0; i < size; i++)
     {
       Lisp_Object vec2 = XVECTOR (obj)->contents [i];
       CHECK_VECTOR (vec2);
-      if (XVECTOR (vec2)->size != 2)
+      if (ASIZE (vec2) != 2)
        /* ??? Confusing error message */
        signal_error ("Vectors must be of length 2", vec2);
       XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil);
@@ -1444,7 +1444,7 @@
   while (bytes_remaining)
     {
 #ifdef TRACE_SELECTION
-      int last = bytes_remaining;
+      unsigned long last = bytes_remaining;
 #endif
       result
        = XGetWindowProperty (display, window, property,
@@ -1454,7 +1454,7 @@
                              actual_type_ret, actual_format_ret,
                              actual_size_ret, &bytes_remaining, &tmp_data);
 
-      TRACE2 ("Read %ld bytes from property %s",
+      TRACE2 ("Read %lu bytes from property %s",
              last - bytes_remaining,
              XGetAtomName (display, property));
 
@@ -1477,7 +1477,7 @@
          The bytes and offsets passed to XGetWindowProperty refers to the
          property and those are indeed in 32 bit quantities if format is 32.  
*/
 
-      if (*actual_format_ret == 32 && *actual_format_ret < BITS_PER_LONG)
+      if (32 < BITS_PER_LONG && *actual_format_ret == 32)
         {
           unsigned long i;
           int  *idata = (int *) ((*data_ret) + offset);
@@ -1878,7 +1878,7 @@
        /* This vector is an ATOM set */
        {
          if (NILP (type)) type = QATOM;
-         *size_ret = XVECTOR (obj)->size;
+         *size_ret = ASIZE (obj);
          *format_ret = 32;
          *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom));
          for (i = 0; i < *size_ret; i++)
@@ -1893,7 +1893,7 @@
        /* This vector is an ATOM_PAIR set */
        {
          if (NILP (type)) type = QATOM_PAIR;
-         *size_ret = XVECTOR (obj)->size;
+         *size_ret = ASIZE (obj);
          *format_ret = 32;
          *data_ret = (unsigned char *)
            xmalloc ((*size_ret) * sizeof (Atom) * 2);
@@ -1901,7 +1901,7 @@
            if (VECTORP (XVECTOR (obj)->contents [i]))
              {
                Lisp_Object pair = XVECTOR (obj)->contents [i];
-               if (XVECTOR (pair)->size != 2)
+               if (ASIZE (pair) != 2)
                  signal_error (
        "Elements of the vector must be vectors of exactly two elements",
                                pair);
@@ -1923,7 +1923,7 @@
        /* This vector is an INTEGER set, or something like it */
        {
           int data_size = 2;
-         *size_ret = XVECTOR (obj)->size;
+         *size_ret = ASIZE (obj);
          if (NILP (type)) type = QINTEGER;
          *format_ret = 16;
          for (i = 0; i < *size_ret; i++)
@@ -1976,7 +1976,7 @@
   if (VECTORP (obj))
     {
       int i;
-      int size = XVECTOR (obj)->size;
+      int size = ASIZE (obj);
       Lisp_Object copy;
       if (size == 1)
        return clean_local_selection_data (XVECTOR (obj)->contents [0]);
@@ -2432,7 +2432,7 @@
      function expects them to be of size int (i.e. 32).  So to be able to
      use that function, put the data in the form it expects if format is 32. */
 
-  if (event->format == 32 && event->format < BITS_PER_LONG)
+  if (32 < BITS_PER_LONG && event->format == 32)
     {
       for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
         idata[i] = (int) event->data.l[i];


reply via email to

[Prev in Thread] Current Thread [Next in Thread]