1
0
mirror of https://github.com/JvanKatwijk/dab-cmdline synced 2025-10-05 23:52:50 +02:00

changes to eliminate warnings

This commit is contained in:
jan
2020-06-18 13:32:07 +02:00
parent 511452bbbf
commit c921424914
34 changed files with 44 additions and 83 deletions

View File

@@ -225,7 +225,7 @@ void set_dataChannel (void *, packetdata *);
int32_t dab_getSId (void *, const char*);
//
// and the other way around, mapping the service identifier to a name
std::string dab_getserviceName (void *, int32_t);
void dab_getserviceName (void *, int32_t, char *);
}
#endif

View File

@@ -131,7 +131,6 @@ private:
int16_t gain;
HINSTANCE Handle;
bool libraryLoaded;
bool success;
bool running;
const char* board_id_name (void);
int32_t selectedRate;
@@ -141,7 +140,6 @@ const char* board_id_name (void);
int16_t mapTable_int [4 * 512];
float mapTable_float [4 * 512];
RingBuffer<std::complex<float>> *theBuffer;
int32_t inputRate;
struct airspy_device* device;
uint64_t serialNumber;
char serial[128];

View File

@@ -53,7 +53,6 @@ public:
hackrf_device *theDevice;
private:
int32_t vfoFrequency;
int16_t ppm;
int16_t lnaGain;
int16_t vgaGain;
bool ampEnable;

View File

@@ -4,19 +4,20 @@
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Qt-DAB program
* Qt-DAB is free software; you can redistribute it and/or modify
* This file is part of the dab library
*
* dab library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* dab library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* along with dab library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -175,9 +176,6 @@ int16_t limeHandler::bitDepth (void) {
void limeHandler::run (void) {
int res;
lms_stream_status_t streamStatus;
int underruns = 0;
int overruns = 0;
int dropped = 0;
int amountRead = 0;
fprintf (stderr, "lime is working now\n");

View File

@@ -4,19 +4,20 @@
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Qt-DAB program
* Qt-DAB is free software; you can redistribute it and/or modify
* This file is part of the Dab library
*
* dab library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* dab library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* along with dab library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

View File

@@ -89,21 +89,18 @@ public:
int32_t sampleCounter;
private:
int32_t inputRate;
int32_t deviceCount;
uint16_t deviceIndex;
bool autogain;
int16_t ppmCorrection;
HINSTANCE Handle;
std::thread workerHandle;
int32_t lastFrequency;
bool libraryLoaded;
bool open;
int *gains;
int16_t gainsCount;
int gain;
bool running;
int frequency;
char * deviceOptions;
char * deviceOptions;
// here we need to load functions from the dll
bool load_rtlFunctions (void);
pfnrtlsdr_get_index_by_serial rtlsdr_get_index_by_serial;

View File

@@ -1,9 +1,9 @@
cmake_minimum_required( VERSION 2.8.11 )
set (objectName dab_cmdline-2)
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -flto")
#set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -g")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -flto")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -g")
#set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g")
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/usr/local/bin" CACHE PATH "default install path" FORCE )
endif()

View File

@@ -49,7 +49,6 @@ const char *outputChannelwithRate (int16_t, int32_t);
void audioOutput (float *, int32_t);
int32_t CardRate;
int16_t latency;
int32_t size;
bool portAudio;
bool writerRunning;
int16_t numofDevices;

View File

@@ -270,6 +270,7 @@ const char *optionsString = "T:D:d:M:B:P:O:A:C:G:L:Qp:";
int16_t gain = 20;
bool autogain = false;
bool rf_bias = false;
int16_t ppmOffset = 0;
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:p:";
#elif HAVE_RTLSDR
int16_t gain = 50;

View File

@@ -59,7 +59,7 @@ void tcpServer::run (int port) {
* 6. Receive Data.
* 7. Close Connection.
*/
int socket_desc , client_sock , c , read_size;
int socket_desc , client_sock , c;
struct sockaddr_in server , client;
//Create socket

View File

@@ -269,7 +269,6 @@ int32_t basePort = 1234; // default
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Qp:H:I";
#endif
std::string soundChannel = "default";
int16_t latency = 10;
int16_t timeSyncTime = 5;
int16_t freqSyncTime = 5;
int theDuration = -1; // default, infinite
@@ -277,7 +276,6 @@ int opt;
struct sigaction sigact;
bandHandler dabBand;
deviceHandler *theDevice;
bool err;
fprintf (stderr, "dab_cmdline example III,\n \
Copyright 2017 J van Katwijk, Lazy Chair Computing\n");
@@ -495,7 +493,7 @@ bool err;
autogain);
#elif HAVE_HACKRF
theDevice = new hackrfHandler (frequency,
ppmCorrection,
ppmOffset,
lnaGain,
vgaGain);
#elif HAVE_LIME
@@ -585,8 +583,11 @@ bool err;
}
run. store (true);
if (serviceIdentifier != -1)
programName = dab_getserviceName (theRadio, serviceIdentifier);
if (serviceIdentifier != -1) {
char temp [255];
dab_getserviceName (theRadio, serviceIdentifier, temp);
programName = std::string (temp);
}
std::cerr << "we try to start program " <<
programName << "\n";

View File

@@ -243,14 +243,12 @@ int32_t basePort = 1234; // default
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Qp:H:I";
#endif
std::string soundChannel = "default";
int16_t latency = 10;
int16_t timeSyncTime = 5;
int16_t freqSyncTime = 5;
int opt;
struct sigaction sigact;
bandHandler dabBand;
deviceHandler *theDevice;
bool err;
int theDuration = -1; // infinite
std::cerr << "dab_cmdline example IV,\n \
@@ -542,8 +540,11 @@ int theDuration = -1; // infinite
}
run. store (true);
if (serviceIdentifier != -1)
programName = dab_getserviceName (theRadio, serviceIdentifier);
if (serviceIdentifier != -1) {
char temp [255];
dab_getserviceName (theRadio, serviceIdentifier, temp);
programName = std::string (temp);
}
std::cerr << "we try to start program " <<
programName << "\n";

