aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/EncodeBuffer.cpp
diff options
context:
space:
mode:
authorFernando Carvajal <fcarvajal@qindel.com>2016-04-12 11:52:22 +0200
committerFernando Carvajal <fcarvajal@qindel.com>2016-04-12 12:07:53 +0200
commita9be6f59105b7cf29bb799556274dc2c3b3d2af8 (patch)
tree555bfeba04b21dc26df16ee5c26a3ec798d02584 /nxcomp/EncodeBuffer.cpp
parent2ffe52c5ecb7cf6af111c685eee7f8fcfd1139a9 (diff)
downloadnx-libs-a9be6f59105b7cf29bb799556274dc2c3b3d2af8.tar.gz
nx-libs-a9be6f59105b7cf29bb799556274dc2c3b3d2af8.tar.bz2
nx-libs-a9be6f59105b7cf29bb799556274dc2c3b3d2af8.zip
Remove compatibility code for nxcomp before 3.5.0
As a part of nxcomp's clean-up process, compatibility with old protocol versions has been set now at 3.5.0. This commit removes compatibility code from nxcomp so the minimum supported version changes from 1.5.0 (protocol step 6) to 3.5.0 (protocol step 10). At this moment the removal is not complete and it will be followed by some other commits, in order to get rid of several components and files that are no longer used as they were only needed to work with old protocol versions. Refs: ArcticaProject/nx-libs#108
Diffstat (limited to 'nxcomp/EncodeBuffer.cpp')
-rw-r--r--nxcomp/EncodeBuffer.cpp67
1 files changed, 9 insertions, 58 deletions
diff --git a/nxcomp/EncodeBuffer.cpp b/nxcomp/EncodeBuffer.cpp
index 12a57180e..afcf60a9e 100644
--- a/nxcomp/EncodeBuffer.cpp
+++ b/nxcomp/EncodeBuffer.cpp
@@ -261,47 +261,14 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits,
// Avoid to encode the additional bool.
//
- if (control -> isProtoStep8() == 1)
- {
- #ifdef DUMP
- *logofs << "EncodeBuffer: Encoded missed int using "
- << diffBits() << " bits out of " << numBits
- << ".\n" << logofs_flush;
- #endif
-
- encodeValue(value, numBits, blockSize);
- }
- else
- {
- if (sameDiff)
- {
- #ifdef DUMP
- *logofs << "EncodeBuffer: Matched difference with block size "
- << cache.getBlockSize(blockSize) << ".\n"
- << logofs_flush;
- #endif
-
- encodeBoolValue(1);
- }
- else
- {
- #ifdef DUMP
- *logofs << "EncodeBuffer: Missed difference with block size "
- << cache.getBlockSize(blockSize) << ".\n"
- << logofs_flush;
- #endif
-
- encodeBoolValue(0);
-
- encodeValue(value, numBits, blockSize);
- }
+ // Since ProtoStep8 (#issue 108)
+ #ifdef DUMP
+ *logofs << "EncodeBuffer: Encoded missed int using "
+ << diffBits() << " bits out of " << numBits
+ << ".\n" << logofs_flush;
+ #endif
- #ifdef DUMP
- *logofs << "EncodeBuffer: Encoded missed int using "
- << diffBits() << " bits out of " << numBits
- << ".\n" << logofs_flush;
- #endif
- }
+ encodeValue(value, numBits, blockSize);
}
}
@@ -454,7 +421,8 @@ unsigned int EncodeBuffer::getLength() const
length++;
}
- if (length > 0 && control -> isProtoStep7() == 1)
+ // Since ProtoStep7 (#issue 108)
+ if (length > 0)
{
return length + ENCODE_BUFFER_POSTFIX_SIZE;
}
@@ -641,20 +609,3 @@ void EncodeBuffer::encodeFreeXidValue(unsigned int value, FreeCache &cache)
{
encodeCachedValue(value, 29, cache);
}
-
-void EncodeBuffer::encodePositionValueCompat(short int value, PositionCacheCompat &cache)
-{
- unsigned int t = (value - cache.last_);
-
- encodeCachedValue(t, 13, *(cache.base_[cache.slot_]));
-
- cache.last_ = value;
-
- #ifdef DEBUG
- *logofs << "EncodeBuffer: Encoded position "
- << value << " with base " << cache.slot_
- << ".\n" << logofs_flush;
- #endif
-
- cache.slot_ = (value & 0x1f);
-}