Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k Remove unnece...
details: https://anonhg.NetBSD.org/xsrc/rev/16e4231610a7
branches: trunk
changeset: 10617:16e4231610a7
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Tue Nov 03 16:59:38 2020 +0000
description:
Remove unnecessary pointer casts from malloc(3).
diffstat:
external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c | 12 ++++++------
external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c | 14 +++++++-------
2 files changed, 13 insertions(+), 13 deletions(-)
diffs (89 lines):
diff -r 730b6b3ff1f7 -r 16e4231610a7 external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c
--- a/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c Tue Nov 03 15:52:57 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c Tue Nov 03 16:59:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kConfig.c,v 1.5 2020/08/01 20:09:03 tsutsui Exp $ */
+/* $NetBSD: x68kConfig.c,v 1.6 2020/11/03 16:59:38 tsutsui Exp $ */
/*-------------------------------------------------------------------------
* Copyright (c) 1996 Yasushi Yamasaki
* All rights reserved.
@@ -176,7 +176,7 @@
static int line = 1;
Token *ret;
- ret = (Token *)malloc(sizeof(Token));
+ ret = malloc(sizeof(Token));
if (ret == NULL)
FatalError("Out of memory");
while (TRUE) {
@@ -202,7 +202,7 @@
/* is a symbol? */
if (isalpha(c)) {
int i = 0;
- ret->content.symbol = (char *)malloc(32 * sizeof(char));
+ ret->content.symbol = malloc(32 * sizeof(char));
if (ret->content.symbol == NULL)
FatalError("Out of memory");
do {
@@ -295,7 +295,7 @@
break;
}
argc++;
- argv = (Token **)realloc(argv, sizeof(Token *) * argc);
+ argv = realloc(argv, sizeof(Token *) * argc);
if (argv == NULL)
FatalError("Out of memory");
argv[argc-1] = token;
@@ -395,7 +395,7 @@
checkArguments(18, argtype, argc-1, argv);
- mode = (Mode *)malloc(sizeof(Mode));
+ mode = malloc(sizeof(Mode));
if (mode == NULL)
FatalError("Out of memory");
mode->name = strdup(argv[1]->content.symbol);
@@ -545,7 +545,7 @@
x68kFbProc[0].open = x68kGraphOpen;
x68kFbProc[0].init = x68kGraphInit;
x68kFbProc[0].close = x68kGraphClose;
- x68kFormat = (PixmapFormatRec*) malloc (sizeof(PixmapFormatRec));
+ x68kFormat = malloc (sizeof(PixmapFormatRec));
x68kFormat->scanlinePad = BITMAP_SCANLINE_PAD;
x68kFormat->bitsPerPixel = 16;
switch (mode->depth) {
diff -r 730b6b3ff1f7 -r 16e4231610a7 external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c
--- a/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c Tue Nov 03 15:52:57 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c Tue Nov 03 16:59:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kGraph.c,v 1.7 2020/08/01 20:21:00 tsutsui Exp $ */
+/* $NetBSD: x68kGraph.c,v 1.8 2020/11/03 16:59:38 tsutsui Exp $ */
/*-------------------------------------------------------------------------
* Copyright (c) 1996 Yasushi Yamasaki
* All rights reserved.
@@ -264,9 +264,9 @@
ndepths = 1;
nvisuals = 1;
- depths = (DepthPtr)malloc( sizeof(DepthRec) );
- visuals = (VisualPtr)malloc( sizeof(VisualRec) );
- vid = (VisualID *)malloc( sizeof(VisualID) );
+ depths = malloc( sizeof(DepthRec) );
+ visuals = malloc( sizeof(VisualRec) );
+ vid = malloc( sizeof(VisualID) );
if( !depths || !visuals || !vid ) {
free( depths );
free( visuals );
@@ -296,9 +296,9 @@
ndepths = 1;
nvisuals = 1;
- depths = (DepthPtr)malloc( sizeof(DepthRec) );
- visuals = (VisualPtr)malloc( sizeof(VisualRec) );
- vid = (VisualID *)malloc( sizeof(VisualID) );
+ depths = malloc( sizeof(DepthRec) );
+ visuals = malloc( sizeof(VisualRec) );
+ vid = malloc( sizeof(VisualID) );
if( !depths || !visuals || !vid ) {
free( depths );
free( visuals );
Home |
Main Index |
Thread Index |
Old Index