Replace NULL by nullptr

This commit is contained in:
Bertrand Songis
2019-08-28 10:28:11 +02:00
parent c8482905a0
commit e7736f3fdc
28 changed files with 66 additions and 85 deletions
@@ -14,7 +14,6 @@ option(DSM2 "DSM2 TX Module" ON)
option(SBUS "SBUS TX Module" ON)
option(CROSSFIRE "Crossfire TX Module" ON)
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" ON)
option(MULTI_SPORT "SPORT telemetry support" OFF)
option(SUPPORT_D16_EU_ONLY "XJT module only supports D16-EU and LR12-EU" OFF) # TODO rename to XJT_EU_ONLY
option(DEBUG_INTERRUPTS "Count interrupts" OFF)
option(DEBUG_LATENCY "Debug latency" OFF)
@@ -152,10 +151,6 @@ if(MULTIMODULE)
set(SRC ${SRC} pulses/multi.cpp telemetry/spektrum.cpp telemetry/flysky_ibus.cpp telemetry/multi.cpp)
endif()
if(MULTI_SPORT)
add_definitions(-DMULTI_SPORT)
endif()
if(CROSSFIRE)
add_definitions(-DCROSSFIRE)
set(PULSES_SRC
+3 -3
View File
@@ -378,7 +378,7 @@ void audioInit()
audioSendRiffHeader();
}
uint8_t * currentBuffer = NULL;
uint8_t * currentBuffer = nullptr;
uint32_t currentSize = 0;
int16_t newVolume = -1;
@@ -389,7 +389,7 @@ void audioSetCurrentBuffer(const AudioBuffer * buffer)
currentSize = buffer->size * 2;
}
else {
currentBuffer = NULL;
currentBuffer = nullptr;
currentSize = 0;
}
}
@@ -413,7 +413,7 @@ void audioConsumeCurrentBuffer()
currentSize -= written;
if (currentSize == 0) {
audioQueue.buffersFifo.freeNextFilledBuffer();
currentBuffer = NULL;
currentBuffer = nullptr;
currentSize = 0;
}
}
+1 -1
View File
@@ -365,7 +365,7 @@ void sdDone()
#if defined(LOG_TELEMETRY)
f_close(&g_telemetryFile);
#endif
f_mount(NULL, "", 0); // unmount SD
f_mount(nullptr, "", 0); // unmount SD
}
}
#endif
+2 -2
View File
@@ -52,7 +52,7 @@ void firmwareTraceCb(const char * text)
OpenTxSimulator::OpenTxSimulator() :
SimulatorInterface(),
m_timer10ms(NULL),
m_timer10ms(nullptr),
m_resetOutputsData(true),
m_stopRequested(false)
{
@@ -62,7 +62,7 @@ OpenTxSimulator::OpenTxSimulator() :
OpenTxSimulator::~OpenTxSimulator()
{
traceCallback = NULL;
traceCallback = nullptr;
tracebackDevices.clear();
if (m_timer10ms)
+1 -1
View File
@@ -51,7 +51,7 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface
public slots:
virtual void init();
virtual void start(const char * filename = NULL, bool tests = true);
virtual void start(const char * filename = nullptr, bool tests = true);
virtual void stop();
virtual void setSdPath(const QString & sdPath = "", const QString & settingsPath = "");
virtual void setVolumeGain(const int value);
+4 -4
View File
@@ -220,8 +220,8 @@ void StopSimu()
simu_shutdown = true;
pthread_join(mixerTaskId, NULL);
pthread_join(menusTaskId, NULL);
pthread_join(mixerTaskId, nullptr);
pthread_join(menusTaskId, nullptr);
simu_running = false;
}
@@ -348,7 +348,7 @@ void * audioThread(void *)
wanted.channels = 1; /* 1 = mono, 2 = stereo */
wanted.samples = AUDIO_BUFFER_SIZE*2; /* Good low-latency value for callback */
wanted.callback = fillAudioBuffer;
wanted.userdata = NULL;
wanted.userdata = nullptr;
/*
SDL_OpenAudio() internally calls SDL_InitSubSystem(SDL_INIT_AUDIO),
@@ -390,7 +390,7 @@ void StartAudioThread(int volumeGain)
void StopAudioThread()
{
simuAudio.threadRunning = false;
pthread_join(simuAudio.threadPid, NULL);
pthread_join(simuAudio.threadPid, nullptr);
}
#endif // #if defined(SIMU_AUDIO)
+3 -3
View File
@@ -361,7 +361,7 @@ TCHAR * f_gets (TCHAR* buff, int len, FIL* fil)
{
if (fil && fil->obj.fs) {
buff = fgets(buff, len, (FILE*)fil->obj.fs);
if (buff != NULL) {
if (buff != nullptr) {
fil->fptr = *buff;
}
// TRACE_SIMPGMSPACE("fgets(%p) %u, %s", fil->obj.fs, len, buff);
@@ -396,7 +396,7 @@ FRESULT f_close (FIL * fil)
TRACE_SIMPGMSPACE("f_close(%p) (FIL:%p)", fil->obj.fs, fil);
if (fil->obj.fs) {
fclose((FILE*)fil->obj.fs);
fil->obj.fs = NULL;
fil->obj.fs = nullptr;
}
return FR_OK;
}
@@ -516,7 +516,7 @@ FRESULT f_rename(const TCHAR *oldname, const TCHAR *newname)
FRESULT f_utime(const TCHAR* path, const FILINFO* fno)
{
if (fno == NULL)
if (fno == nullptr)
return FR_INVALID_PARAMETER;
std::string simpath = convertToSimuPath(path);
+1 -1
View File
@@ -1013,7 +1013,7 @@ void sdDone()
{
if (sdMounted()) {
audioQueue.stopSD();
f_mount(NULL, "", 0); // unmount SD
f_mount(nullptr, "", 0); // unmount SD
}
}
+1 -1
View File
@@ -171,7 +171,7 @@ void usbMassStorage()
Card_state = SD_ST_DATA;
audioQueue.stopSD();
logsClose();
f_mount(NULL, "", 0); // unmount SD
f_mount(nullptr, "", 0); // unmount SD
}
if (!initialized) {