Esempio n. 1
0
/*
================
idDict::Checksum
================
*/
int	idDict::Checksum( void ) const {
	unsigned long ret;
	int i, n;
	idList<idKeyValue> sorted = args;
	sorted.Sort( KeyCompare );
	n = sorted.Num();
	CRC32_InitChecksum( ret );
	for( i = 0; i < n; i++ ) {
		CRC32_UpdateChecksum( ret, sorted[i].GetKey().c_str(), sorted[i].GetKey().Length() );
		CRC32_UpdateChecksum( ret, sorted[i].GetValue().c_str(), sorted[i].GetValue().Length() );
	}
	CRC32_FinishChecksum( ret );
	return ret;
}
Esempio n. 2
0
/*
================
idDict::Checksum
================
*/
int	idDict::Checksum() const
{
	// RB: 64 bit fixes, changed long to int
	unsigned int ret;
	// RB end
	int i, n;
	
	idList<idKeyValue> sorted = args;
	sorted.SortWithTemplate( idSort_KeyValue() );
	n = sorted.Num();
	CRC32_InitChecksum( ret );
	for( i = 0; i < n; i++ )
	{
		CRC32_UpdateChecksum( ret, sorted[i].GetKey().c_str(), sorted[i].GetKey().Length() );
		CRC32_UpdateChecksum( ret, sorted[i].GetValue().c_str(), sorted[i].GetValue().Length() );
	}
	CRC32_FinishChecksum( ret );
	return ret;
}