aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-10-20 21:19:01 +0000
committerMike Buland <eichlan@xagasoft.com>2010-10-20 21:19:01 +0000
commit0f92e69c8fe508f387551a3d58a1f4c748e6611a (patch)
treea337aa1e65b8d4925b44793ac6c313ec99b97ab2 /src
parentea9c6b32e952e1d87872b992989854e4899cb8f8 (diff)
downloadlibgats-0f92e69c8fe508f387551a3d58a1f4c748e6611a.tar.gz
libgats-0f92e69c8fe508f387551a3d58a1f4c748e6611a.tar.bz2
libgats-0f92e69c8fe508f387551a3d58a1f4c748e6611a.tar.xz
libgats-0f92e69c8fe508f387551a3d58a1f4c748e6611a.zip
Corrected a bug that caused numbers between -1 and -63 inclusive to be positive.
Diffstat (limited to 'src')
-rw-r--r--src/integer.h2
-rw-r--r--src/tests/int.cpp2
2 files changed, 3 insertions, 1 deletions
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
52 b = (iIn&0x3F); 52 b = (iIn&0x3F);
53 if( iIn > b ) 53 if( iIn > b )
54 b |= 0x80 | 0x40; 54 b |= 0x80 | 0x40;
55 else
56 b |= 0x40;
55 } 57 }
56 else 58 else
57 { 59 {
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;
8int main() 8int main()
9{ 9{
10 MemBuf mb; 10 MemBuf mb;
11 int64_t i = -(100); 11 int64_t i = -6;
12 12
13 sio << "Before: " << i << sio.nl; 13 sio << "Before: " << i << sio.nl;
14 Gats::Integer::writePackedInt( mb, i ); 14 Gats::Integer::writePackedInt( mb, i );