|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2004-08-14 21:44:48
On 8/10/04 11:32 AM, "Bert Klaps" <bertk_at_[hidden]> wrote:
> I ran into a problem using the CRC library for SDH LCAS control words
> (3-bit CRC) and SDH Trail Trace Identifier messages (7-bit CRC).
Could you provide sample data and answer so a new test case can be added?
> For CRC widths smaller than character width the theoretical and
> optimized CRC computers produce different results for non-reflected
> input. Gcc produces this warning:
>
> /usr/local/boost/boost_1_31_0/boost/crc.hpp:581: warning: right shift
> count >= width of type
>
> The problem is that for the table based computer the msb of
> the remainder needs to be compared to the msb of the input byte.
> For most popular CRC parameters that's a right shift, but for CRC
> widths smaller than a character this should be a left shift...
>
> Reflected input requires comparing lsb's which doesn't involve any
> shifting.
>
> I've attached a patch that solved the problem for me.
[TRUNCATED list of errors and the patch]
Does anyone know how to add patches to a file? (It looked like it was in a
"diff" format. Isn't there an automated tool for this, or do I apply the
changes manually?)
Have we branched for release yet? I don't want to add the changes (to the
main line) until then so I won't risk breaking the release build.
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk