use memset() for clearing of arrays

This commit is contained in:
Axel Kohlmeyer
2018-11-14 05:30:23 -05:00
parent 7a22b8aa62
commit a942d8b3ba

View File

@ -1248,7 +1248,7 @@ void ReadData::bonds(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process bonds
@ -1331,7 +1331,7 @@ void ReadData::angles(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process angles
@ -1414,7 +1414,7 @@ void ReadData::dihedrals(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process dihedrals
@ -1497,7 +1497,7 @@ void ReadData::impropers(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process impropers