use friend statement instead of (incorrect) cast to give access to protected class member

This commit is contained in:
Axel Kohlmeyer
2021-08-02 21:34:30 -04:00
parent 53050a0429
commit 04c7e7543e
3 changed files with 3 additions and 3 deletions

View File

@ -340,8 +340,7 @@ void PairHybridScaled::settings(int narg, char **arg)
special_lj[nstyles] = special_coul[nstyles] = nullptr;
compute_tally[nstyles] = 1;
if ((((PairHybridScaled *)styles[nstyles])->suffix_flag
& (Suffix::INTEL|Suffix::GPU|Suffix::OMP)) != 0)
if ((styles[nstyles]->suffix_flag & (Suffix::INTEL|Suffix::GPU|Suffix::OMP)) != 0)
error->all(FLERR,"Pair style hybrid/scaled does not support "
"accelerator styles");