summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-09-08 09:52:16 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-09-08 10:30:40 +0000
commit5498a227cc6ba3e21e268d4ae3dbb98cfe7f246c (patch)
treea562106152f737ad3e4adb6046985cefbfceb79d /vespalib
parent1e09f6d71051c855acbb18f810e7b881e7c871f3 (diff)
Remove 32 bit limitation.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/objects/nbostream.h10
-rw-r--r--vespalib/src/vespa/vespalib/util/array.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/vespalib/src/vespa/vespalib/objects/nbostream.h b/vespalib/src/vespa/vespalib/objects/nbostream.h
index b905e586c9f..b68a5d3cacb 100644
--- a/vespalib/src/vespa/vespalib/objects/nbostream.h
+++ b/vespalib/src/vespa/vespalib/objects/nbostream.h
@@ -235,7 +235,7 @@ class nbostream
State state() const { return _state; }
bool good() const { return _state == ok; }
void clear() { _wbuf.clear(); _wp = _rp = 0; _state = ok; }
- void adjustReadPos(ssize_t adj) { uint32_t npos = _rp + adj; if (__builtin_expect(npos > _wp, false)) { fail(eof); } _rp = npos; }
+ void adjustReadPos(ssize_t adj) { size_t npos = _rp + adj; if (__builtin_expect(npos > _wp, false)) { fail(eof); } _rp = npos; }
friend std::ostream & operator << (std::ostream & os, const nbostream & s) { return os << HexDump(&s._rbuf[s._rp], s.left()); }
static bool n2h(bool v) { return v; }
static int8_t n2h(int8_t v) { return v; }
@@ -318,14 +318,14 @@ class nbostream
void write4(const void *v) { write(v, 4); }
void write8(const void *v) { write(v, 8); }
void fail(State s);
- uint32_t left() const { return _wp - _rp; }
- uint32_t space() const { return _wbuf.size() - _wp; }
+ size_t left() const { return _wp - _rp; }
+ size_t space() const { return _wbuf.size() - _wp; }
void compact();
void extend(size_t newSize);
Buffer _wbuf;
ConstBufferRef _rbuf;
- uint32_t _rp;
- uint32_t _wp;
+ size_t _rp;
+ size_t _wp;
State _state;
const bool _longLivedBuffer;
};
diff --git a/vespalib/src/vespa/vespalib/util/array.h b/vespalib/src/vespa/vespalib/util/array.h
index d2741dba29b..8f40d4de0c7 100644
--- a/vespalib/src/vespa/vespalib/util/array.h
+++ b/vespalib/src/vespa/vespalib/util/array.h
@@ -176,8 +176,8 @@ public:
bool operator == (const Array & rhs) const;
bool operator != (const Array & rhs) const { return !(*this == rhs); }
private:
- T * array(uint32_t i) { return static_cast<T *>(_array.get()) + i; }
- const T * array(uint32_t i) const { return static_cast<const T *>(_array.get()) + i; }
+ T * array(size_t i) { return static_cast<T *>(_array.get()) + i; }
+ const T * array(size_t i) const { return static_cast<const T *>(_array.get()) + i; }
void cleanup();
void increase(size_t n);
void extend(size_t n) {
@@ -186,7 +186,7 @@ private:
}
}
B _array;
- uint32_t _sz;
+ size_t _sz;
};
template <typename T>