--- trunk/src/brains/BlockSnapshotManager.cpp 2005/02/13 19:10:25 324 +++ trunk/src/brains/BlockSnapshotManager.cpp 2005/02/15 17:11:35 347 @@ -72,12 +72,12 @@ BlockSnapshotManager::BlockSnapshotManager(SimInfo* in } for (int i = 0; i < nblocks; ++i) { - blocks_.push_back(SnapshotBlock(i, (i+1)*nSnapshotPerBlock_)); + blocks_.push_back(SnapshotBlock(i*nSnapshotPerBlock_, (i+1)*nSnapshotPerBlock_)); } //the last block may not have nSnapshotPerBlock frames, we need to consider this special situation blocks_.back().second = nframes_; - snapshots_.insert(snapshots_.begin(), nframes_, NULL); + snapshots_.insert(snapshots_.begin(), nframes_, static_cast(NULL)); } @@ -97,7 +97,13 @@ int BlockSnapshotManager::getNActiveBlocks() { } int BlockSnapshotManager::getNActiveBlocks() { +#ifdef __RWSTD + int count = 0; + std::count_if(activeBlocks_.begin(), activeBlocks_.end(), std::bind2nd(std::not_equal_to(), -1), count); + return count; +#else return std::count_if(activeBlocks_.begin(), activeBlocks_.end(), std::bind2nd(std::not_equal_to(), -1)); +#endif } bool BlockSnapshotManager::isBlockActive(int block) {