From 92c118b29fc760a26aca9f38ad0db0fb2dd08fe8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 25 Jun 2023 05:56:51 -0400 Subject: [PATCH] replace for (;;) with while (true) --- src/EXTRA-COMPUTE/compute_ackland_atom.cpp | 8 ++++---- src/EXTRA-COMPUTE/compute_basal_atom.cpp | 8 ++++---- src/EXTRA-COMPUTE/compute_hexorder_atom.cpp | 4 ++-- src/KOKKOS/compute_orientorder_atom_kokkos.cpp | 4 ++-- src/compute_centro_atom.cpp | 8 ++++---- src/compute_orientorder_atom.cpp | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ackland_atom.cpp b/src/EXTRA-COMPUTE/compute_ackland_atom.cpp index d8a77b9c2f..fd7a5fb05c 100644 --- a/src/EXTRA-COMPUTE/compute_ackland_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ackland_atom.cpp @@ -357,7 +357,7 @@ void ComputeAcklandAtom::select(int k, int n, double *arr) arr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr[l],arr[ir]) @@ -378,7 +378,7 @@ void ComputeAcklandAtom::select(int k, int n, double *arr) i = l+1; j = ir; a = arr[l+1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; @@ -403,7 +403,7 @@ void ComputeAcklandAtom::select2(int k, int n, double *arr, int *iarr) iarr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr[l],arr[ir]) @@ -430,7 +430,7 @@ void ComputeAcklandAtom::select2(int k, int n, double *arr, int *iarr) j = ir; a = arr[l+1]; ia = iarr[l+1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; diff --git a/src/EXTRA-COMPUTE/compute_basal_atom.cpp b/src/EXTRA-COMPUTE/compute_basal_atom.cpp index b149746fb4..8b65917111 100644 --- a/src/EXTRA-COMPUTE/compute_basal_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_basal_atom.cpp @@ -442,7 +442,7 @@ void ComputeBasalAtom::select(int k, int n, double *arr) arr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr[l],arr[ir]) @@ -463,7 +463,7 @@ void ComputeBasalAtom::select(int k, int n, double *arr) i = l+1; j = ir; a = arr[l+1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; @@ -488,7 +488,7 @@ void ComputeBasalAtom::select2(int k, int n, double *arr, int *iarr) iarr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr[l],arr[ir]) @@ -515,7 +515,7 @@ void ComputeBasalAtom::select2(int k, int n, double *arr, int *iarr) j = ir; a = arr[l+1]; ia = iarr[l+1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; diff --git a/src/EXTRA-COMPUTE/compute_hexorder_atom.cpp b/src/EXTRA-COMPUTE/compute_hexorder_atom.cpp index a10e810e82..dc04c6b650 100644 --- a/src/EXTRA-COMPUTE/compute_hexorder_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_hexorder_atom.cpp @@ -281,7 +281,7 @@ void ComputeHexOrderAtom::select2(int k, int n, double *arr, int *iarr) iarr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr[l],arr[ir]) @@ -308,7 +308,7 @@ void ComputeHexOrderAtom::select2(int k, int n, double *arr, int *iarr) j = ir; a = arr[l+1]; ia = iarr[l+1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp index 157d41126f..263a070a3a 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp @@ -386,7 +386,7 @@ void ComputeOrientOrderAtomKokkos::select3(int k, int n, int ii) con l = 0; ir = n-1; - for (;;) { + while (true) { if (ir <= l+1) { if (ir == l+1 && arr[ir] < arr[l]) { SWAP(arr,l,ir); @@ -421,7 +421,7 @@ void ComputeOrientOrderAtomKokkos::select3(int k, int n, int ii) con a3[0] = arr3(l+1,0); a3[1] = arr3(l+1,1); a3[2] = arr3(l+1,2); - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; while (arr[j] > a); if (j < i) break; diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index ae6ef4901f..f726a95594 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -338,7 +338,7 @@ void ComputeCentroAtom::select(int k, int n, double *arr) arr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l + 1) { if (ir == l + 1 && arr[ir] < arr[l]) { SWAP(arr[l], arr[ir]) } return; @@ -351,7 +351,7 @@ void ComputeCentroAtom::select(int k, int n, double *arr) i = l + 1; j = ir; a = arr[l + 1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; @@ -378,7 +378,7 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr) iarr--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l + 1) { if (ir == l + 1 && arr[ir] < arr[l]) { SWAP(arr[l], arr[ir]) @@ -405,7 +405,7 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr) j = ir; a = arr[l + 1]; ia = iarr[l + 1]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--; diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 5682432c8e..6f1b2b4036 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -370,7 +370,7 @@ void ComputeOrientOrderAtom::select3(int k, int n, double *arr, int *iarr, doubl arr3--; l = 1; ir = n; - for (;;) { + while (true) { if (ir <= l + 1) { if (ir == l + 1 && arr[ir] < arr[l]) { SWAP(arr[l], arr[ir]); @@ -405,7 +405,7 @@ void ComputeOrientOrderAtom::select3(int k, int n, double *arr, int *iarr, doubl a3[0] = arr3[l + 1][0]; a3[1] = arr3[l + 1][1]; a3[2] = arr3[l + 1][2]; - for (;;) { + while (true) { do i++; while (arr[i] < a); do j--;