summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.x-sc_cast_of_x_alloc_return_value1
-rw-r--r--cfg.mk1
-rw-r--r--src/dfa.c6
-rw-r--r--src/dosbuf.c7
-rw-r--r--src/grep.c4
5 files changed, 9 insertions, 10 deletions
diff --git a/.x-sc_cast_of_x_alloc_return_value b/.x-sc_cast_of_x_alloc_return_value
new file mode 100644
index 00000000..748e1b0e
--- /dev/null
+++ b/.x-sc_cast_of_x_alloc_return_value
@@ -0,0 +1 @@
+lib/regex.c
diff --git a/cfg.mk b/cfg.mk
index 92aee2f6..b222ff3f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -23,7 +23,6 @@ gpg_key_ID = B9AB9A16
# Tests not to run as part of "make distcheck".
local-checks-to-skip = \
sc_cast_of_argument_to_free \
- sc_cast_of_x_alloc_return_value \
sc_error_message_uppercase \
sc_m4_quote_check \
sc_makefile_TAB_only_indentation \
diff --git a/src/dfa.c b/src/dfa.c
index 6917ceb2..47ec093e 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -173,9 +173,9 @@ xrealloc (ptr_t p, size_t n)
return r;
}
-#define CALLOC(p, t, n) ((p) = (t *) xcalloc((size_t)(n), sizeof (t)))
-#define MALLOC(p, t, n) ((p) = (t *) xmalloc((n) * sizeof (t)))
-#define REALLOC(p, t, n) ((p) = (t *) xrealloc((ptr_t) (p), (n) * sizeof (t)))
+#define CALLOC(p, t, n) ((p) = xcalloc((size_t)(n), sizeof (t)))
+#define MALLOC(p, t, n) ((p) = xmalloc((n) * sizeof (t)))
+#define REALLOC(p, t, n) ((p) = xrealloc((ptr_t) (p), (n) * sizeof (t)))
/* Reallocate an array of type t if nalloc is too small for index. */
#define REALLOC_IF_NECESSARY(p, t, nalloc, index) \
diff --git a/src/dosbuf.c b/src/dosbuf.c
index be649524..664bb909 100644
--- a/src/dosbuf.c
+++ b/src/dosbuf.c
@@ -125,10 +125,9 @@ undossify_input (register char *buf, size_t buflen)
if (inp_map_idx >= dos_pos_map_size - 1)
{
dos_pos_map_size = inp_map_idx ? inp_map_idx * 2 : 1000;
- dos_pos_map =
- (struct dos_map *)xrealloc((char *)dos_pos_map,
- dos_pos_map_size *
- sizeof(struct dos_map));
+ dos_pos_map = xrealloc((char *)dos_pos_map,
+ dos_pos_map_size *
+ sizeof(struct dos_map));
}
if (!inp_map_idx)
diff --git a/src/grep.c b/src/grep.c
index 6539d4cc..564166ee 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -796,7 +796,7 @@ print_line_middle (const char *beg, const char *lim,
{
int i = lim - beg;
- ibeg = buf = (char *) xmalloc(i);
+ ibeg = buf = xmalloc(i);
/* This can't possibly be correct with UTF-8,
but it's equivalent to what was there so far. */
while (--i >= 0)
@@ -1620,7 +1620,7 @@ prepend_default_options (char const *options, int *pargc, char ***pargv)
int prepended = prepend_args (options, buf, (char **) NULL);
int argc = *pargc;
char * const *argv = *pargv;
- char **pp = (char **) xmalloc ((prepended + argc + 1) * sizeof *pp);
+ char **pp = xmalloc ((prepended + argc + 1) * sizeof *pp);
*pargc = prepended + argc;
*pargv = pp;
*pp++ = *argv++;