Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2009-09-30

    * pycrc.py: fixed a bug that caused the result of the Python table-driven
    code not being evaluated at all.
    Closes issue 2870630. Thanks to Ildar Muslukhov.
  • Loading branch information...
commit 13a68eedd48b9f8fb934ed95ae83946ca47a554e 1 parent 24dc5fb
Thomas Pircher authored
View
10 ChangeLog
@@ -1,4 +1,14 @@
#
+# Version 0.7.2, 2009-09-30
+#
+
+2009-09-30 Thomas Pircher <tehpeh@gmx.net>
+
+ * pycrc.py: fixed a bug that caused the result of the Python table-driven
+ code not being evaluated at all.
+ Closes issue 2870630. Thanks to Ildar Muslukhov.
+
+#
# Version 0.7.1, 2009-04-05
#
View
2  crc_opt.py
@@ -53,7 +53,7 @@ class Options(object):
Program details
"""
ProgramName = "pycrc"
- Version = "0.7.1"
+ Version = "0.7.2"
VersionStr = "%s v%s" % (ProgramName, Version)
WebAddress = "http://www.tty1.net/pycrc/"
View
7 doc/pycrc.xml
@@ -29,7 +29,7 @@
<refnamediv>
<refname>&program_name;</refname>
- <refpurpose>a parametrisable Cyclic Redundancy Check (CRC) calculation utility and C source code generator written in Python</refpurpose>
+ <refpurpose>pycrc is a free, easy to use Cyclic Redundancy Check (CRC) calculator and source code generator.</refpurpose>
</refnamediv>
<refentryinfo>
@@ -40,6 +40,7 @@
<firstname>&author_firstname;</firstname>
<surname>&author_surname;</surname>
<email>&author_email;</email>
+ <contrib>Author of pycrc and of this manual page</contrib>
</author>
<date>&date;</date>
</refentryinfo>
@@ -55,8 +56,8 @@
<para>
<ulink url="http://www.tty1.net/pycrc/">&program_name;</ulink>
provides a parametrised CRC reference implementation written in Python and a source code generator for C.
- Different variants of the CRC algorithm are supported and range from a fast but space-consuming implementation to slower
- but smaller code suitable especially for embedded applications.
+ The generated C source code can be optimized for simplicity, speed or tight memory constraints for embedded platforms.
+
The following operations are implemented:
<itemizedlist>
<listitem>
View
16 pycrc.py
@@ -89,28 +89,28 @@ def check_string(opt):
if opt.Algorithm & opt.Algo_Bit_by_Bit:
bbb_crc = alg.bit_by_bit(opt.CheckString)
if crc != None and bbb_crc != crc:
- error = True;
+ error = True
crc = bbb_crc
if opt.Algorithm & opt.Algo_Bit_by_Bit_Fast:
bbf_crc = alg.bit_by_bit_fast(opt.CheckString)
if crc != None and bbf_crc != crc:
- error = True;
+ error = True
crc = bbf_crc
if opt.Algorithm & opt.Algo_Table_Driven:
opt.TableIdxWidth = 8 # FIXME cowardly refusing to use less bits for the table
tbl_crc = alg.table_driven(opt.CheckString)
if crc != None and tbl_crc != crc:
- error = True;
- crc - tbl_crc
+ error = True
+ crc = tbl_crc
if error:
- sys.stderr.write("Error: different checksums:\n");
+ sys.stderr.write("Error: different checksums:\n")
if opt.Algorithm & opt.Algo_Bit_by_Bit:
- sys.stderr.write(" bit-by-bit: 0x%x\n" % bbb_crc);
+ sys.stderr.write(" bit-by-bit: 0x%x\n" % bbb_crc)
if opt.Algorithm & opt.Algo_Bit_by_Bit_Fast:
- sys.stderr.write(" bit-by-bit-fast: 0x%x\n" % bbf_crc);
+ sys.stderr.write(" bit-by-bit-fast: 0x%x\n" % bbf_crc)
if opt.Algorithm & opt.Algo_Table_Driven:
- sys.stderr.write(" table_driven: 0x%x\n" % tbl_crc);
+ sys.stderr.write(" table_driven: 0x%x\n" % tbl_crc)
sys.exit(1)
return crc
View
2  test/test.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
set -e
PYCRC=`dirname $0`/../pycrc.py
Please sign in to comment.
Something went wrong with that request. Please try again.