summaryrefslogtreecommitdiffstats
path: root/src/ConvEncoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-05-27 16:29:38 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-05-27 16:29:38 +0200
commit4fe6a33685ce9cc0be44319fca5ce30e05bfb090 (patch)
treec11d2171eeb0a11fdeec87770baa47fbeb6452b5 /src/ConvEncoder.cpp
parentc3f5387d9d8d3fd36e8bcf562c1ad4cc99e38a91 (diff)
downloaddabmod-4fe6a33685ce9cc0be44319fca5ce30e05bfb090.tar.gz
dabmod-4fe6a33685ce9cc0be44319fca5ce30e05bfb090.tar.bz2
dabmod-4fe6a33685ce9cc0be44319fca5ce30e05bfb090.zip
Replace some unsigned types
Diffstat (limited to 'src/ConvEncoder.cpp')
-rw-r--r--src/ConvEncoder.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ConvEncoder.cpp b/src/ConvEncoder.cpp
index 3245d30..f3fc0f9 100644
--- a/src/ConvEncoder.cpp
+++ b/src/ConvEncoder.cpp
@@ -27,7 +27,7 @@
#include <stdexcept>
-const static unsigned char PARITY[] = {
+const static uint8_t PARITY[] = {
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
@@ -73,8 +73,8 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
size_t out_block_size = (d_framesize * 4) + 3;
size_t in_offset = 0;
size_t out_offset = 0;
- unsigned short memory = 0;
- unsigned char data;
+ uint16_t memory = 0;
+ uint8_t data;
if (dataIn->getLength() != in_block_size) {
PDEBUG("%zu != %zu != 0\n", dataIn->getLength(), in_block_size);
@@ -82,8 +82,8 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
"ConvEncoder::process input size not valid!\n");
}
dataOut->setLength(out_block_size);
- const unsigned char* in = reinterpret_cast<const unsigned char*>(dataIn->getData());
- unsigned char* out = reinterpret_cast<unsigned char*>(dataOut->getData());
+ const uint8_t* in = reinterpret_cast<const uint8_t*>(dataIn->getData());
+ uint8_t* out = reinterpret_cast<uint8_t*>(dataOut->getData());
// While there is enought input and ouput items
while (dataIn->getLength() - in_offset >= in_block_size &&
@@ -100,11 +100,11 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
memory |= (data >> 7) << 6;
data <<= 1;
//PDEBUG("Memory: 0x%x\n", memory);
- unsigned char poly[4] = {
- (unsigned char)(memory & 0x5b),
- (unsigned char)(memory & 0x79),
- (unsigned char)(memory & 0x65),
- (unsigned char)(memory & 0x5b)
+ uint8_t poly[4] = {
+ (uint8_t)(memory & 0x5b),
+ (uint8_t)(memory & 0x79),
+ (uint8_t)(memory & 0x65),
+ (uint8_t)(memory & 0x5b)
};
//PDEBUG("Polys: 0x%x, 0x%x, 0x%x, 0x%x\n", poly[0], poly[1], poly[2], poly[3]);
// For each poly
@@ -125,11 +125,11 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
for (unsigned j = 0; j < 2; ++j) {
memory >>= 1;
//PDEBUG("Memory: 0x%x\n", memory);
- unsigned char poly[4] = {
- (unsigned char)(memory & 0x5b),
- (unsigned char)(memory & 0x79),
- (unsigned char)(memory & 0x65),
- (unsigned char)(memory & 0x5b)
+ uint8_t poly[4] = {
+ (uint8_t)(memory & 0x5b),
+ (uint8_t)(memory & 0x79),
+ (uint8_t)(memory & 0x65),
+ (uint8_t)(memory & 0x5b)
};
//PDEBUG("Polys: 0x%x, 0x%x, 0x%x, 0x%x\n", poly[0], poly[1], poly[2], poly[3]);
// For each poly