summaryrefslogtreecommitdiffstats
path: root/gettext-runtime/libasprintf
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-06-03 11:22:58 +0200
committerBruno Haible <bruno@clisp.org>2011-06-07 23:39:49 +0200
commitd02e4106522a0c6437dafd3b43b7cd58317b678d (patch)
tree7ac755e7c716a9eb5fc0eb2882d42ebc62edeff6 /gettext-runtime/libasprintf
parentb671c3bef6b56892d3dc69144f5f41a989f50ed6 (diff)
downloadexternal_gettext-d02e4106522a0c6437dafd3b43b7cd58317b678d.zip
external_gettext-d02e4106522a0c6437dafd3b43b7cd58317b678d.tar.gz
external_gettext-d02e4106522a0c6437dafd3b43b7cd58317b678d.tar.bz2
Update from gnulib, use verify.h.
Diffstat (limited to 'gettext-runtime/libasprintf')
-rw-r--r--gettext-runtime/libasprintf/ChangeLog11
-rw-r--r--gettext-runtime/libasprintf/Makefile.am1
-rw-r--r--gettext-runtime/libasprintf/vasnprintf.c11
3 files changed, 18 insertions, 5 deletions
diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog
index a2ca849..7908646 100644
--- a/gettext-runtime/libasprintf/ChangeLog
+++ b/gettext-runtime/libasprintf/ChangeLog
@@ -1,5 +1,16 @@
2011-06-03 Bruno Haible <bruno@clisp.org>
+ * Makefile.am (lib_asprintf_EXTRASOURCES): Add verify.h.
+
+2010-10-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ rewrite int foo[2*X-1] to verify(X) or to int foo[X?1:-1]
+ * vasnprintf.c: Include "verify.h".
+ (mp_limb_verify, mp_twolimb_verify, TCHAR_T_verify): Remove, replacing
+ with a verify call.
+
+2011-06-03 Bruno Haible <bruno@clisp.org>
+
Copyright: Use LGPL 2.1 instead of LGPL 2.0.
* COPYING.LIB: Replace with text of LGPL 2.1.
* *.h, *.c, *.cc, Makefile.am: Update copyright header.
diff --git a/gettext-runtime/libasprintf/Makefile.am b/gettext-runtime/libasprintf/Makefile.am
index 3bee2e1..2aebbed 100644
--- a/gettext-runtime/libasprintf/Makefile.am
+++ b/gettext-runtime/libasprintf/Makefile.am
@@ -54,6 +54,7 @@ libasprintf_la_SOURCES = \
# Sources used only on platforms lacking vasprintf().
lib_asprintf_EXTRASOURCES = \
+ verify.h \
xsize.h \
printf-args.h printf-args.c \
printf-parse.h printf-parse.c \
diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c
index fb4463c..76c8841 100644
--- a/gettext-runtime/libasprintf/vasnprintf.c
+++ b/gettext-runtime/libasprintf/vasnprintf.c
@@ -87,6 +87,8 @@
/* Checked size_t computations. */
#include "xsize.h"
+#include "verify.h"
+
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
# include "float+.h"
@@ -321,11 +323,11 @@ is_infinite_or_zerol (long double x)
typedef unsigned int mp_limb_t;
# define GMP_LIMB_BITS 32
-typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1];
+verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
typedef unsigned long long mp_twolimb_t;
# define GMP_TWOLIMB_BITS 64
-typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1];
+verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
/* Representation of a bignum >= 0. */
typedef struct
@@ -2621,7 +2623,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters;
# if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */
- typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1];
+ verify (sizeof (TCHAR_T) == 1);
TCHAR_T *tmpsrc;
DCHAR_T *tmpdst;
size_t tmpdst_len;
@@ -5292,8 +5294,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
DCHAR_T *tmpdst;
size_t tmpdst_len;
/* This code assumes that TCHAR_T is 'char'. */
- typedef int TCHAR_T_verify
- [2 * (sizeof (TCHAR_T) == 1) - 1];
+ verify (sizeof (TCHAR_T) == 1);
# if USE_SNPRINTF
tmpsrc = (TCHAR_T *) (result + length);
# else