Revision: 301
http://freestdf.svn.sourceforge.net/freestdf/?rev=301&view=rev
Author: vapier
Date: 2007-11-26 08:01:46 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
remove pointless casts on return value of malloc()
Modified Paths:
--------------
trunk/liblzw/lzw.c
Modified: trunk/liblzw/lzw.c
===================================================================
--- trunk/liblzw/lzw.c 2007-11-26 15:55:33 UTC (rev 300)
+++ trunk/liblzw/lzw.c 2007-11-26 16:01:46 UTC (rev 301)
@@ -56,14 +56,14 @@
if (buf[0] != LZW_MAGIC_1 || buf[1] != LZW_MAGIC_2 || buf[2] & 0x60)
goto err_out;
- if ((ret = (lzwFile*)malloc(sizeof(lzwFile))) == NULL)
+ if ((ret = malloc(sizeof(*ret))) == NULL)
goto err_out;
memset(ret, 0x00, sizeof(*ret));
ret->fd = fd;
ret->eof = 0;
- ret->inbuf = (unsigned char*)malloc(sizeof(unsigned char) * IN_BUFSIZE);
- ret->outbuf = (unsigned char*)malloc(sizeof(unsigned char) * OUT_BUFSIZE);
+ ret->inbuf = malloc(sizeof(unsigned char) * IN_BUFSIZE);
+ ret->outbuf = malloc(sizeof(unsigned char) * OUT_BUFSIZE);
ret->stackp = NULL;
ret->insize = 3; /* we read three bytes above */
ret->outpos = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|