The "~" (Tilda) operator is a bitwise invert. I think you have chnaged the meaning of the program.
Peter. Stephen torri wrote: > > The first patch clears up a warning about comparison between unsigned > int and int. The second clears a warning about comparison of promoted > ~unsigned with unsigned. In regards to this second warning I traced back > to the header for m_storedLen. Its already a word16. Is there a reason > for casting it? For education what does the '~' mean in front of the > variable? > > Stephen > > bash-2.05b$ cvs diff zinflate.cpp > Index: zinflate.cpp > =================================================================== > RCS file: /cvsroot/cryptopp/c5/zinflate.cpp,v > retrieving revision 1.6 > diff -U2 -r1.6 zinflate.cpp > --- zinflate.cpp 29 Jul 2003 01:18:33 -0000 1.6 > +++ zinflate.cpp 7 Nov 2003 04:57:46 -0000 > @@ -136,5 +136,5 @@ > assert(m_normalizedCacheMask == BitReverse(m_cacheMask)); > > - if (m_cache.size() != 1 << m_cacheBits) > + if (m_cache.size() != ( (unsigned int) 1 << m_cacheBits) ) > m_cache.resize(1 << m_cacheBits); > > @@ -361,5 +361,5 @@ > m_storedLen = (word16)m_reader.GetBits(16); > word16 nlen = (word16)m_reader.GetBits(16); > - if (nlen != (word16)~m_storedLen) > + if (nlen != m_storedLen) > throw BadBlockErr(); > break; > > -- > Stephen Torri > GPG Key: http://www.cs.wustl.edu/~storri/storri.asc > -- > Stephen Torri > GPG Key: http://www.cs.wustl.edu/~storri/storri.asc > > ------------------------------------------------------------------------ > Name: signature.asc > signature.asc Type: application/pgp-signature > Description: This is a digitally signed message part -- // // Peter L. Bell [EMAIL PROTECTED] // +61 2 9805 2955 // Blessed are the Peacemakers, they shall be called Sons of God. //
