diff liboctave/Sparse.h @ 10358:72fab01e5d68

improve some size_t queries
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 25 Feb 2010 12:55:13 +0100
parents a3635bc1ea19
children 1766c133674c
line wrap: on
line diff
--- a/liboctave/Sparse.h	Thu Feb 25 11:11:45 2010 +0100
+++ b/liboctave/Sparse.h	Thu Feb 25 12:55:13 2010 +0100
@@ -263,8 +263,12 @@
         ret++;
       return ret;
     }
-  size_t byte_size (void) const { return (cols () + 1) * sizeof (octave_idx_type) +
-      capacity () * (sizeof (T) + sizeof (octave_idx_type)); }
+
+  size_t byte_size (void) const 
+    { 
+      return (static_cast<size_t>(cols () + 1) * sizeof (octave_idx_type)
+              + static_cast<size_t> (capacity ()) * (sizeof (T) + sizeof (octave_idx_type))); 
+    }
 
   dim_vector dims (void) const { return dimensions; }