summaryrefslogtreecommitdiffstats
path: root/src/dabInputFifo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dabInputFifo.cpp')
-rw-r--r--src/dabInputFifo.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/dabInputFifo.cpp b/src/dabInputFifo.cpp
index 3e35c20..6fa3aad 100644
--- a/src/dabInputFifo.cpp
+++ b/src/dabInputFifo.cpp
@@ -1,6 +1,11 @@
/*
Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://www.opendigitalradio.org
*/
/*
This file is part of ODR-DabMux.
@@ -61,9 +66,9 @@ int dabInputFifoInit(void** args)
data->curSize = 0;
data->head = 0;
data->tail = 0;
- data->buffer = NULL;
- data->packetData = NULL;
- data->enhancedPacketData = NULL;
+ data->buffer = nullptr;
+ data->packetData = nullptr;
+ data->enhancedPacketData = nullptr;
data->packetLength = 0;
data->enhancedPacketLength = 0;
data->enhancedPacketWaiting = 0;
@@ -145,7 +150,7 @@ int dabInputFifoOpen(void* args, const char* filename)
return -1;
}
#else
- if (pthread_create(&data->thread, NULL, dabInputFifoThread, data)) {
+ if (pthread_create(&data->thread, nullptr, dabInputFifoThread, data)) {
perror("Can't create FIFO child");
return -1;
}
@@ -166,7 +171,7 @@ int dabInputFifoSetbuf(void* args, int size)
sem_wait(&data->semBuffer);
#endif
}
- if (data->buffer != NULL) {
+ if (data->buffer != nullptr) {
delete data->buffer;
}
if (size == 0) {
@@ -367,7 +372,7 @@ int dabInputFifoClean(void** args)
}
#else
if (data->thread != (pthread_t)NULL) {
- if (pthread_join(data->thread, NULL)) {
+ if (pthread_join(data->thread, nullptr)) {
etiLog.log(debug, "ERROR: FIFO child thread had not exit normally\n");
}
}
@@ -382,12 +387,12 @@ int dabInputFifoClean(void** args)
sem_destroy(&data->semFull);
sem_destroy(&data->semBuffer);
#endif
- if (data->packetData != NULL) {
+ if (data->packetData != nullptr) {
delete[] data->packetData;
}
- if (data->enhancedPacketData != NULL) {
+ if (data->enhancedPacketData != nullptr) {
for (int i = 0; i < 12; ++i) {
- if (data->enhancedPacketData[i] != NULL) {
+ if (data->enhancedPacketData[i] != nullptr) {
delete[] data->enhancedPacketData[i];
}
}
@@ -505,7 +510,7 @@ void* dabInputFifoThread(void* args)
sem_post(&data->semBuffer);
#endif
}
- return NULL;
+ return nullptr;
}