From 5cb1da0a59ce2da9344c9474e38f30b9b494bfa2 Mon Sep 17 00:00:00 2001 From: eschnett Date: Sun, 23 Mar 2014 02:44:58 +0000 Subject: Use "const int" instead of "int const" git-svn-id: http://svn.cactuscode.org/flesh/trunk@5100 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/include/cctk_Loop.h | 268 ++++++++++++++++++++++----------------------- src/include/cctk_Loop.h.pl | 52 ++++----- 2 files changed, 160 insertions(+), 160 deletions(-) diff --git a/src/include/cctk_Loop.h b/src/include/cctk_Loop.h index 6ad1ed9e..63395c13 100644 --- a/src/include/cctk_Loop.h +++ b/src/include/cctk_Loop.h @@ -62,19 +62,19 @@ imin,imax, cctki0_istr_) \ do { \ typedef int cctki0_loop1_normal_##name; \ - int const cctki0_idir = (cctki0_idir_); \ - int const cctki0_imin = (cctki0_imin_); \ - int const cctki0_imax = (cctki0_imax_); \ - int const cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ - int const cctki0_istr = (cctki0_istr_); \ - int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ - int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ + const int cctki0_idir = (cctki0_idir_); \ + const int cctki0_imin = (cctki0_imin_); \ + const int cctki0_imax = (cctki0_imax_); \ + const int cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ + const int cctki0_istr = (cctki0_istr_); \ + const int imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ + const int imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ \ \ - int const cctki0_ioff = (cctki0_imin) % cctki0_istr; \ + const int cctki0_ioff = (cctki0_imin) % cctki0_istr; \ _Pragma("omp for") \ for (int i=cctki0_imin-cctki0_ioff; icctk_lsh[0] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0); \ if (cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ }; \ CCTK_LOOP1STR_NORMAL(name##_boundaries, \ @@ -269,21 +269,21 @@ CCTK_WARN(CCTK_WARN_ABORT, \ "The macro CCTK_LOOP1_INTBOUNDARIES can only be used in 1 dimensions"); \ } \ - int const cctki2_blo[] = { (cctki2_iblo_) }; \ - int const cctki2_bhi[] = { (cctki2_ibhi_) }; \ - int const cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_) }; \ - int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0); \ - int const cctki2_all_bbox = \ + const int cctki2_all_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 1) && (cctki2_idir>0 ? cctki2_bbox[1] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ }; \ CCTK_LOOP1STR_NORMAL(name##_intboundaries, \ @@ -1042,25 +1042,25 @@ imin,imax, cctki0_istr_) \ do { \ typedef int cctki0_loop2_normal_##name; \ - int const cctki0_idir = (cctki0_idir_); \ - int const cctki0_jdir = (cctki0_jdir_); \ - int const cctki0_imin = (cctki0_imin_); \ - int const cctki0_jmin = (cctki0_jmin_); \ - int const cctki0_imax = (cctki0_imax_); \ - int const cctki0_jmax = (cctki0_jmax_); \ - int const cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ - int const cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ - int const cctki0_istr = (cctki0_istr_); \ - int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ - int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ + const int cctki0_idir = (cctki0_idir_); \ + const int cctki0_jdir = (cctki0_jdir_); \ + const int cctki0_imin = (cctki0_imin_); \ + const int cctki0_jmin = (cctki0_jmin_); \ + const int cctki0_imax = (cctki0_imax_); \ + const int cctki0_jmax = (cctki0_jmax_); \ + const int cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ + const int cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ + const int cctki0_istr = (cctki0_istr_); \ + const int imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ + const int imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ CCTK_PRAGMA_OMP_FOR_COLLAPSE_1 \ for (int j=cctki0_jmin; jcctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0); \ if (cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ }; \ @@ -1264,25 +1264,25 @@ CCTK_WARN(CCTK_WARN_ABORT, \ "The macro CCTK_LOOP2_INTBOUNDARIES can only be used in 2 dimensions"); \ } \ - int const cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_) }; \ - int const cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_) }; \ - int const cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_) }; \ - int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0); \ - int const cctki2_all_bbox = \ + const int cctki2_all_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 1) && (cctki2_idir>0 ? cctki2_bbox[1] : 1) && \ (cctki2_jdir<0 ? cctki2_bbox[2] : 1) && (cctki2_jdir>0 ? cctki2_bbox[3] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ }; \ @@ -2083,31 +2083,31 @@ imin,imax, cctki0_istr_) \ do { \ typedef int cctki0_loop3_normal_##name; \ - int const cctki0_idir = (cctki0_idir_); \ - int const cctki0_jdir = (cctki0_jdir_); \ - int const cctki0_kdir = (cctki0_kdir_); \ - int const cctki0_imin = (cctki0_imin_); \ - int const cctki0_jmin = (cctki0_jmin_); \ - int const cctki0_kmin = (cctki0_kmin_); \ - int const cctki0_imax = (cctki0_imax_); \ - int const cctki0_jmax = (cctki0_jmax_); \ - int const cctki0_kmax = (cctki0_kmax_); \ - int const cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ - int const cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ - int const cctki0_kash CCTK_ATTRIBUTE_UNUSED = (cctki0_kash_); \ - int const cctki0_istr = (cctki0_istr_); \ - int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ - int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ + const int cctki0_idir = (cctki0_idir_); \ + const int cctki0_jdir = (cctki0_jdir_); \ + const int cctki0_kdir = (cctki0_kdir_); \ + const int cctki0_imin = (cctki0_imin_); \ + const int cctki0_jmin = (cctki0_jmin_); \ + const int cctki0_kmin = (cctki0_kmin_); \ + const int cctki0_imax = (cctki0_imax_); \ + const int cctki0_jmax = (cctki0_jmax_); \ + const int cctki0_kmax = (cctki0_kmax_); \ + const int cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ + const int cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ + const int cctki0_kash CCTK_ATTRIBUTE_UNUSED = (cctki0_kash_); \ + const int cctki0_istr = (cctki0_istr_); \ + const int imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ + const int imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ CCTK_PRAGMA_OMP_FOR_COLLAPSE_2 \ for (int k=cctki0_kmin; kcctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0) || \ (cctki2_kdir<0 ? cctki2_bbox[4] : 0) || (cctki2_kdir>0 ? cctki2_bbox[5] : 0); \ if (cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ cctki2_kdir<0 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ cctki2_kdir<0 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ @@ -2320,29 +2320,29 @@ CCTK_WARN(CCTK_WARN_ABORT, \ "The macro CCTK_LOOP3_INTBOUNDARIES can only be used in 3 dimensions"); \ } \ - int const cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_) }; \ - int const cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_) }; \ - int const cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_) }; \ - int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0) || \ (cctki2_kdir<0 ? cctki2_bbox[4] : 0) || (cctki2_kdir>0 ? cctki2_bbox[5] : 0); \ - int const cctki2_all_bbox = \ + const int cctki2_all_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 1) && (cctki2_idir>0 ? cctki2_bbox[1] : 1) && \ (cctki2_jdir<0 ? cctki2_bbox[2] : 1) && (cctki2_jdir>0 ? cctki2_bbox[3] : 1) && \ (cctki2_kdir<0 ? cctki2_bbox[4] : 1) && (cctki2_kdir>0 ? cctki2_bbox[5] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ cctki2_kdir<0 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ cctki2_kdir<0 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ @@ -3185,37 +3185,37 @@ imin,imax, cctki0_istr_) \ do { \ typedef int cctki0_loop4_normal_##name; \ - int const cctki0_idir = (cctki0_idir_); \ - int const cctki0_jdir = (cctki0_jdir_); \ - int const cctki0_kdir = (cctki0_kdir_); \ - int const cctki0_ldir = (cctki0_ldir_); \ - int const cctki0_imin = (cctki0_imin_); \ - int const cctki0_jmin = (cctki0_jmin_); \ - int const cctki0_kmin = (cctki0_kmin_); \ - int const cctki0_lmin = (cctki0_lmin_); \ - int const cctki0_imax = (cctki0_imax_); \ - int const cctki0_jmax = (cctki0_jmax_); \ - int const cctki0_kmax = (cctki0_kmax_); \ - int const cctki0_lmax = (cctki0_lmax_); \ - int const cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ - int const cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ - int const cctki0_kash CCTK_ATTRIBUTE_UNUSED = (cctki0_kash_); \ - int const cctki0_lash CCTK_ATTRIBUTE_UNUSED = (cctki0_lash_); \ - int const cctki0_istr = (cctki0_istr_); \ - int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ - int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ + const int cctki0_idir = (cctki0_idir_); \ + const int cctki0_jdir = (cctki0_jdir_); \ + const int cctki0_kdir = (cctki0_kdir_); \ + const int cctki0_ldir = (cctki0_ldir_); \ + const int cctki0_imin = (cctki0_imin_); \ + const int cctki0_jmin = (cctki0_jmin_); \ + const int cctki0_kmin = (cctki0_kmin_); \ + const int cctki0_lmin = (cctki0_lmin_); \ + const int cctki0_imax = (cctki0_imax_); \ + const int cctki0_jmax = (cctki0_jmax_); \ + const int cctki0_kmax = (cctki0_kmax_); \ + const int cctki0_lmax = (cctki0_lmax_); \ + const int cctki0_iash CCTK_ATTRIBUTE_UNUSED = (cctki0_iash_); \ + const int cctki0_jash CCTK_ATTRIBUTE_UNUSED = (cctki0_jash_); \ + const int cctki0_kash CCTK_ATTRIBUTE_UNUSED = (cctki0_kash_); \ + const int cctki0_lash CCTK_ATTRIBUTE_UNUSED = (cctki0_lash_); \ + const int cctki0_istr = (cctki0_istr_); \ + const int imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin; \ + const int imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax; \ CCTK_PRAGMA_OMP_FOR_COLLAPSE_3 \ for (int l=cctki0_lmin; lcctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_),(cctki2_lblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_),(cctki2_lbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_),(cctki2_lbboxlo_), (cctki2_lbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_ldir=-1; cctki2_ldir<=+1; ++cctki2_ldir) { \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0) || \ (cctki2_kdir<0 ? cctki2_bbox[4] : 0) || (cctki2_kdir>0 ? cctki2_bbox[5] : 0) || \ (cctki2_ldir<0 ? cctki2_bbox[6] : 0) || (cctki2_ldir>0 ? cctki2_bbox[7] : 0); \ if (cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ cctki2_kdir<0 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ cctki2_ldir<0 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lsh[3] - cctki2_bhi[3], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ cctki2_kdir<0 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ @@ -3437,33 +3437,33 @@ CCTK_WARN(CCTK_WARN_ABORT, \ "The macro CCTK_LOOP4_INTBOUNDARIES can only be used in 4 dimensions"); \ } \ - int const cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_),(cctki2_lblo_) }; \ - int const cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_),(cctki2_lbhi_) }; \ - int const cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_),(cctki2_lbboxlo_), (cctki2_lbboxhi_) }; \ - int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ - int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ + const int cctki2_blo[] = { (cctki2_iblo_),(cctki2_jblo_),(cctki2_kblo_),(cctki2_lblo_) }; \ + const int cctki2_bhi[] = { (cctki2_ibhi_),(cctki2_jbhi_),(cctki2_kbhi_),(cctki2_lbhi_) }; \ + const int cctki2_bbox[] = { (cctki2_ibboxlo_), (cctki2_ibboxhi_),(cctki2_jbboxlo_), (cctki2_jbboxhi_),(cctki2_kbboxlo_), (cctki2_kbboxhi_),(cctki2_lbboxlo_), (cctki2_lbboxhi_) }; \ + const int cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ + const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_); \ for (int cctki2_ldir=-1; cctki2_ldir<=+1; ++cctki2_ldir) { \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ - int const cctki2_any_bbox = \ + const int cctki2_any_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 0) || (cctki2_idir>0 ? cctki2_bbox[1] : 0) || \ (cctki2_jdir<0 ? cctki2_bbox[2] : 0) || (cctki2_jdir>0 ? cctki2_bbox[3] : 0) || \ (cctki2_kdir<0 ? cctki2_bbox[4] : 0) || (cctki2_kdir>0 ? cctki2_bbox[5] : 0) || \ (cctki2_ldir<0 ? cctki2_bbox[6] : 0) || (cctki2_ldir>0 ? cctki2_bbox[7] : 0); \ - int const cctki2_all_bbox = \ + const int cctki2_all_bbox = \ (cctki2_idir<0 ? cctki2_bbox[0] : 1) && (cctki2_idir>0 ? cctki2_bbox[1] : 1) && \ (cctki2_jdir<0 ? cctki2_bbox[2] : 1) && (cctki2_jdir>0 ? cctki2_bbox[3] : 1) && \ (cctki2_kdir<0 ? cctki2_bbox[4] : 1) && (cctki2_kdir>0 ? cctki2_bbox[5] : 1) && \ (cctki2_ldir<0 ? cctki2_bbox[6] : 1) && (cctki2_ldir>0 ? cctki2_bbox[7] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ - int const cctki2_bmin[] = { \ + const int cctki2_bmin[] = { \ cctki2_idir<0 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ cctki2_jdir<0 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ cctki2_kdir<0 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ cctki2_ldir<0 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lsh[3] - cctki2_bhi[3], \ }; \ - int const cctki2_bmax[] = { \ + const int cctki2_bmax[] = { \ cctki2_idir<0 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ cctki2_jdir<0 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ cctki2_kdir<0 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ diff --git a/src/include/cctk_Loop.h.pl b/src/include/cctk_Loop.h.pl index dd7b9b51..6e74094c 100755 --- a/src/include/cctk_Loop.h.pl +++ b/src/include/cctk_Loop.h.pl @@ -253,21 +253,21 @@ for $dim (1,2,3,4) { (bsnl ' imin,imax, cctki0_istr_)'), (bsnl ' do {'), (bsnl ' typedef int cctki0_loop[DIM]_normal_##name;'), - (rpt (bsnl ' int const cctki0_[C]dir = (cctki0_[C]dir_);')), - (rpt (bsnl ' int const cctki0_[C]min = (cctki0_[C]min_);')), - (rpt (bsnl ' int const cctki0_[C]max = (cctki0_[C]max_);')), - (rpt (bsnl ' int const cctki0_[C]ash CCTK_ATTRIBUTE_UNUSED = (cctki0_[C]ash_);')), - (bsnl ' int const cctki0_istr = (cctki0_istr_);'), + (rpt (bsnl ' const int cctki0_[C]dir = (cctki0_[C]dir_);')), + (rpt (bsnl ' const int cctki0_[C]min = (cctki0_[C]min_);')), + (rpt (bsnl ' const int cctki0_[C]max = (cctki0_[C]max_);')), + (rpt (bsnl ' const int cctki0_[C]ash CCTK_ATTRIBUTE_UNUSED = (cctki0_[C]ash_);')), + (bsnl ' const int cctki0_istr = (cctki0_istr_);'), # Export loop bounds in the i direction - (bsnl ' int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin;'), - (bsnl ' int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax;'), + (bsnl ' const int imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin;'), + (bsnl ' const int imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax;'), (bsnl ' [DIM==1?:CCTK_PRAGMA_OMP_FOR_COLLAPSE_[DIM-1]]'), (reverse (rpt (bsnl ' [I==1?:for (int [C]=cctki0_[C]min; [C]cctk_lsh[[I]]').' };'), - (bsnl ' int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_);'), + (bsnl ' const int cctki2_blo[] = { '.(crpt '(cctki2_[C]blo_)').' };'), + (bsnl ' const int cctki2_bhi[] = { '.(crpt '(cctki2_[C]bhi_)').' };'), + (bsnl ' const int cctki2_bbox[] = { '.(crpt '(cctki2_[C]bboxlo_), (cctki2_[C]bboxhi_)').' };'), + (bsnl ' const int cctki2_lsh[] = { '.(crpt 'cctki2_cctkGH->cctk_lsh[[I]]').' };'), + (bsnl ' const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_);'), # Loop over all faces, edges, and corners (reverse (rpt (bsnl ' for (int cctki2_[C]dir=-1; cctki2_[C]dir<=+1; ++cctki2_[C]dir) {'))), - (bsnl ' int const cctki2_any_bbox ='), + (bsnl ' const int cctki2_any_bbox ='), (bsnlsep [rpt ' (cctki2_[C]dir<0 ? cctki2_bbox[[2*I]] : 0) || (cctki2_[C]dir>0 ? cctki2_bbox[[2*I+1]] : 0)'], ' ||', ';'), (bsnl ' if (cctki2_any_bbox) {'), - (bsnl ' int const cctki2_bmin[] = {'), + (bsnl ' const int cctki2_bmin[] = {'), (rpt (bsnl ' cctki2_[C]dir<0 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lsh[[I]] - cctki2_bhi[[I]],')), (bsnl ' };'), - (bsnl ' int const cctki2_bmax[] = {'), + (bsnl ' const int cctki2_bmax[] = {'), (rpt (bsnl ' cctki2_[C]dir<0 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lsh[[I]] - cctki2_bhi[[I]] : cctki2_lsh[[I]],')), (bsnl ' };'), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name##_boundaries,'), @@ -463,22 +463,22 @@ for $dim (1,2,3,4) { (bsnl ' CCTK_WARN(CCTK_WARN_ABORT,'), (bsnl ' "The macro CCTK_LOOP[DIM]_INTBOUNDARIES can only be used in [DIM] dimensions");'), (bsnl ' }'), - (bsnl ' int const cctki2_blo[] = { '.(crpt '(cctki2_[C]blo_)').' };'), - (bsnl ' int const cctki2_bhi[] = { '.(crpt '(cctki2_[C]bhi_)').' };'), - (bsnl ' int const cctki2_bbox[] = { '.(crpt '(cctki2_[C]bboxlo_), (cctki2_[C]bboxhi_)').' };'), - (bsnl ' int const cctki2_lsh[] = { '.(crpt 'cctki2_cctkGH->cctk_lsh[[I]]').' };'), - (bsnl ' int const cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_);'), + (bsnl ' const int cctki2_blo[] = { '.(crpt '(cctki2_[C]blo_)').' };'), + (bsnl ' const int cctki2_bhi[] = { '.(crpt '(cctki2_[C]bhi_)').' };'), + (bsnl ' const int cctki2_bbox[] = { '.(crpt '(cctki2_[C]bboxlo_), (cctki2_[C]bboxhi_)').' };'), + (bsnl ' const int cctki2_lsh[] = { '.(crpt 'cctki2_cctkGH->cctk_lsh[[I]]').' };'), + (bsnl ' const int cctki2_istr CCTK_ATTRIBUTE_UNUSED = (cctki2_istr_);'), # Loop over all faces, edges, and corners (reverse (rpt (bsnl ' for (int cctki2_[C]dir=-1; cctki2_[C]dir<=+1; ++cctki2_[C]dir) {'))), - (bsnl ' int const cctki2_any_bbox ='), + (bsnl ' const int cctki2_any_bbox ='), (bsnlsep [rpt ' (cctki2_[C]dir<0 ? cctki2_bbox[[2*I]] : 0) || (cctki2_[C]dir>0 ? cctki2_bbox[[2*I+1]] : 0)'], ' ||', ';'), - (bsnl ' int const cctki2_all_bbox ='), + (bsnl ' const int cctki2_all_bbox ='), (bsnlsep [rpt ' (cctki2_[C]dir<0 ? cctki2_bbox[[2*I]] : 1) && (cctki2_[C]dir>0 ? cctki2_bbox[[2*I+1]] : 1)'], ' &&', ';'), (bsnl ' if (cctki2_all_bbox && cctki2_any_bbox) {'), - (bsnl ' int const cctki2_bmin[] = {'), + (bsnl ' const int cctki2_bmin[] = {'), (rpt (bsnl ' cctki2_[C]dir<0 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lsh[[I]] - cctki2_bhi[[I]],')), (bsnl ' };'), - (bsnl ' int const cctki2_bmax[] = {'), + (bsnl ' const int cctki2_bmax[] = {'), (rpt (bsnl ' cctki2_[C]dir<0 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lsh[[I]] - cctki2_bhi[[I]] : cctki2_lsh[[I]],')), (bsnl ' };'), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name##_intboundaries,'), -- cgit v1.2.3