Module Name: xsrc Committed By: tsutsui Date: Tue Nov 3 16:59:38 UTC 2020
Modified Files: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kConfig.c x68kGraph.c Log Message: Remove unnecessary pointer casts from malloc(3). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c cvs rdiff -u -r1.7 -r1.8 \ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.5 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.6 --- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.5 Sat Aug 1 20:09:03 2020 +++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c Tue Nov 3 16:59:38 2020 @@ -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 @@ getToken(void) 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 @@ getToken(void) /* 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 @@ parseCommand(void) 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 @@ parseModeDef(int argc, Token **argv) 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 @@ parseMode(int argc, Token **argv) 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) { Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.7 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.8 --- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.7 Sat Aug 1 20:21:00 2020 +++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c Tue Nov 3 16:59:38 2020 @@ -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 @@ x68kCfbFinishScreenInit( 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 @@ x68kCfbFinishScreenInit( 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 );