use friend statement instead of (incorrect) cast to give access to protected class member
This commit is contained in:
@ -30,6 +30,7 @@ class Pair : protected Pointers {
|
||||
friend class FixOMP;
|
||||
friend class FixQEq;
|
||||
friend class PairHybrid;
|
||||
friend class PairHybridScaled;
|
||||
friend class ThrOMP;
|
||||
friend class Info;
|
||||
|
||||
|
||||
@ -569,7 +569,7 @@ void PairHybrid::init_style()
|
||||
// same style must not be used multiple times
|
||||
|
||||
for (istyle = 0; istyle < nstyles; istyle++) {
|
||||
bool is_gpu = (((PairHybrid *)styles[istyle])->suffix_flag & Suffix::GPU);
|
||||
bool is_gpu = styles[istyle]->suffix_flag & Suffix::GPU;
|
||||
if (multiple[istyle] && is_gpu)
|
||||
error->all(FLERR,"GPU package styles must not be used multiple times");
|
||||
}
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user