From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Steven Cole <elenstev@mesatop.com>, linux-kernel@vger.kernel.org
Subject: [Patch] 2.5.70-bk11 zlib cleanup #4 casts
Date: Fri, 6 Jun 2003 20:52:10 +0200 [thread overview]
Message-ID: <20030606185210.GE10487@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20030606183920.GC10487@wohnheim.fh-wedel.de>
Hi Linus!
As promised, the NULL casts.
Jörn
--
Beware of bugs in the above code; I have only proved it correct, but
not tried it.
-- Donald Knuth
--- linux-2.5.70-bk11/lib/zlib_deflate/deflate.c~zlib_cleanup_casts 2003-06-06 20:14:27.000000000 +0200
+++ linux-2.5.70-bk11/lib/zlib_deflate/deflate.c 2003-06-06 20:44:51.000000000 +0200
@@ -962,7 +962,7 @@
#define FLUSH_BLOCK_ONLY(s, eof) { \
zlib_tr_flush_block(s, (s->block_start >= 0L ? \
(char *)&s->window[(unsigned)s->block_start] : \
- (char *)NULL), \
+ NULL), \
(ulg)((long)s->strstart - s->block_start), \
(eof)); \
s->block_start = s->strstart; \
--- linux-2.5.70-bk11/lib/zlib_inflate/infblock.c~zlib_cleanup_casts 2003-06-06 20:14:27.000000000 +0200
+++ linux-2.5.70-bk11/lib/zlib_inflate/infblock.c 2003-06-06 20:45:51.000000000 +0200
@@ -80,7 +80,7 @@
s->bitb = 0;
s->read = s->write = s->window;
if (s->checkfn != NULL)
- z->adler = s->check = (*s->checkfn)(0L, (const Byte *)NULL, 0);
+ z->adler = s->check = (*s->checkfn)(0L, NULL, 0);
}
inflate_blocks_statef *zlib_inflate_blocks_new(
--- linux-2.5.70-bk11/lib/zlib_inflate/inftrees.c~zlib_cleanup_casts 2003-06-06 20:14:27.000000000 +0200
+++ linux-2.5.70-bk11/lib/zlib_inflate/inftrees.c 2003-06-06 20:47:11.000000000 +0200
@@ -139,7 +139,7 @@
} while (--i);
if (c[0] == n) /* null input--all zero length codes */
{
- *t = (inflate_huft *)NULL;
+ *t = NULL;
*m = 0;
return Z_OK;
}
@@ -193,8 +193,8 @@
p = v; /* grab values in bit order */
h = -1; /* no tables yet--level -1 */
w = -l; /* bits decoded == (l * h) */
- u[0] = (inflate_huft *)NULL; /* just to keep compilers happy */
- q = (inflate_huft *)NULL; /* ditto */
+ u[0] = NULL; /* just to keep compilers happy */
+ q = NULL; /* ditto */
z = 0; /* ditto */
/* go through the bit lengths (k already is bits in shortest code) */
@@ -302,8 +302,7 @@
uInt *v; /* work area for huft_build */
v = WS(z)->tree_work_area_1;
- r = huft_build(c, 19, 19, (uInt*)NULL, (uInt*)NULL,
- tb, bb, hp, &hn, v);
+ r = huft_build(c, 19, 19, NULL, NULL, tb, bb, hp, &hn, v);
if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed dynamic bit lengths tree";
else if (r == Z_BUF_ERROR || *bb == 0)
next prev parent reply other threads:[~2003-06-06 18:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-06 18:31 [Patch] 2.5.70-bk11 zlib cleanup #1 local Jörn Engel
2003-06-06 18:32 ` [Patch] 2.5.70-bk11 zlib cleanup #2 cpp Jörn Engel
2003-06-06 18:39 ` [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL Jörn Engel
2003-06-06 18:52 ` Jörn Engel [this message]
2003-06-06 19:23 ` [Patch] 2.5.70-bk11 zlib merge #1 turboc Jörn Engel
2003-06-06 19:28 ` [Patch] 2.5.70-bk11 zlib merge #2 return code Jörn Engel
2003-06-06 20:00 ` [Patch] 2.5.70-bk11 zlib merge #3 inffast.c Jörn Engel
2003-06-06 20:13 ` [Patch] 2.5.70-bk11 zlib merge #4 pure magic Jörn Engel
2003-06-06 20:36 ` Bartlomiej Zolnierkiewicz
2003-06-06 21:38 ` Is there a bug with su, and /dev/std*? J.C. Wren
2003-06-07 9:20 ` [Patch] 2.5.70-bk11 zlib merge #4 pure magic Jörn Engel
2003-06-07 9:40 ` Paul Mackerras
2003-06-07 10:02 ` Jörn Engel
2003-06-07 11:42 ` Paul Mackerras
2003-06-06 18:54 ` [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL Linus Torvalds
2003-06-06 19:13 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030606185210.GE10487@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=elenstev@mesatop.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®