mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-07-23 10:39:58 +00:00
Removed nested conditions
This commit is contained in:
@ -231,10 +231,10 @@ int main(int argc, char *argv[])
|
||||
true_label_mol = (int *) malloc (num_atoms * sizeof (int));
|
||||
// error checking
|
||||
if ((ch_type_atoms == NULL) ||
|
||||
(coords == NULL) ||
|
||||
(label_mol == NULL) ||
|
||||
(tmp_int == NULL) ||
|
||||
(true_label_mol == NULL))
|
||||
(coords == NULL) ||
|
||||
(label_mol == NULL) ||
|
||||
(tmp_int == NULL) ||
|
||||
(true_label_mol == NULL))
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 19, argv[0]);
|
||||
return 3;
|
||||
@ -249,6 +249,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// reading coordinates
|
||||
print_message (quiet, stdout, log, f_log, 7, input);
|
||||
error = 1;
|
||||
error = reading_coords (1, input, tmp_int[0], tmp_int, cell, &num_mol, &num_atoms,
|
||||
true_label_mol, label_mol, tmp_int, coords, ch_type_atoms);
|
||||
centr_coords = (float *) malloc (3 * 8 * num_mol * sizeof (float));
|
||||
@ -261,7 +262,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
// error checking
|
||||
if ((centr_coords == NULL) ||
|
||||
(needed_mol == NULL))
|
||||
(needed_mol == NULL))
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 19, argv[0]);
|
||||
return 3;
|
||||
@ -272,22 +273,23 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
error = 1;
|
||||
error = set_center (num_atoms, num_mol, label_mol, coords, centr_coords);
|
||||
if (error == 0)
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 20, argv[0]);
|
||||
error = 1;
|
||||
error = search_envir (num_of_mol, num_mol, centr_coords, rad, needed_mol,
|
||||
&num_needed_mol);
|
||||
if (error == 0)
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 21, argv[0]);
|
||||
error = 1;
|
||||
error = print_structure (output, num_needed_mol, needed_mol, num_atoms,
|
||||
label_mol, ch_type_atoms, coords);
|
||||
print_message (quiet, stderr, log, f_log, 12, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (error == 0)
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 20, argv[0]);
|
||||
error = 1;
|
||||
error = search_envir (num_of_mol, num_mol, centr_coords, rad, needed_mol,
|
||||
&num_needed_mol);
|
||||
}
|
||||
if (error == 0)
|
||||
{
|
||||
print_message (quiet, stderr, log, f_log, 21, argv[0]);
|
||||
error = 1;
|
||||
error = print_structure (output, num_needed_mol, needed_mol, num_atoms,
|
||||
label_mol, ch_type_atoms, coords);
|
||||
}
|
||||
if (error == 0)
|
||||
print_message (quiet, stderr, log, f_log, 12, output);
|
||||
|
||||
print_message (quiet, stdout, log, f_log, 13, argv[0]);
|
||||
|
||||
|
Reference in New Issue
Block a user