=== modified file 'include/Range.h'
--- include/Range.h	2010-11-21 04:40:05 +0000
+++ include/Range.h	2011-01-31 14:50:38 +0000
@@ -42,7 +42,7 @@
 
 /* represents [start, end) */
 
-template <class C>
+template <class C, class S = size_t>
 class Range
 {
 
@@ -52,35 +52,35 @@
     C start;
     C end;
     Range intersection (Range const &) const;
-    C size() const;
+    S size() const;
 };
 
-template <class C>
-std::ostream& operator << (std::ostream &os, Range<C> const &aRange)
+template <class C, class S>
+std::ostream& operator << (std::ostream &os, Range<C, S> const &aRange)
 {
     os << "[" << aRange.start << "," << aRange.end << ")";
     return os;
 }
 
-template<class C>
-Range<C>::Range () : start(), end() {}
-
-template<class C>
-Range<C>::Range (C start_, C end_) : start(start_), end(end_) {}
-
-template<class C>
-Range<C>
-Range<C>::intersection (Range const &rhs) const
+template<class C, class S>
+Range<C, S>::Range () : start(), end() {}
+
+template<class C, class S>
+Range<C, S>::Range (C start_, C end_) : start(start_), end(end_) {}
+
+template<class C, class S>
+Range<C, S>
+Range<C, S>::intersection (Range const &rhs) const
 {
-    Range<C> result (max(start, rhs.start), min(end, rhs.end));
+    Range<C, S> result (max(start, rhs.start), min(end, rhs.end));
     return result;
 }
 
-template<class C>
-C
-Range<C>::size() const
+template<class C, class S>
+S
+Range<C, S>::size() const
 {
-    return end > start ? end - start : 0;
+    return (S) (end > start ? end - start : 0);
 }
 
 #endif /* SQUID_RANGE_H */

=== modified file 'src/HttpHeaderRange.h'
--- src/HttpHeaderRange.h	2010-04-07 09:49:57 +0000
+++ src/HttpHeaderRange.h	2011-01-31 14:26:01 +0000
@@ -48,7 +48,7 @@
 
 public:
     MEMPROXY_CLASS(HttpHdrRangeSpec);
-    typedef Range<int64_t> HttpRange;
+    typedef Range<int64_t, int64_t> HttpRange;
     static int64_t const UnknownPosition;
 
     HttpHdrRangeSpec();

=== modified file 'src/client_side.cc'
--- src/client_side.cc	2011-01-27 01:12:25 +0000
+++ src/client_side.cc	2011-01-31 14:49:58 +0000
@@ -1055,7 +1055,7 @@
              * intersection of "have" and "need" ranges must not be empty
              */
             assert(http->out.offset < i->currentSpec()->offset + i->currentSpec()->length);
-            assert(http->out.offset + available.size() > i->currentSpec()->offset);
+            assert(http->out.offset + available.size() > (uint64_t)i->currentSpec()->offset);
 
             /*
              * put boundary and headers at the beginning of a range in a
@@ -1113,7 +1113,7 @@
         /* adjust for not to be transmitted bytes */
         http->out.offset = nextOffset;
 
-        if (available.size() <= skip)
+        if (available.size() <= (uint64_t)skip)
             return;
 
         available.start += skip;

=== modified file 'src/client_side.h'
--- src/client_side.h	2010-12-15 09:38:03 +0000
+++ src/client_side.h	2011-01-31 14:16:26 +0000
@@ -50,9 +50,6 @@
 class ChunkedCodingParser;
 class HttpParser;
 
-template <class T>
-class Range;
-
 class ClientSocketContext : public RefCountable
 {
 


