Module Name:    src
Committed By:   dholland
Date:           Sat Mar 22 22:09:14 UTC 2014

Modified Files:
        src/games/atc: grammar.y list.c

Log Message:
Don't cast the return value of malloc.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/atc/grammar.y
cvs rdiff -u -r1.7 -r1.8 src/games/atc/list.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/atc/grammar.y
diff -u src/games/atc/grammar.y:1.10 src/games/atc/grammar.y:1.11
--- src/games/atc/grammar.y:1.10	Wed Aug 12 04:48:03 2009
+++ src/games/atc/grammar.y	Sat Mar 22 22:09:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $	*/
+/*	$NetBSD: grammar.y,v 1.11 2014/03/22 22:09:14 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)grammar.y	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $");
+__RCSID("$NetBSD: grammar.y,v 1.11 2014/03/22 22:09:14 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -175,10 +175,10 @@ Bpoint:
 		{
 		if (sp->num_beacons % REALLOC == 0) {
 			if (sp->beacon == NULL)
-				sp->beacon = (BEACON *) malloc((sp->num_beacons
+				sp->beacon = malloc((sp->num_beacons
 					+ REALLOC) * sizeof (BEACON));
 			else
-				sp->beacon = (BEACON *) realloc(sp->beacon,
+				sp->beacon = realloc(sp->beacon,
 					(sp->num_beacons + REALLOC) * 
 					sizeof (BEACON));
 			if (sp->beacon == NULL)
@@ -205,10 +205,10 @@ Epoint:
 
 		if (sp->num_exits % REALLOC == 0) {
 			if (sp->exit == NULL)
-				sp->exit = (EXIT *) malloc((sp->num_exits + 
+				sp->exit = malloc((sp->num_exits + 
 					REALLOC) * sizeof (EXIT));
 			else
-				sp->exit = (EXIT *) realloc(sp->exit,
+				sp->exit = realloc(sp->exit,
 					(sp->num_exits + REALLOC) * 
 					sizeof (EXIT));
 			if (sp->exit == NULL)
@@ -238,10 +238,10 @@ Apoint:
 
 		if (sp->num_airports % REALLOC == 0) {
 			if (sp->airport == NULL)
-				sp->airport=(AIRPORT *)malloc((sp->num_airports
+				sp->airport = malloc((sp->num_airports
 					+ REALLOC) * sizeof(AIRPORT));
 			else
-				sp->airport = (AIRPORT *) realloc(sp->airport,
+				sp->airport = realloc(sp->airport,
 					(sp->num_airports + REALLOC) * 
 					sizeof(AIRPORT));
 			if (sp->airport == NULL)
@@ -268,10 +268,10 @@ Lline:
 		{
 		if (sp->num_lines % REALLOC == 0) {
 			if (sp->line == NULL)
-				sp->line = (LINE *) malloc((sp->num_lines + 
+				sp->line = malloc((sp->num_lines + 
 					REALLOC) * sizeof (LINE));
 			else
-				sp->line = (LINE *) realloc(sp->line,
+				sp->line = realloc(sp->line,
 					(sp->num_lines + REALLOC) *
 					sizeof (LINE));
 			if (sp->line == NULL)

Index: src/games/atc/list.c
diff -u src/games/atc/list.c:1.7 src/games/atc/list.c:1.8
--- src/games/atc/list.c:1.7	Fri Jul  1 00:48:34 2005
+++ src/games/atc/list.c	Sat Mar 22 22:09:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: list.c,v 1.7 2005/07/01 00:48:34 jmc Exp $	*/
+/*	$NetBSD: list.c,v 1.8 2014/03/22 22:09:14 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)list.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: list.c,v 1.7 2005/07/01 00:48:34 jmc Exp $");
+__RCSID("$NetBSD: list.c,v 1.8 2014/03/22 22:09:14 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,7 +55,7 @@ __RCSID("$NetBSD: list.c,v 1.7 2005/07/0
 PLANE *
 newplane(void)
 {
-	return ((PLANE *) calloc(1, sizeof (PLANE)));
+	return calloc(1, sizeof (PLANE));
 }
 
 void

Reply via email to