Skip to contentSkip to conversation

interval_set: fix truncation of _size

PATCH Applied Henry C Chang 2 participants 2 messages Dec 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 interval_set: fix truncation of _size

_size is type of int64_t. Use int to store the value of _size will cause value truncation.

---
 src/include/interval_set.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/include/interval_set.h +1 -1
index ae1c7ff..bfc62a9 100644
@@ -361,7 +361,7 @@ class interval_set {
 
   void swap(interval_set<T>& other) {
     m.swap(other.m);
-    int t = _size;
+    int64_t t = _size;
     _size = other._size;
     other._size = t;
   }    
Signature · 1 line
1.7.4.1
Applied
#1 lore raw

Applied all three of these. Thanks!

sage

Quoted 30 lines · Henry C Chang

_size is type of int64_t. Use int to store the value of _size will cause value truncation.

---
 src/include/interval_set.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/include/interval_set.h +1 -1
index ae1c7ff..bfc62a9 100644
@@ -361,7 +361,7 @@ class interval_set {
 
   void swap(interval_set<T>& other) {
     m.swap(other.m);
-    int t = _size;
+    int64_t t = _size;
     _size = other._size;
     other._size = t;
   }    
Signature · 6 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html