From 0f92e69c8fe508f387551a3d58a1f4c748e6611a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Oct 2010 21:19:01 +0000 Subject: Corrected a bug that caused numbers between -1 and -63 inclusive to be positive. --- src/integer.h | 2 ++ src/tests/int.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/integer.h b/src/integer.h index 014b53a..b54bf5d 100644 --- a/src/integer.h +++ b/src/integer.h @@ -52,6 +52,8 @@ namespace Gats b = (iIn&0x3F); if( iIn > b ) b |= 0x80 | 0x40; + else + b |= 0x40; } else { diff --git a/src/tests/int.cpp b/src/tests/int.cpp index 1601578..348e179 100644 --- a/src/tests/int.cpp +++ b/src/tests/int.cpp @@ -8,7 +8,7 @@ using namespace Bu; int main() { MemBuf mb; - int64_t i = -(100); + int64_t i = -6; sio << "Before: " << i << sio.nl; Gats::Integer::writePackedInt( mb, i ); -- cgit v1.2.3