Add std=c++11 and added string libraries to M10 decoder for clang

pull/108/head
Michael Wheeler 2019-01-22 10:03:38 +11:00
rodzic 831d240c68
commit 23b4599d46
5 zmienionych plików z 17 dodań i 8 usunięć

Wyświetl plik

@ -17,7 +17,7 @@ gcc rs41dm_dft.c demod_dft.o -lm -o rs41ecc -I../ecc/ -I../rs41
gcc dfm09dm_dft.c demod_dft.o -lm -o dfm09ecc -I../ecc/ -I../dfm
# Build M10 decoder
cd ../m10/
g++ M10.cpp M10Decoder.cpp M10GeneralParser.cpp M10GTopParser.cpp M10PtuParser.cpp AudioFile.cpp -lm -o m10
g++ M10.cpp M10Decoder.cpp M10GeneralParser.cpp M10GTopParser.cpp M10PtuParser.cpp AudioFile.cpp -lm -o m10 -std=c++11
# Copy all necessary files into this directory.

Wyświetl plik

@ -21,6 +21,9 @@
#include "M10GTopParser.h"
#include <ctime>
#include <string>
#include <sstream>
#include <iostream>
M10GTopParser::M10GTopParser() {
}

Wyświetl plik

@ -5,6 +5,9 @@
* Created on December 12, 2018, 10:52 PM
*/
#include <string>
#include <sstream>
#include <iostream>
#include "M10GeneralParser.h"
#include "M10PtuParser.h"
@ -83,13 +86,13 @@ void M10GeneralParser::addToStats() {
}
void M10GeneralParser::printStatsFrame() {
u_short valMax;
u_short posMax;
unsigned short valMax;
unsigned short posMax;
for (int i = 0; i < FRAME_LEN; ++i) {
valMax = 0;
posMax = 0;
for (u_short k = 0; k < 0xFF+1; ++k) { // Find maximum
for (unsigned short k = 0; k < 0xFF+1; ++k) { // Find maximum
if (statValues[i][k] > valMax) {
valMax = statValues[i][k];
posMax = k;

Wyświetl plik

@ -41,7 +41,7 @@ public:
virtual void printFrame() = 0;
protected:
std::array<unsigned char, DATA_LENGTH> frame_bytes;
std::array<std::array<u_short, 0xFF+1>, DATA_LENGTH> statValues = {};
std::array<std::array<unsigned short, 0xFF+1>, DATA_LENGTH> statValues = {};
bool correctCRC;
bool dispRaw = false;
int frameLength = 0;

Wyświetl plik

@ -20,6 +20,9 @@
#define pos_Check (stdFLEN-1) // 2 byte*/
#include "M10PtuParser.h"
#include <string>
#include <sstream>
#include <iostream>
char M10PtuParser::similarData[] = "xxxx----------------------xxxxxxxxxxxxxxxxxxxxxxxxxxx---xxxxxxx--xxxx-----xx----xxxxx------xxxxxxx---";
char M10PtuParser::insertSpaces[] = "---xx-x-x-x---x---x---x---x-----x-x-----------x---x--x--x-----xx-x-x-x-xx-x-x-x-x----x---x-x-x----xxxx-x-------------x";
@ -353,8 +356,8 @@ std::string M10PtuParser::getdxlSerialNumber() {
}
std::array<unsigned char, DATA_LENGTH> M10PtuParser::replaceWithPrevious(std::array<unsigned char, DATA_LENGTH> data) {
u_short valMax;
u_short posMax;
unsigned short valMax;
unsigned short posMax;
if (!correctCRC) { // Use probabilities
int threshold = statValues[0][0x64] / 2; // more than 50%
@ -363,7 +366,7 @@ std::array<unsigned char, DATA_LENGTH> M10PtuParser::replaceWithPrevious(std::ar
if (similarData[i] == 'x') {
valMax = 0;
posMax = 0;
for (u_short k = 0; k < 0xFF + 1; ++k) { // Find maximum
for (unsigned short k = 0; k < 0xFF + 1; ++k) { // Find maximum
if (statValues[i][k] > valMax) {
valMax = statValues[i][k];
posMax = k;