From f082cf80c0595b68330ce293c47b84aa479282fa Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Tue, 9 Jan 2018 10:25:41 +0000
Subject: [PATCH] Renaming and adding const.

---
 src/cache.h             | 10 +++++-----
 src/runner_doiact_vec.c |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/cache.h b/src/cache.h
index 173884591a..c41e11c342 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -253,9 +253,9 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
   /* The cell is on the right so read the particles
    * into the cache from the start of the cell. */
   if (!flipped) {
-    int rem = (*last_pi + 1) % VEC_SIZE;
+    const int rem = (*last_pi + 1) % VEC_SIZE;
     if (rem != 0) {
-      int pad = VEC_SIZE - rem;
+      const int pad = VEC_SIZE - rem;
 
       /* Increase last_pi if there are particles in the cell left to read. */
       if (*last_pi + pad < ci->count) *last_pi += pad;
@@ -299,15 +299,15 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
   /* The cell is on the left so read the particles
    * into the cache from the end of the cell. */
   else {
-    int rem = (ci->count - *first_pi) % VEC_SIZE;
+    const int rem = (ci->count - *first_pi) % VEC_SIZE;
     if (rem != 0) {
-      int pad = VEC_SIZE - rem;
+      const int pad = VEC_SIZE - rem;
 
       /* Decrease first_pi if there are particles in the cell left to read. */
       if (*first_pi - pad >= 0) *first_pi -= pad;
     }
 
-    int ci_cache_count = ci->count - *first_pi;
+    const int ci_cache_count = ci->count - *first_pi;
 
     /* Shift the particles positions to a local frame so single precision can be
      * used instead of double precision. */
diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c
index 6e137f7d3e..1a018da162 100644
--- a/src/runner_doiact_vec.c
+++ b/src/runner_doiact_vec.c
@@ -262,7 +262,7 @@ __attribute__((always_inline)) INLINE static void storeInteractions(
  * @param active_ci Is any particle in cell ci active?
  * @param active_cj Is any particle in cell cj active?
  */
-__attribute__((always_inline)) INLINE static void populate_max_index(
+__attribute__((always_inline)) INLINE static void populate_max_index_density(
     const struct cell *ci, const struct cell *cj,
     const struct entry *restrict sort_i, const struct entry *restrict sort_j,
     const float dx_max, const float rshift, const double hi_max,
@@ -1390,7 +1390,7 @@ __attribute__((always_inline)) INLINE void runner_dopair1_density_vec(
   /* Find particles maximum index into cj, max_index_i[] and ci, max_index_j[].
    * Also find the first pi that interacts with any particle in cj and the last
    * pj that interacts with any particle in ci. */
-  populate_max_index(ci, cj, sort_i, sort_j, dx_max, rshift, hi_max, hj_max,
+  populate_max_index_density(ci, cj, sort_i, sort_j, dx_max, rshift, hi_max, hj_max,
                      di_max, dj_min, max_index_i, max_index_j, &first_pi,
                      &last_pj, max_active_bin, active_ci, active_cj);
 
-- 
GitLab