Browse Source

Address some compiler warnings

Ian Goldberg 1 year ago
parent
commit
7816a570d3
2 changed files with 16 additions and 15 deletions
  1. 14 13
      Enclave/OblivAlgs/WaksmanNetwork.hpp
  2. 2 2
      Enclave/sort.tcc

+ 14 - 13
Enclave/OblivAlgs/WaksmanNetwork.hpp

@@ -50,7 +50,8 @@ struct WNEvalPlan {
   WNEvalPlan(WNEvalPlan &&wn) = default;
   WNEvalPlan& operator=(WNEvalPlan&&) = default;
 
-  WNEvalPlan(uint32_t N, uint32_t nthreads) : N(N), nthreads(nthreads) {
+  WNEvalPlan(uint32_t N_, uint32_t nthreads_) : N(N_),
+          nthreads(nthreads_) {
       if (N<2) {
           subtree_num_inswitches = 0;
           subtree_num_outswitches = 0;
@@ -80,20 +81,20 @@ struct WNEvalPlan {
   }
 
   // Count the number of input and output switches used by a
-  // WaksmanNetwork with N items.  Add those values to
+  // WaksmanNetwork with num items.  Add those values to
   // subtree_num_inswitches and subtree_num_outswitches.
-  void count_switches(uint32_t N) {
-    if (N<2) {
+  void count_switches(uint32_t num) {
+    if (num<2) {
       return;
     }
-    if (N == 2) {
+    if (num == 2) {
       subtree_num_outswitches += 1;
       return;
     }
-    const uint32_t Nleft = (N+1)/2;
-    const uint32_t Nright = N/2;
-    const uint32_t numInSwitches = (N-1)/2;
-    const uint32_t numOutSwitches = N/2;
+    const uint32_t Nleft = (num+1)/2;
+    const uint32_t Nright = num/2;
+    const uint32_t numInSwitches = (num-1)/2;
+    const uint32_t numOutSwitches = num/2;
 
     subtree_num_inswitches += numInSwitches;
     subtree_num_outswitches += numOutSwitches;
@@ -148,10 +149,10 @@ class WaksmanNetwork {
       const WNEvalPlan &plan;
       WNTraversal &traversal;
 
-      appInvPermArgs(WaksmanNetwork &wn, unsigned char *buf,
-          size_t block_size, const WNEvalPlan &plan, WNTraversal &traversal)
-          : wn(wn), buf(buf), block_size(block_size), plan(plan),
-          traversal(traversal) {}
+      appInvPermArgs(WaksmanNetwork &wn_, unsigned char *buf_,
+          size_t block_size_, const WNEvalPlan &plan_, WNTraversal
+          &traversal_) : wn(wn_), buf(buf_), block_size(block_size_),
+          plan(plan_), traversal(traversal_) {}
   };
 
   template <OSwap_Style oswap_style>

+ 2 - 2
Enclave/sort.tcc

@@ -139,9 +139,9 @@ static void *move_sorted(void *voidargs)
 // Note: the outbuf buffer cannot overlap the items buffer.
 template<typename T>
 void sort_mtobliv(threadid_t nthreads, uint8_t* items, uint16_t msg_size,
-    uint32_t Nr, uint32_t Na, uint8_t *outbuf)
+    uint32_t Nr_, uint32_t Na, uint8_t *outbuf)
 {
-    sort_mtobliv<T>(nthreads, items, msg_size, Nr, Na,
+    sort_mtobliv<T>(nthreads, items, msg_size, Nr_, Na,
         [nthreads, msg_size, outbuf]
         (const uint8_t* origitems, const T* keys, uint32_t Nr) {
             // Special-case nthreads=1 for efficiency