summaryrefslogtreecommitdiff
path: root/chooser
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-05-14 10:44:06 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-05-16 14:50:27 -0700
commit47c1b146c786f057026ea2ad89b8cb4c51ee3d50 (patch)
treef53c227ee273a6ed872667cad177b79f51c2faf9 /chooser
parentf29b73ba549fbdcbe1361c016fc40cc424c32e9b (diff)
Stop casting return values of malloc and friends
It's not needed on modern mallocs that return void *, and can hide missing prototype errors that cause the compiler to assume int is returned (a bad thing to assume in 64-bit builds). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Diffstat (limited to 'chooser')
-rw-r--r--chooser/chooser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/chooser/chooser.c b/chooser/chooser.c
index 6033fb4..dc1b89a 100644
--- a/chooser/chooser.c
+++ b/chooser/chooser.c
@@ -304,7 +304,7 @@ RebuildTable (int size)
if (size)
{
- newTable = (char **) malloc (size * sizeof (char *));
+ newTable = malloc (size * sizeof (char *));
if (!newTable)
return;
for (names = hostNamedb, i = 0; names; names = names->next, i++)
@@ -360,7 +360,7 @@ AddHostname (ARRAY8Ptr hostname, ARRAY8Ptr status, struct sockaddr *addr, int wi
}
if (!*names)
{
- new = (HostName *) malloc (sizeof (HostName));
+ new = malloc (sizeof (HostName));
if (!new)
return 0;
if (hostname->length)
@@ -545,10 +545,10 @@ RegisterHostaddr (struct sockaddr *addr, int len, xdmOpCode type)
{
HostAddr *host, **prev;
- host = (HostAddr *) malloc (sizeof (HostAddr));
+ host = malloc (sizeof (HostAddr));
if (!host)
return;
- host->addr = (struct sockaddr *) malloc (len);
+ host->addr = malloc (len);
if (!host->addr)
{
free (host);