chiark / gitweb /
Update stressapptest to 1.0.3.
[stressapptest] / src / finelock_queue.h
index 54b154e1da3ab10d4a129a0b3f077ccac2684666..2de5a4616c9026c3954b3582106608c7f9c2bd85 100644 (file)
@@ -57,7 +57,9 @@ class FineLockPEQueue {
   uint64 GetRandom64FromSlot(int slot);
 
   // Helper function to check index range, returns true if index is valid.
-  bool valid_index(int64 index) { return index >= 0 && index < q_size_; }
+  bool valid_index(int64 index) {
+    return index >= 0 && static_cast<uint64>(index) < q_size_;
+  }
 
   // Returns true if page entry is valid, false otherwise.
   static bool page_is_valid(struct page_entry *pe) {
@@ -85,7 +87,7 @@ class FineLockPEQueue {
 
   pthread_mutex_t *pagelocks_;  // Per-page-entry locks.
   struct page_entry *pages_;     // Where page entries are held.
-  int64 q_size_;                 // Size of the queue.
+  uint64 q_size_;                // Size of the queue.
   int64 page_size_;              // For calculating array index from offset.
 
   enum {