There is lots of code repeat that should be cleaned up.
// Go through all the particles and make a list of
// known types
int numberOfParticleTypes = 0;
for (i=0;i<ad.numberOfParticles;i++) {
if (this->particleIsInSlice(i)) {
isInList = FALSE;
for (int j=0;j<numberOfParticleTypes;j++) {
if (typeCmp( (char *)&particleTypes[j], (char *)&ad.particles[i].type ) == TRUE) {
isInList = TRUE;
j = numberOfParticleTypes;
}
}
if (isInList == FALSE) {
// Found a new particle -- add it to the list
if (numberOfParticleTypes < MAX_PARTICLE_TYPES) {
typeCopy( (char *)&ad.particles[i].type, (char *)&particleTypes[numberOfParticleTypes]);
numberOfParticleTypes++;
}
}
}
}
There is lots of code repeat that should be cleaned up.