Replace NULL with nullptr

This commit is contained in:
Richard Berger
2020-11-12 10:44:04 -05:00
parent 3991f704e1
commit e7ccbd0ce6

View File

@ -180,7 +180,7 @@ void *PairSpinExchangeBiquadratic::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"cut") == 0) return (void *) &cut_spin_exchange_global;
return NULL;
return nullptr;
}
/* ---------------------------------------------------------------------- */
@ -576,19 +576,19 @@ void PairSpinExchangeBiquadratic::read_restart(FILE *fp)
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++) {
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (setflag[i][j]) {
if (me == 0) {
utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&K1_mag[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&K1_mech[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&K2[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&K3[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&K1_mag[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&K1_mech[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&K2[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&K3[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,nullptr,error);
}
MPI_Bcast(&J1_mag[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&J1_mech[i][j],1,MPI_DOUBLE,0,world);
@ -624,10 +624,10 @@ void PairSpinExchangeBiquadratic::write_restart_settings(FILE *fp)
void PairSpinExchangeBiquadratic::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,NULL,error);
utils::sfread(FLERR,&e_offset,sizeof(int),1,fp,NULL,error);
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error);
utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&e_offset,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error);
}
MPI_Bcast(&cut_spin_exchange_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&e_offset,1,MPI_INT,0,world);