View File

@@ -59,7 +59,7 @@ void tcpServer::run (int port) {
* 6. Receive Data.
* 7. Close Connection.
*/
int socket_desc , client_sock , c , read_size;
int socket_desc , client_sock , c;
struct sockaddr_in server , client;
//Create socket

View File

@@ -49,7 +49,6 @@ const char *outputChannelwithRate (int16_t, int32_t);
void audioOutput (float *, int32_t);
int32_t CardRate;
int16_t latency;
int32_t size;
bool portAudio;
bool writerRunning;
int16_t numofDevices;

View File

@@ -59,7 +59,7 @@ void tcpServer::run (int port) {
* 6. Receive Data.
* 7. Close Connection.
*/
int socket_desc , client_sock , c , read_size;
int socket_desc , client_sock , c;
struct sockaddr_in server , client;
//Create socket

View File

@@ -49,7 +49,6 @@ const char *outputChannelwithRate (int16_t, int32_t);
void audioOutput (float *, int32_t);
int32_t CardRate;
int16_t latency;
int32_t size;
bool portAudio;
bool writerRunning;
int16_t numofDevices;

View File

@@ -52,7 +52,6 @@ private:
std::atomic<bool> connected;
int socket_desc;
struct sockaddr_in server;
bool isReady;
std::mutex mutex;
std::condition_variable condvar;
std::queue<uint8_t *> messageQ;

View File

@@ -49,7 +49,6 @@ const char *outputChannelwithRate (int16_t, int32_t);
void audioOutput (float *, int32_t);
int32_t CardRate;
int16_t latency;
int32_t size;
bool portAudio;
bool writerRunning;
int16_t numofDevices;

View File

@@ -114,7 +114,9 @@ int32_t dab_getSId (void *Handle, const char* c_s) {
return ((dabProcessor *)Handle) -> get_SId (s);
}
std::string dab_getserviceName (void *Handle, int32_t SId) {
return ((dabProcessor *)Handle) -> get_serviceName (SId);
void dab_getserviceName (void *Handle, int32_t SId, char *out) {
std::string s = ((dabProcessor *)Handle) -> get_serviceName (SId);
const char * t = s. c_str ();
(void)strcpy (out, t);
}

View File

@@ -76,7 +76,6 @@ private:
protection *protectionHandler;
backendBase *our_backendBase;
RingBuffer<int16_t> *Buffer;
};
#endif

View File

@@ -40,13 +40,10 @@ typedef struct {
class faadDecoder {
private:
bool processorOK;
bool aacInitialized;
uint32_t aacCap;
NeAACDecHandle aacHandle;
NeAACDecConfigurationPtr aacConf;
NeAACDecFrameInfo hInfo;
bool isStereo;
int32_t baudRate;
void *userData;
audioOut_t soundOut;

View File

@@ -51,7 +51,6 @@ public:
private:
bool processSuperframe (uint8_t [], int16_t);
audioOut_t soundOut;
dataOut_t dataOut;
programQuality_t mscQuality;
void *ctx;
padHandler my_padHandler;
@@ -66,13 +65,11 @@ private:
int16_t superFramesize;
int16_t blockFillIndex;
int16_t blocksInBuffer;
int16_t blockCount;
int16_t bitRate;
std::vector<uint8_t> frameBytes;
std::vector<uint8_t> outVector;
int16_t RSDims;
int16_t au_start [10];
int32_t baudRate;
firecode_checker fc;
reedSolomon my_rsDecoder;
@@ -90,7 +87,6 @@ private:
int16_t rs_quality;
int16_t aac_quality;
int16_t charSet;
void show_frameErrors (int);
void show_rsErrors (int);
void show_aacErrors (int);

View File

@@ -47,19 +47,13 @@ public:
void stopRunning (void);
void start (void);
private:
uint8_t DSCTy;
int16_t fragmentSize;
int16_t bitRate;
bool shortForm;
int16_t protLevel;
uint8_t DGflag;
int16_t FEC_scheme;
bool show_crcErrors;
int16_t crcErrors;
void run (void);
std::atomic<bool> running;
std::thread threadHandle;
int16_t interleaverIndex;
int16_t countforInterleaver;
std::vector<uint8_t> outV;
std::vector<int16_t> tempX;

View File

@@ -50,7 +50,6 @@ private:
bytesOut_t bytesOut;
void *ctx;
int16_t crcErrors;
int16_t handledPackets;
std::vector<uint8_t> series;
uint8_t packetState;
//

View File

@@ -79,16 +79,12 @@ virtual void run (void);
std::thread threadHandle;
std::vector<complex<float> > phaseReference;
bool audioService;
std::mutex mutexer;
std::vector<virtualBackend *>theBackends;
// std::vector<int16_t> cifVector;
int16_t cifCount;
int16_t blkCount;
std::atomic<bool> work_to_do;
int16_t BitsperBlock;
int16_t numberofblocksperCIF;
int16_t blockCount;
};
#endif

View File

@@ -86,7 +86,6 @@ private:
int16_t ficBlocks;
int16_t ficMissed;
int16_t ficRatio;
uint16_t convState;
mutex fibProtector;
uint8_t PRBS [768];
uint8_t shiftRegister [9];

View File

@@ -43,7 +43,6 @@ private:
dabParams params;
int32_t T_u;
int32_t T_g;
int16_t threshold;
int16_t diff_length;
int16_t shiftFactor;
fft_handler my_fftHandler;

View File

@@ -59,7 +59,6 @@ private:
int32_t bufferSize;
int32_t currentPhase;
std::atomic<bool> running;
int32_t bufferContent;
float sLevel;
int32_t sampleCount;
int32_t corrector;

View File

@@ -303,7 +303,7 @@ struct quantizer_spec* mp2Processor::read_allocation(int sb, int b2_table) {
void mp2Processor::read_samples (struct quantizer_spec *q,
int scalefactor, int *sample) {
int idx, adj, scale;
register int val;
int val;
if (!q) {
// no bits allocated for this subband
@@ -601,12 +601,12 @@ int16_t vLength = 24 * bitRate / 8;
if (MP2Header_OK == 2) {
addbittoMP2 (MP2frame, v [i], MP2bitCount ++);
if (MP2bitCount >= lf) {
bool stereo;
int16_t sample_buf [KJMP2_SAMPLES_PER_FRAME * 2];
#ifdef AAC_OUT
soundOut ((int16_t *)(&MP2frame [0]), MP2bitCount,
0, false, nullptr);
#else
int16_t sample_buf [KJMP2_SAMPLES_PER_FRAME * 2];
bool stereo;
if (mp2decodeFrame (MP2frame, sample_buf, &stereo)) {
output (sample_buf,
2 * (int32_t)KJMP2_SAMPLES_PER_FRAME,

View File

@@ -68,10 +68,10 @@ int galois::modnn (int x){
delete [] index_of;
}
static inline
uint16_t round_mod (int16_t a, int16_t n) {
return (a % n < 0) ? (a % n + n) : (a % n);
}
//static inline
//uint16_t round_mod (int16_t a, int16_t n) {
// return (a % n < 0) ? (a % n + n) : (a % n);
//}
uint16_t galois::add_poly (uint16_t a, uint16_t b) {
return a ^ b;

View File

@@ -64,7 +64,6 @@ static int blocksperCIF [] = {18, 72, 0, 36};
// cifVector. resize (55296);
cifCount = 0; // msc blocks in CIF
blkCount = 0;
theBackends. push_back (new virtualBackend (0, 0));
BitsperBlock = 2 * params. get_carriers ();
numberofblocksperCIF = blocksperCIF [(dabMode - 1) & 03];
@@ -214,7 +213,6 @@ int16_t currentblk;
return;
// OK, now we have a full CIF
mutexer. lock ();
blkCount = 0;
cifCount = (cifCount + 1) & 03;
for (auto const& b: theBackends) {
int startAddr = b -> startAddr ();

View File

@@ -40,7 +40,6 @@ int32_t i;
float Phi_k;
this -> T_u = params. get_T_u ();
this -> T_g = params. get_T_g ();
this -> threshold = threshold;
this -> diff_length = diff_length;
refTable. resize (T_u);
phaseDifferences. resize (diff_length);

View File

@@ -25,14 +25,6 @@
#include "device-handler.h"
#include "dab-processor.h"
static inline
int16_t valueFor (int16_t b) {
int16_t res = 1;
while (--b > 0)
res <<= 1;
return res;
}
static
std::complex<float> oscillatorTable [INPUT_RATE];

View File

@@ -35,7 +35,8 @@
protection (bitRate, protLevel) {
int16_t i, j;
int16_t viterbiCounter = 0;
int16_t L1, L2;
int16_t L1 = 0,
L2 = 0;
int8_t *PI1, *PI2, *PI_X;
if ((protLevel & (1 << 2)) == 0) { // set A profiles