avoid NULL pointer dereference / slience warnings issued by static code analysis
This commit is contained in:
@ -349,7 +349,7 @@ void FixChargeRegulation::forward_acid() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
double pos[3];
|
||||
pos[0] = 0;
|
||||
pos[1] = 0;
|
||||
@ -408,7 +408,7 @@ void FixChargeRegulation::backward_acid() {
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
int mask_tmp;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
double pos[3];
|
||||
pos[0] = 0;
|
||||
pos[1] = 0;
|
||||
@ -481,7 +481,7 @@ void FixChargeRegulation::forward_base() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
double pos[3];
|
||||
pos[0] = 0;
|
||||
pos[1] = 0;
|
||||
@ -539,7 +539,7 @@ void FixChargeRegulation::backward_base() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
int mask_tmp;
|
||||
double pos[3];
|
||||
pos[0] = 0;
|
||||
@ -612,7 +612,7 @@ void FixChargeRegulation::forward_ions() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
int m1 = -1, m2 = -1;
|
||||
factor = volume_rx * volume_rx * c10pI_plus * c10pI_minus /
|
||||
((1 + ncation) * (1 + nanion));
|
||||
@ -647,7 +647,7 @@ void FixChargeRegulation::backward_ions() {
|
||||
double energy_before = energy_stored;
|
||||
double factor;
|
||||
int mask1_tmp = 0, mask2_tmp = 0;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
int m1 = -1, m2 = -1;
|
||||
|
||||
m1 = get_random_particle(cation_type, +1, 0, dummyp);
|
||||
@ -726,7 +726,7 @@ void FixChargeRegulation::forward_ions_multival() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor = 1;
|
||||
double *dummyp = nullptr;
|
||||
double dummyp[3];
|
||||
int mm[salt_charge_ratio + 1];// particle ID array for all ions to be inserted
|
||||
|
||||
if (salt_charge[0] <= -salt_charge[1]) {
|
||||
@ -780,7 +780,7 @@ void FixChargeRegulation::backward_ions_multival() {
|
||||
|
||||
double energy_before = energy_stored;
|
||||
double factor = 1;
|
||||
double *dummyp = nullptr; // dummy pointer
|
||||
double dummyp[3]; // dummy particle
|
||||
int mm[salt_charge_ratio + 1]; // particle ID array for all deleted ions
|
||||
double qq[salt_charge_ratio + 1]; // charge array for all deleted ions
|
||||
int mask_tmp[salt_charge_ratio + 1]; // temporary mask array
|
||||
|
||||
Reference in New Issue
Block a user