Browse Source

fix buffer constructor

greatbridf 2 years ago
parent
commit
23e86efdae
1 changed files with 3 additions and 3 deletions
  1. 3 3
      include/types/buffer.hpp

+ 3 - 3
include/types/buffer.hpp

@@ -50,9 +50,9 @@ public:
 
     constexpr buffer(const buffer& buf)
         : start { types::allocator_traits<allocator_type>::allocate(buf.end + 1 - buf.start) }
-        , end { start + buf.end - buf.start }
-        , base { start + buf.base - buf.start }
-        , head { start + buf.base - buf.start }
+        , end { (uint32_t)start + (uint32_t)buf.end - (uint32_t)buf.start }
+        , base { (uint32_t)start + (uint32_t)buf.base - (uint32_t)buf.start }
+        , head { (uint32_t)start + (uint32_t)buf.base - (uint32_t)buf.start }
         , count { buf.count }
     {
     }