Use size_t as operator[] argument type
authorMarco Costalba <mcostalba@gmail.com>
Wed, 22 Aug 2012 10:44:43 +0000 (11:44 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 22 Aug 2012 10:44:43 +0000 (11:44 +0100)
This better mimics std::vector::operator[] and
fixes a warning with MSVC 64bit.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/thread.h

index 96ad121..ad40a34 100644 (file)
@@ -108,7 +108,7 @@ public:
   void init(); // No c'tor, Threads object is global and engine shall be fully initialized
   ~ThreadPool();
 
-  Thread& operator[](int id) { return *threads[id]; }
+  Thread& operator[](size_t id) { return *threads[id]; }
   bool use_sleeping_threads() const { return useSleepingThreads; }
   int min_split_depth() const { return minimumSplitDepth; }
   size_t size() const { return threads.size(); }