xrealloc, and xcalloc return values and of xrealloc's first argument.
if (ht == NULL)
return;
- ent = (struct F_triple *) xmalloc (sizeof *ent);
+ ent = xmalloc (sizeof *ent);
ent->name = xstrdup (filename);
if (stats)
{
/* cp-hash.c -- file copying (hash search routines)
- Copyright (C) 89, 90, 91, 1995-2002 Free Software Foundation.
+ Copyright (C) 89, 90, 91, 1995-2003 Free Software Foundation.
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
struct Src_to_dest *ent;
struct Src_to_dest *ent_from_table;
- ent = (struct Src_to_dest *) xmalloc (sizeof *ent);
+ ent = xmalloc (sizeof *ent);
ent->name = xstrdup (name);
ent->st_ino = ino;
ent->st_dev = dev;
/* Add this directory to the list of directories whose modes need
fixing later. */
struct dir_attr *new =
- (struct dir_attr *) xmalloc (sizeof (struct dir_attr));
+ xmalloc (sizeof (struct dir_attr));
new->slash_offset = slash - dirpath;
new->next = *attr_list;
*attr_list = new;
/* csplit - split a file into sections determined by context lines
- Copyright (C) 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 91, 1995-2003 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
{
struct line *p;
- p = (struct line *) xmalloc (sizeof (struct line));
+ p = xmalloc (sizeof (struct line));
p->next = NULL;
clear_line_control (p);
new_buffer = (struct buffer_record *)
xmalloc (sizeof (struct buffer_record));
- new_buffer->buffer = (char *) xmalloc (size + 1);
+ new_buffer->buffer = xmalloc (size + 1);
new_buffer->bytes_alloc = size;
new_buffer->line_start = new_buffer->curr_line = NULL;
{
control_allocated += ALLOC_SIZE;
controls = (struct control *)
- xrealloc ((char *) controls,
+ xrealloc (controls,
sizeof (struct control) * control_allocated);
}
p = &controls[control_used++];
p->argnum = argnum;
p->ignore = ignore;
- p->regexpr = (char *) xmalloc ((unsigned) (len + 1));
+ p->regexpr = xmalloc ((unsigned) (len + 1));
strncpy (p->regexpr, str + 1, len);
p->re_compiled.allocated = len * 2;
- p->re_compiled.buffer = (unsigned char *) xmalloc (p->re_compiled.allocated);
+ p->re_compiled.buffer = xmalloc (p->re_compiled.allocated);
p->re_compiled.fastmap = xmalloc (256);
p->re_compiled.translate = 0;
err = re_compile_pattern (p->regexpr, len, &p->re_compiled);
}
if (suffix)
- filename_space = (char *) xmalloc (strlen (prefix) + max_out (suffix) + 2);
+ filename_space = xmalloc (strlen (prefix) + max_out (suffix) + 2);
else
- filename_space = (char *) xmalloc (strlen (prefix) + digits + 2);
+ filename_space = xmalloc (strlen (prefix) + digits + 2);
set_input_file (argv[optind++]);
/* cut - remove parts of lines of files
- Copyright (C) 1984, 1997, 1998, 1999, 2000, 2001, 2002, 2003 by David M. Ihnat
+ Copyright (C) 1984, 1997-2003 by David M. Ihnat
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
if (n_rp >= n_rp_allocated) \
{ \
n_rp_allocated *= 2; \
- (rp) = (struct range_pair *) xrealloc ((char *) (rp), \
- n_rp_allocated * sizeof (*(rp))); \
+ (rp) = xrealloc (rp, n_rp_allocated * sizeof (*(rp))); \
} \
rp[n_rp].lo = (low); \
rp[n_rp].hi = (high); \
n_rp = 0;
n_rp_allocated = 16;
- rp = (struct range_pair *) xmalloc (n_rp_allocated * sizeof (*rp));
+ rp = xmalloc (n_rp_allocated * sizeof (*rp));
/* Collect and store in RP the range end points.
It also sets EOL_RANGE_START if appropriate. */
the field numbers corresponding to all finite ranges
(i.e. `2-6' or `-4', but not `5-') in FIELDSTR. */
- printable_field = (int *) xmalloc ((max_range_endpoint + 1) * sizeof (int));
+ printable_field = xmalloc ((max_range_endpoint + 1) * sizeof (int));
memset (printable_field, 0, (max_range_endpoint + 1) * sizeof (int));
/* Set the array entries corresponding to integers in the ranges of RP. */
/* date - print or set the system date and time
- Copyright (C) 1989-2002 Free Software Foundation, Inc.
+ Copyright (C) 1989-2003 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
{
int done;
out_length += 200;
- out = (char *) xrealloc (out, out_length);
+ out = xrealloc (out, out_length);
/* Mark the first byte of the buffer so we can detect the case
of nstrftime producing an empty string. Otherwise, this loop
{
struct fs_type_list *fsp;
- fsp = (struct fs_type_list *) xmalloc (sizeof (struct fs_type_list));
+ fsp = xmalloc (sizeof (struct fs_type_list));
fsp->fs_name = (char *) fstype;
fsp->fs_next = fs_select_list;
fs_select_list = fsp;
{
struct fs_type_list *fsp;
- fsp = (struct fs_type_list *) xmalloc (sizeof (struct fs_type_list));
+ fsp = xmalloc (sizeof (struct fs_type_list));
fsp->fs_name = (char *) fstype;
fsp->fs_next = fs_exclude_list;
fs_exclude_list = fsp;
struct entry *ent;
struct entry *ent_from_table;
- ent = (struct entry *) xmalloc (sizeof *ent);
+ ent = xmalloc (sizeof *ent);
ent->st_ino = ino;
ent->st_dev = dev;
/* expand - convert tabs to spaces
- Copyright (C) 89, 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 89, 91, 1995-2003 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
if (tabval == -1)
return;
if (first_free_tab % TABLIST_BLOCK == 0)
- tab_list = (int *) xrealloc ((char *) tab_list,
- (first_free_tab
- + TABLIST_BLOCK * sizeof (tab_list[0])));
+ tab_list = xrealloc (tab_list, (first_free_tab
+ + TABLIST_BLOCK * sizeof (tab_list[0])));
tab_list[first_free_tab++] = tabval;
}
/* expr -- evaluate expressions.
- Copyright (C) 86, 1991-1997, 1999-2002 Free Software Foundation, Inc.
+ Copyright (C) 86, 1991-1997, 1999-2003 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
re_buffer.allocated = 2 * len;
if (re_buffer.allocated < len)
xalloc_die ();
- re_buffer.buffer = (unsigned char *) xmalloc (re_buffer.allocated);
+ re_buffer.buffer = xmalloc (re_buffer.allocated);
re_buffer.translate = 0;
re_syntax_options = RE_SYNTAX_POSIX_BASIC;
errmsg = re_compile_pattern (pv->u.s, len, &re_buffer);
{
v = NEW (VALUE);
v->type = string;
- v->u.s = strncpy ((char *) xmalloc (i2->u.i + 1),
+ v->u.s = strncpy (xmalloc (i2->u.i + 1),
l->u.s + i1->u.i - 1, i2->u.i);
v->u.s[i2->u.i] = 0;
}
max_n_groups = getugroups (0, NULL, username, gid);
/* Add 1 just in case max_n_groups is zero. */
- g = (GETGROUPS_T *) xmalloc (max_n_groups * sizeof (GETGROUPS_T) + 1);
+ g = xmalloc (max_n_groups * sizeof (GETGROUPS_T) + 1);
if (username == 0)
ng = getgroups (max_n_groups, g);
else
if (line->nfields >= line->nfields_allocated)
{
line->nfields_allocated = (3 * line->nfields_allocated) / 2 + 1;
- line->fields = (struct field *) xrealloc ((char *) line->fields,
- (line->nfields_allocated
- * sizeof (struct field)));
+ line->fields = xrealloc (line->fields,
+ (line->nfields_allocated
+ * sizeof (struct field)));
}
line->fields[line->nfields].beg = field;
line->fields[line->nfields].len = len;
{
seq->count = 0;
seq->alloc = 1;
- seq->lines = (struct line *) xmalloc (seq->alloc * sizeof (struct line));
+ seq->lines = xmalloc (seq->alloc * sizeof (struct line));
}
/* Read a line from FP and add it to SEQ. Return 0 if EOF, 1 otherwise. */
{
seq->alloc *= 2;
seq->lines = (struct line *)
- xrealloc ((char *) seq->lines, seq->alloc * sizeof (struct line));
+ xrealloc (seq->lines, seq->alloc * sizeof (struct line));
}
if (get_line (fp, &seq->lines[seq->count]))
assert (file == 0 || file == 1 || file == 2);
assert (file == 0 ? field < 0 : field >= 0);
- o = (struct outlist *) xmalloc (sizeof (struct outlist));
+ o = xmalloc (sizeof (struct outlist));
o->file = file;
o->field = field;
o->next = NULL;
blank->buf.buffer = xmalloc (blank->buf.size);
buffer = (unsigned char *) blank->buf.buffer;
blank->fields = fields =
- (struct field *) xmalloc (sizeof (struct field) * count);
+ xmalloc (sizeof (struct field) * count);
for (i = 0; i < count; i++)
{
buffer[i] = '\t';
/* Compute MD5 or SHA1 checksum of files or strings
- Copyright (C) 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003 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
case 1: /* --string */
{
if (string == NULL)
- string = (char **) xmalloc ((argc - 1) * sizeof (char *));
+ string = xmalloc ((argc - 1) * sizeof (char *));
if (optarg == NULL)
optarg = "";
/* nl -- number lines of files
- Copyright (C) 89, 92, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 89, 92, 1995-2003 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
*typep = optarg++;
optlen = strlen (optarg);
regexp->allocated = optlen * 2;
- regexp->buffer = (unsigned char *) xmalloc (regexp->allocated);
+ regexp->buffer = xmalloc (regexp->allocated);
regexp->translate = NULL;
regexp->fastmap = xmalloc (256);
regexp->fastmap_accurate = 0;
/* od -- dump files in octal and other formats
- Copyright (C) 92, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 92, 1995-2003 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
if (n_specs >= n_specs_allocated)
{
n_specs_allocated = 1 + (3 * n_specs_allocated) / 2;
- spec = (struct tspec *) xrealloc ((char *) spec,
- (n_specs_allocated
- * sizeof (struct tspec)));
+ spec = xrealloc (spec, (n_specs_allocated * sizeof (struct tspec)));
}
memcpy ((char *) &spec[n_specs], (char *) &tspec,
n_specs = 0;
n_specs_allocated = 5;
- spec = (struct tspec *) xmalloc (n_specs_allocated * sizeof (struct tspec));
+ spec = xmalloc (n_specs_allocated * sizeof (struct tspec));
format_address = format_address_std;
address_base = 8;
/* paste - merge lines of files
- Copyright (C) 1984, 1997-2002 by David M. Ihnat
+ Copyright (C) 1984, 1997-2003 by David M. Ihnat
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
int i; /* Loop index. */
int opened_stdin = 0; /* Nonzero if any fopen got fd 0. */
- delbuf = (char *) xmalloc (file_list_size + 2);
- fileptr = (FILE **) xmalloc ((file_list_size + 1) * sizeof (FILE *));
+ delbuf = xmalloc (file_list_size + 2);
+ fileptr = xmalloc ((file_list_size + 1) * sizeof (FILE *));
/* Attempt to open all files. This could be expanded to an infinite
number of files, but at the (considerable) expense of remembering
if (files_open == file_list_size - 2)
{
file_list_size += 12;
- delbuf = (char *) xrealloc (delbuf, file_list_size + 2);
- fileptr = (FILE **) xrealloc ((char *) fileptr, (file_list_size + 1)
- * sizeof (FILE *));
+ delbuf = xrealloc (delbuf, file_list_size + 2);
+ fileptr = xrealloc (fileptr, (file_list_size + 1) * sizeof (FILE *));
}
if (STREQ (fnamptr[files_open], "-"))
{
/* pr -- convert text files for printing.
- Copyright (C) 88, 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 88, 91, 1995-2003 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
separator_string (const char *optarg_S)
{
col_sep_length = (int) strlen (optarg_S);
- col_sep_string = (char *) xmalloc (col_sep_length + 1);
+ col_sep_string = xmalloc (col_sep_length + 1);
strcpy (col_sep_string, optarg_S);
}
n_files = 0;
file_names = (argc > 1
- ? (char **) xmalloc ((argc - 1) * sizeof (char *))
+ ? xmalloc ((argc - 1) * sizeof (char *))
: NULL);
while ((c = getopt_long (argc, argv, short_options, long_options, NULL))
{
if (number_buff != NULL)
free (number_buff);
- number_buff = (char *) xmalloc (2 * chars_per_number);
+ number_buff = xmalloc (2 * chars_per_number);
}
/* Pick the maximum between the tab width and the width of an
to expand a tab which is not an input_tab-char. */
if (clump_buff != NULL)
free (clump_buff);
- clump_buff = (int *) xmalloc ((chars_per_input_tab > 8
+ clump_buff = xmalloc ((chars_per_input_tab > 8
? chars_per_input_tab : 8) * sizeof (int));
}
\f
if (column_vector != NULLCOL)
free ((char *) column_vector);
- column_vector = (COLUMN *) xmalloc (columns * sizeof (COLUMN));
+ column_vector = xmalloc (columns * sizeof (COLUMN));
if (parallel_files)
{
if (line_vector != NULL)
free ((int *) line_vector);
/* FIXME: here's where it was allocated. */
- line_vector = (int *) xmalloc ((total_lines + 1) * sizeof (int *));
+ line_vector = xmalloc ((total_lines + 1) * sizeof (int *));
if (end_vector != NULL)
free ((int *) end_vector);
- end_vector = (int *) xmalloc (total_lines * sizeof (int *));
+ end_vector = xmalloc (total_lines * sizeof (int *));
if (buff != NULL)
free (buff);
buff_allocated = (use_col_separator
? 2 * chars_if_truncate
: chars_if_truncate); /* Tune this. */
- buff = (char *) xmalloc (buff_allocated);
+ buff = xmalloc (buff_allocated);
}
/* Store all but the rightmost column.
{
/* May be too generous. */
buff_allocated = 2 * buff_allocated;
- buff = (char *) xrealloc (buff, buff_allocated * sizeof (char));
+ buff = xrealloc (buff, buff_allocated * sizeof (char));
}
buff[buff_current++] = (char) c;
}
pattern->buffer = NULL;
pattern->allocated = 0;
pattern->translate = ignore_case ? (char *) folded_chars : NULL;
- pattern->fastmap = (char *) xmalloc ((size_t) CHAR_SET_SIZE);
+ pattern->fastmap = xmalloc ((size_t) CHAR_SET_SIZE);
message = re_compile_pattern (string, (int) strlen (string), pattern);
if (message)
if (pattern->allocated > pattern->used)
{
pattern->buffer
- = (unsigned char *) xrealloc (pattern->buffer, (size_t) pattern->used);
+ = xrealloc (pattern->buffer, (size_t) pattern->used);
pattern->allocated = pattern->used;
}
{
size_t in_memory_size;
- block->start = (char *) xmalloc ((size_t) stat_block.st_size);
+ block->start = xmalloc ((size_t) stat_block.st_size);
if ((in_memory_size = read (file_handle,
block->start, (size_t) stat_block.st_size))
CR+LF. */
if (in_memory_size != (size_t)-1
&& in_memory_size >= stat_block.st_size / 2)
- block->start = (char *) xrealloc (block->start, in_memory_size);
+ block->start = xrealloc (block->start, in_memory_size);
else
#endif /* not MSDOS */
}
else
{
- block->start = (char *) xmalloc ((size_t) 1 << SWALLOW_REALLOC_LOG);
+ block->start = xmalloc ((size_t) 1 << SWALLOW_REALLOC_LOG);
used_length = 0;
allocated_length = (1 << SWALLOW_REALLOC_LOG);
{
allocated_length += (1 << SWALLOW_REALLOC_LOG);
block->start
- = (char *) xrealloc (block->start, allocated_length);
+ = xrealloc (block->start, allocated_length);
}
}
reference_max_width = reference_width;
}
reference_max_width++;
- reference.start = (char *) xmalloc ((size_t) reference_max_width + 1);
+ reference.start = xmalloc ((size_t) reference_max_width + 1);
}
/* If the reference appears to the left of the output line, reserve some
/* No more argument simply means: read standard input. */
- input_file_name = (const char **) xmalloc (sizeof (const char *));
- file_line_count = (int *) xmalloc (sizeof (int));
+ input_file_name = xmalloc (sizeof (const char *));
+ file_line_count = xmalloc (sizeof (int));
number_input_files = 1;
input_file_name[0] = NULL;
}
{
number_input_files = argc - optind;
input_file_name
- = (const char **) xmalloc (number_input_files * sizeof (const char *));
+ = xmalloc (number_input_files * sizeof (const char *));
file_line_count
- = (int *) xmalloc (number_input_files * sizeof (int));
+ = xmalloc (number_input_files * sizeof (int));
for (file_index = 0; file_index < number_input_files; file_index++)
{
/* There is one necessary input file. */
number_input_files = 1;
- input_file_name = (const char **) xmalloc (sizeof (const char *));
- file_line_count = (int *) xmalloc (sizeof (int));
+ input_file_name = xmalloc (sizeof (const char *));
+ file_line_count = xmalloc (sizeof (int));
if (!*argv[optind] || strcmp (argv[optind], "-") == 0)
input_file_name[0] = NULL;
else
/* sort - sort lines of text (with all kinds of options).
- Copyright (C) 88, 1991-2002 Free Software Foundation, Inc.
+ Copyright (C) 88, 1991-2003 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
char const *temp_dir = temp_dirs[temp_dir_index];
size_t len = strlen (temp_dir);
struct tempnode *node =
- (struct tempnode *) xmalloc (sizeof node->next + len + sizeof slashbase);
+ xmalloc (sizeof node->next + len + sizeof slashbase);
char *file = node->name;
memcpy (file, temp_dir, len);
s = (char *) nl_langinfo (ABMON_1 + i);
s_len = strlen (s);
- monthtab[i].name = name = (char *) xmalloc (s_len + 1);
+ monthtab[i].name = name = xmalloc (s_len + 1);
monthtab[i].val = i + 1;
for (j = 0; j < s_len; j++)
{
int i = n_temp_files;
struct tempnode *node;
- char **tempfiles = (char **) xmalloc (n_temp_files * sizeof (char *));
+ char **tempfiles = xmalloc (n_temp_files * sizeof (char *));
for (node = temphead; i > 0; node = node->next)
tempfiles[--i] = node->name;
merge (tempfiles, n_temp_files, NMERGE, output_file);
static struct keyfield *
new_key (void)
{
- struct keyfield *key = (struct keyfield *) xcalloc (1, sizeof *key);
+ struct keyfield *key = xcalloc (1, sizeof *key);
key->eword = -1;
return key;
}
gkey.numeric = gkey.general_numeric = gkey.month = gkey.reverse = 0;
gkey.skipsblanks = gkey.skipeblanks = 0;
- files = (char **) xmalloc (sizeof (char *) * argc);
+ files = xmalloc (sizeof (char *) * argc);
for (;;)
{
char *bp;
int eof = 0;
size_t n_buffered = 0;
- char *buf = (char *) xmalloc (n_bytes);
+ char *buf = xmalloc (n_bytes);
do
{
/* su for GNU. Run a shell with substitute user and group IDs.
- Copyright (C) 1992-2002 Free Software Foundation, Inc.
+ Copyright (C) 1992-2003 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
concat (const char *s1, const char *s2, const char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
- char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
+ char *result = xmalloc (len1 + len2 + len3 + 1);
strcpy (result, s1);
strcpy (result + len1, s2);
/* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
Unset all other environment variables. */
term = getenv ("TERM");
- environ = (char **) xmalloc (2 * sizeof (char *));
+ environ = xmalloc (2 * sizeof (char *));
environ[0] = 0;
if (term)
xputenv (concat ("TERM", "=", term));
int argno = 1;
if (additional_args)
- args = (const char **) xmalloc (sizeof (char *)
+ args = xmalloc (sizeof (char *)
* (10 + elements (additional_args)));
else
- args = (const char **) xmalloc (sizeof (char *) * 10);
+ args = xmalloc (sizeof (char *) * 10);
if (simulate_login)
{
char *arg0;
/* tail -- output the last part of file(s)
- Copyright (C) 1989, 90, 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 1995-2003 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
int errors = 0;
int nbytes; /* Size of most recent read */
- first = last = (LBUFFER *) xmalloc (sizeof (LBUFFER));
+ first = last = xmalloc (sizeof (LBUFFER));
first->nbytes = first->nlines = 0;
first->next = NULL;
- tmp = (LBUFFER *) xmalloc (sizeof (LBUFFER));
+ tmp = xmalloc (sizeof (LBUFFER));
/* Input is always read into a fresh buffer. */
while ((nbytes = tmp->nbytes = safe_read (fd, tmp->buffer, BUFSIZ)) > 0)
first = first->next;
}
else
- tmp = (LBUFFER *) xmalloc (sizeof (LBUFFER));
+ tmp = xmalloc (sizeof (LBUFFER));
}
}
int total_bytes = 0; /* Total characters in all buffers. */
int errors = 0;
- first = last = (CBUFFER *) xmalloc (sizeof (CBUFFER));
+ first = last = xmalloc (sizeof (CBUFFER));
first->nbytes = 0;
first->next = NULL;
- tmp = (CBUFFER *) xmalloc (sizeof (CBUFFER));
+ tmp = xmalloc (sizeof (CBUFFER));
/* Input is always read into a fresh buffer. */
while ((tmp->nbytes = safe_read (fd, tmp->buffer, BUFSIZ)) > 0)
}
else
{
- tmp = (CBUFFER *) xmalloc (sizeof (CBUFFER));
+ tmp = xmalloc (sizeof (CBUFFER));
}
}
}
file = &dummy_stdin;
}
- F = (struct File_spec *) xmalloc (n_files * sizeof (F[0]));
+ F = xmalloc (n_files * sizeof (F[0]));
for (i = 0; i < n_files; i++)
F[i].name = file[i];
/* tee - read from standard input and write to standard output and files.
- Copyright (C) 85,1990-2002 Free Software Foundation, Inc.
+ Copyright (C) 85,1990-2003 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
int ret = 0;
const char *mode_string = (append ? "a" : "w");
- descriptors = (FILE **) xmalloc ((nfiles + 1) * sizeof (descriptors[0]));
+ descriptors = xmalloc ((nfiles + 1) * sizeof (descriptors[0]));
/* Move all the names `up' one in the argv array to make room for
the entry for standard output. This writes into argv[argc]. */
/* tr -- a filter to translate characters
- Copyright (C) 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 91, 1995-2003 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
len = strlen ((char *) s);
- es->s = (unsigned char *) xmalloc (len);
- es->escaped = (int *) xmalloc (len * sizeof (es->escaped[0]));
+ es->s = xmalloc (len);
+ es->escaped = xmalloc (len * sizeof (es->escaped[0]));
for (i = 0; i < len; i++)
es->escaped[i] = 0;
{
struct List_element *new;
- new = (struct List_element *) xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof (struct List_element));
new->next = NULL;
new->type = RE_NORMAL_CHAR;
new->u.normal_char = c;
free (tmp2);
return 1;
}
- new = (struct List_element *) xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof (struct List_element));
new->next = NULL;
new->type = RE_RANGE;
new->u.range.first_char = first;
char_class = look_up_char_class (char_class_str, len);
if (char_class == CC_NO_CLASS)
return 1;
- new = (struct List_element *) xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof (struct List_element));
new->next = NULL;
new->type = RE_CHAR_CLASS;
new->u.char_class = char_class;
{
struct List_element *new;
- new = (struct List_element *) xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof (struct List_element));
new->next = NULL;
new->type = RE_REPEATED_CHAR;
new->u.repeated_char.the_repeated_char = the_char;
if (len != 1)
return 1;
- new = (struct List_element *) xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof (struct List_element));
new->next = NULL;
new->type = RE_EQUIV_CLASS;
new->u.equiv_code = *equiv_class_str;
static unsigned char *
xmemdup (const unsigned char *p, size_t len)
{
- unsigned char *tmp = (unsigned char *) xmalloc (len);
+ unsigned char *tmp = xmalloc (len);
/* Use memcpy rather than strncpy because `p' may contain zero-bytes. */
memcpy (tmp, p, len);
spec_init (struct Spec_list *spec_list)
{
spec_list->head = spec_list->tail =
- (struct List_element *) xmalloc (sizeof (struct List_element));
+ xmalloc (sizeof (struct List_element));
spec_list->head->next = NULL;
}
if (tabval == -1)
return;
if (first_free_tab % TABLIST_BLOCK == 0)
- tab_list = (int *) xrealloc ((char *) tab_list,
- first_free_tab + TABLIST_BLOCK);
+ tab_list = xrealloc (tab_list, first_free_tab + TABLIST_BLOCK);
tab_list[first_free_tab++] = tabval;
}
/* GNU's users.
- Copyright (C) 1992-2002 Free Software Foundation, Inc.
+ Copyright (C) 1992-2003 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
int n_entries;
n_entries = 0;
- u = (char **) xmalloc (n * sizeof (u[0]));
+ u = xmalloc (n * sizeof (u[0]));
for (i = 0; i < n; i++)
{
if (UT_USER (this) [0]