home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.uv.es
/
2014.11.ftp.uv.es.tar
/
ftp.uv.es
/
pub
/
unix
/
btoa5.2.tar.Z
/
btoa5.2.tar
/
btoa5.2
/
chksum.h
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-24
|
805b
|
25 lines
/* chksum.h */
/* calcchecksum() was converted to a macro for effectivity reasons. */
/* Don't (!!) give it an argument that has to be evaluated. This */
/* is guaranteed to slow it down. */
/* Update file checksums. */
#define calcchecksum(ch) \
{ \
extern LONG Ceor, Csum, Crot; \
\
Ceor ^= ch; \
Csum += ch + 1; \
\
if (Crot & 0x80000000L) \
{ \
Crot <<= 1; \
Crot ++; \
} \
else \
Crot <<= 1; \
\
Crot += ch; \
}