Boost logo

Boost :

From: Joel Young (jdy_at_[hidden])
Date: 2001-03-21 12:59:00


From: Daryle Walker <darylew_at_[hidden]>
>
> on 3/21/01 3:50 AM, boost_at_[hidden] at boost_at_[hidden] wrote:
>
> > Description : Version 8; CRC checksum computation
>
> anyone who had problems running the previous formal version check if this

I get this error stream with gcc-2.96 (equiv from 2.95.2):

/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/bin/g++ -I. -I/course/cs196e/include -I/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/ext -I/u/jdy/boost_1_21_1 -I/u/jdy/boost_1_21_1/crc -g -D_REENTRANT -DDEBUG -D_POSIX_PTHREAD_SEMANTICS -c driver.C
In file included from layer3.h:32,
                 from driver.C:37:
/u/jdy/boost_1_21_1/crc/boost/crc.hpp:52: default argument for template
   parameter in function template `typename boost::uint_t<Bits>::fast
   boost::crc(const void*, unsigned int)'
/u/jdy/boost_1_21_1/crc/boost/crc.hpp:96: using `typename' outside of template
/u/jdy/boost_1_21_1/crc/boost/crc.hpp:105: using `typename' outside of template
/u/jdy/boost_1_21_1/crc/boost/crc.hpp:115: using `typename' outside of template

Removing the `typename' "fixes" the errors on line 96,105,115

Commenting out the block at line 52 (all of the crc function) seems to
let it build and run.

I don't understand why (mycrc2.checksum() != 0) at the end of
the following code chunk. Any suggestions?

    struct Header {
      unsigned char a : 4;
      unsigned char b : 4;
      signed char c; // 8
      unsigned short d; // 16
      int e; // 32
      int f; // 32
      unsigned short empty; // 16
      unsigned short checkVal; // 16
    };

    typedef boost::crc_basic<16> mc_t;

    mc_t mycrc1( 0x8005,0x0,0,false,false);
    mycrc.process_bytes(
      (void const*)header,
      sizeof(Header));
    IPheader->checkVal = mycrc1.checksum();

    mc_t mycrc2( 0x8005,0x0,0,false,false);
    mycrc2.process_bytes(
      (void const*)header,
      sizeof(Header));

Joel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk