]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Make return size_t at functions Event and Pool
authorkumar8600 <kumar8600@gmail.com>
Sun, 12 Oct 2014 12:10:03 +0000 (21:10 +0900)
committerkumar8600 <kumar8600@gmail.com>
Sun, 12 Oct 2014 12:10:03 +0000 (21:10 +0900)
entityx/Event.h
entityx/help/Pool.h

index f23849791677df07bfba6f042cb96605c19911c6..ec048d7c37b49202b6335c345f327c3dde45097d 100644 (file)
@@ -75,7 +75,7 @@ class BaseReceiver {
   }
 
   // Return number of signals connected to this receiver.
-  int connected_signals() const {
+  size_t connected_signals() const {
     size_t size = 0;
     for (auto connection : connections_) {
       if (!connection.first.expired()) {
index ac959d26c520f49b42ce084da33021e459f3d7ef..c0283d2e2c6020f36ca43de3a32ab70432e89136 100644 (file)
@@ -27,13 +27,13 @@ namespace entityx {
  */
 class BasePool {
  public:
-  explicit BasePool(int element_size, int chunk_size = 8192)
+  explicit BasePool(size_t element_size, size_t chunk_size = 8192)
       : element_size_(element_size), chunk_size_(chunk_size), capacity_(0) {}
   virtual ~BasePool();
 
-  int size() const { return size_; }
-  int capacity() const { return capacity_; }
-  int chunks() const { return blocks_.size(); }
+  size_t size() const { return size_; }
+  size_t capacity() const { return capacity_; }
+  size_t chunks() const { return blocks_.size(); }
 
   /// Ensure at least n elements will fit in the pool.
   inline void expand(int n) {
@@ -65,10 +65,10 @@ class BasePool {
 
  protected:
   std::vector<char *> blocks_;
-  int element_size_;
-  int chunk_size_;
-  int size_ = 0;
-  int capacity_;
+  size_t element_size_;
+  size_t chunk_size_;
+  size_t size_ = 0;
+  size_t capacity_;
 };