Kaynağa Gözat

mathutil: mersenne.h parameters should not be an enum

This makes no sense as an enum; they're constants, so
they should be static const.
Sam Edwards 7 yıl önce
ebeveyn
işleme
87d1048f79
1 değiştirilmiş dosya ile 6 ekleme ve 8 silme
  1. 6 8
      panda/src/mathutil/mersenne.h

+ 6 - 8
panda/src/mathutil/mersenne.h

@@ -69,14 +69,12 @@ PUBLISHED:
   };
 
 private:
-  enum {
-    // Period parameters
-    N = 624,
-    M = 397,
-    MATRIX_A = 0x9908b0dfUL,   // constant vector a
-    UPPER_MASK = 0x80000000UL, // most significant w-r bits
-    LOWER_MASK = 0x7fffffffUL, // least significant r bits
-  };
+  // Period parameters
+  static const unsigned long N = 624;
+  static const unsigned long M = 397;
+  static const unsigned long MATRIX_A = 0x9908b0dfUL;   // constant vector a
+  static const unsigned long UPPER_MASK = 0x80000000UL; // most significant w-r bits
+  static const unsigned long LOWER_MASK = 0x7fffffffUL; // least significant r bits
 
   unsigned long mt[N]; // the array for the state vector
   unsigned int mti; // mti==N+1 means mt[N] is not initialized