#include <string.h>#include "Communicate.h"#include "MStream.h"#include "converse.h"#include "Debug.h"Go to the source code of this file.
Classes | |
| struct | StreamMessage |
Defines | |
| #define | MIN_DEBUG_LEVEL 2 |
Functions | |
| int | checkSum (StreamMessage *msg) |
|
|
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved. |
|
|
Definition at line 65 of file MStream.C. References StreamMessage::checksum, StreamMessage::data, DebugM, StreamMessage::index, StreamMessage::len, NAMD_bug(), and StreamMessage::tag. 00066 {
00067 int checksum = 0;
00068 for ( int i=0; i < msg->len; i++ ) {
00069 checksum += (unsigned char) msg->data[i];
00070 }
00071 if ( checksum != msg->checksum ) {
00072 DebugM(5,"Error on " << msg->tag << ":" << msg->index <<
00073 " of length " << msg->len <<
00074 " with checksum " << ((int)checksum) <<
00075 " vs " << ((int)(msg->checksum)) <<"\n");
00076 NAMD_bug("MStream checksums do not agree!");
00077 }
00078 return 1;
00079 }
|
1.3.9.1