Remove a bunch of redundant casts.

This commit is contained in:
Markus Armbruster 2005-06-12 06:31:48 +00:00
parent ee6d72f3b8
commit 4f59fc9967
125 changed files with 417 additions and 432 deletions

View file

@ -89,7 +89,7 @@ io_open(int fd, int flags, int bufsize, int (*notify)(void),
flags = flags & (IO_READ | IO_WRITE | IO_NBLOCK | IO_NEWSOCK);
if ((flags & (IO_READ | IO_WRITE)) == 0)
return NULL;
iop = (struct iop *)malloc(sizeof(struct iop));
iop = malloc(sizeof(struct iop));
if (!iop)
return NULL;
iop->fd = fd;
@ -122,7 +122,7 @@ io_close(struct iop *iop)
#else
closesocket(iop->fd);
#endif
free((s_char *)iop);
free(iop);
}
int

View file

@ -66,7 +66,7 @@ ioq_create(int size)
{
struct ioqueue *ioq;
ioq = (struct ioqueue *)malloc(sizeof(struct ioqueue));
ioq = malloc(sizeof(struct ioqueue));
emp_initque(&ioq->list.queue);
ioq->list.nbytes = 0;
ioq->list.offset = 0;
@ -84,7 +84,7 @@ ioq_destroy(struct ioqueue *ioq)
/* ioq_drain doesn't work under aix or NeXT... dunno why --ts */
ioq_drain(ioq);
#endif /* aix */
free((s_char *)ioq);
free(ioq);
}
void
@ -318,7 +318,7 @@ appendcc(struct ioqueue *ioq, s_char *buf, int cc)
len = cc > ioq->bufsize ? cc : ioq->bufsize;
ptr = malloc(len);
memcpy(ptr, buf, cc);
io = (struct io *)malloc(sizeof(struct io));
io = malloc(sizeof(struct io));
io->nbytes = cc;
io->size = len;
io->offset = 0;

View file

@ -41,7 +41,7 @@ strdup(char *x)
{
char *y;
y = (char *)malloc((sizeof(char) * strlen(x)) + 1);
y = malloc((sizeof(char) * strlen(x)) + 1);
strcpy(y, x);
return y;
}