summaryrefslogtreecommitdiff
path: root/libsi/util.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-28 14:19:16 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-28 14:19:16 +0200
commit1e63fa4174c73d8ea4d257b883a9ac926a87311d (patch)
tree130f5125303bb9f1192cab935f659f3b6855a911 /libsi/util.c
parentae3da0bcec271892b4e4aa1c34a0eb06c3856035 (diff)
downloadvdr-1e63fa4174c73d8ea4d257b883a9ac926a87311d.tar.gz
vdr-1e63fa4174c73d8ea4d257b883a9ac926a87311d.tar.bz2
Avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the '& 0xff' in CRC32::crc32() of libsi/util.c
Diffstat (limited to 'libsi/util.c')
-rw-r--r--libsi/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsi/util.c b/libsi/util.c
index c6ad234a..34657948 100644
--- a/libsi/util.c
+++ b/libsi/util.c
@@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: util.c 1.4 2004/10/16 09:58:41 kls Exp $
+ * $Id: util.c 1.5 2005/05/28 14:15:29 kls Exp $
* *
***************************************************************************/
@@ -263,9 +263,10 @@ u_int32_t CRC32::crc_table[256] = {
u_int32_t CRC32::crc32 (const char *d, int len, u_int32_t crc)
{
register int i;
+ const unsigned char *u=(unsigned char*)d; // Saves '& 0xff'
for (i=0; i<len; i++)
- crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *d++) & 0xff];
+ crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *u++)];
return crc;
}