diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-22 14:47:42 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-22 14:47:42 +0000 |
commit | fc43d761647911712e283aebdd395fc5fdf2ef92 (patch) | |
tree | dc18572a7fdd2a295250a5a1d93dd8a176988fdf /games/monop | |
parent | 5c21feb489b7dd8e2c1faada3f182e9e1899ced8 (diff) |
remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok millert krw
Diffstat (limited to 'games/monop')
-rw-r--r-- | games/monop/cards.c | 4 | ||||
-rw-r--r-- | games/monop/execute.c | 4 | ||||
-rw-r--r-- | games/monop/initdeck.c | 6 | ||||
-rw-r--r-- | games/monop/monop.c | 4 | ||||
-rw-r--r-- | games/monop/prop.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/games/monop/cards.c b/games/monop/cards.c index 4ceb220f9cf..8c37ff054f2 100644 --- a/games/monop/cards.c +++ b/games/monop/cards.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cards.c,v 1.9 2009/10/27 23:59:26 deraadt Exp $ */ +/* $OpenBSD: cards.c,v 1.10 2015/08/22 14:47:41 deraadt Exp $ */ /* $NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $ */ /* @@ -88,7 +88,7 @@ set_up(dp) int r1, r2; int i; - if ((dp->offsets = (int32_t *) calloc(dp->num_cards, sizeof (int32_t))) == NULL) + if ((dp->offsets = calloc(dp->num_cards, sizeof (int32_t))) == NULL) err(1, NULL); for (i = 0 ; i < dp->num_cards ; i++) { if (fread(&dp->offsets[i], sizeof(dp->offsets[i]), 1, deckf) != 1) diff --git a/games/monop/execute.c b/games/monop/execute.c index de6d7436db0..59c5b9226c4 100644 --- a/games/monop/execute.c +++ b/games/monop/execute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: execute.c,v 1.10 2014/12/08 21:11:02 tedu Exp $ */ +/* $OpenBSD: execute.c,v 1.11 2015/08/22 14:47:41 deraadt Exp $ */ /* $NetBSD: execute.c,v 1.3 1995/03/23 08:34:38 cgd Exp $ */ /* @@ -324,7 +324,7 @@ badness: player < 0 || player >= num_play || num_doub < 0 || num_doub > 2) goto badness; - if ((play = (PLAY *)calloc(num_play, sizeof(PLAY))) == NULL) + if ((play = calloc(num_play, sizeof(PLAY))) == NULL) err(1, NULL); cur_p = play + player; /* Names */ diff --git a/games/monop/initdeck.c b/games/monop/initdeck.c index 7b51519108c..210adfa7c7f 100644 --- a/games/monop/initdeck.c +++ b/games/monop/initdeck.c @@ -1,4 +1,4 @@ -/* $OpenBSD: initdeck.c,v 1.13 2009/10/27 23:59:26 deraadt Exp $ */ +/* $OpenBSD: initdeck.c,v 1.14 2015/08/22 14:47:41 deraadt Exp $ */ /* $NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $ */ /* @@ -77,9 +77,9 @@ main(ac, av) /* * allocate space for pointers. */ - if ((CC_D.offsets = (int32_t *)calloc(CC_D.num_cards + 1, + if ((CC_D.offsets = calloc(CC_D.num_cards + 1, sizeof (int32_t))) == NULL || - (CH_D.offsets = (int32_t *)calloc(CH_D.num_cards + 1, + (CH_D.offsets = calloc(CH_D.num_cards + 1, sizeof (int32_t))) == NULL) err(1, NULL); fseek(inf, 0L, SEEK_SET); diff --git a/games/monop/monop.c b/games/monop/monop.c index 123923f0208..c8136f9dbee 100644 --- a/games/monop/monop.c +++ b/games/monop/monop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monop.c,v 1.12 2014/12/08 21:11:02 tedu Exp $ */ +/* $OpenBSD: monop.c,v 1.13 2015/08/22 14:47:41 deraadt Exp $ */ /* $NetBSD: monop.c,v 1.3 1995/03/23 08:34:52 cgd Exp $ */ /* @@ -85,7 +85,7 @@ blew_it: else break; } - if ((cur_p = play = (PLAY *) calloc(num_play, sizeof (PLAY))) == NULL) + if ((cur_p = play = calloc(num_play, sizeof (PLAY))) == NULL) err(1, NULL); for (i = 0; i < num_play; i++) { do { diff --git a/games/monop/prop.c b/games/monop/prop.c index be3044b8bda..8ef55250af0 100644 --- a/games/monop/prop.c +++ b/games/monop/prop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prop.c,v 1.8 2014/12/08 21:11:02 tedu Exp $ */ +/* $OpenBSD: prop.c,v 1.9 2015/08/22 14:47:41 deraadt Exp $ */ /* $NetBSD: prop.c,v 1.3 1995/03/23 08:35:06 cgd Exp $ */ /* @@ -61,7 +61,7 @@ add_list(plr, head, op_sqr) OWN *tp, *last_tp; OWN *op; - if ((op = (OWN *)calloc(1, sizeof (OWN))) == NULL) + if ((op = calloc(1, sizeof (OWN))) == NULL) err(1, NULL); op->sqr = &board[op_sqr]; val = value(op->sqr); |