2016-12-14 Paul Eggert <eggert@cs.ucla.edu>
+ dfa: fix glitches in previous commit
+ Sorry, I don't know how I managed to commit the wrong version.
+ * lib/dfa.c (MIN): Move up.
+ (xpalloc): Now static.
+
dfa: fix some unlikely integer overflows
I found these while reviewing the recent Coverity-related fix.
This patch changes part of dfa.c to prefer ptrdiff_t instead of
expression is false.
(realloc_trans_if_necessary):
Remove assertion, which I hope Coverity no longer needs.
+
* modules/dfa (Depends-on): Add intprops, stdint.
2016-12-12 Jim Meyering <meyering@fb.com>
#include "xalloc.h"
#include "localeinfo.h"
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
/* HPUX defines these as macros in sys/param.h. */
#ifdef setbit
# undef setbit
Thus, to grow an array A without saving its old contents, do
{ free (A); A = xpalloc (NULL, &AITEMS, ...); }. */
-void *
+static void *
xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
ptrdiff_t nitems_max, ptrdiff_t item_size)
{
} \
} while (false)
-#ifndef MIN
-# define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
typedef int predicate (int);
/* The following list maps the names of the Posix named character classes