From 63fba49d961f4411eb52a5130413292b21e07bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Fri, 20 Nov 2015 15:36:48 +0100 Subject: [PATCH] Fixed some initialization issues reported by Cppcheck. --- src/SFML/Audio/SoundFileReaderFlac.cpp | 3 ++- src/SFML/Audio/SoundRecorder.cpp | 6 +++--- src/SFML/Audio/SoundStream.cpp | 4 +++- src/SFML/Graphics/RenderTextureImplFBO.cpp | 1 + src/SFML/Window/Unix/GlxContext.cpp | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/SFML/Audio/SoundFileReaderFlac.cpp b/src/SFML/Audio/SoundFileReaderFlac.cpp index 646b0312..ba91b412 100644 --- a/src/SFML/Audio/SoundFileReaderFlac.cpp +++ b/src/SFML/Audio/SoundFileReaderFlac.cpp @@ -209,7 +209,8 @@ bool SoundFileReaderFlac::check(InputStream& stream) //////////////////////////////////////////////////////////// SoundFileReaderFlac::SoundFileReaderFlac() : -m_decoder(NULL) +m_decoder(NULL), +m_clientData() { } diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp index f051b963..4d796e4a 100644 --- a/src/SFML/Audio/SoundRecorder.cpp +++ b/src/SFML/Audio/SoundRecorder.cpp @@ -49,10 +49,10 @@ SoundRecorder::SoundRecorder() : m_thread (&SoundRecorder::record, this), m_sampleRate (0), m_processingInterval(milliseconds(100)), -m_isCapturing (false) +m_isCapturing (false), +m_deviceName (getDefaultDevice()) { - // Set the device name to the default device - m_deviceName = getDefaultDevice(); + } diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 81977fd9..00258ccf 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -45,11 +45,13 @@ m_thread (&SoundStream::streamData, this), m_threadMutex (), m_threadStartState(Stopped), m_isStreaming (false), +m_buffers (), m_channelCount (0), m_sampleRate (0), m_format (0), m_loop (false), -m_samplesProcessed(0) +m_samplesProcessed(0), +m_endBuffers () { } diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp index 20ff12c0..94771690 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.cpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp @@ -37,6 +37,7 @@ namespace priv { //////////////////////////////////////////////////////////// RenderTextureImplFBO::RenderTextureImplFBO() : +m_context (NULL), m_frameBuffer(0), m_depthBuffer(0) { diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp index 5a28b167..28955644 100644 --- a/src/SFML/Window/Unix/GlxContext.cpp +++ b/src/SFML/Window/Unix/GlxContext.cpp @@ -54,8 +54,8 @@ namespace public: GlxErrorHandler(::Display* display) : - m_display(display), - m_lock (glxErrorMutex) + m_lock (glxErrorMutex), + m_display(display) { glxErrorOccurred = false; m_previousHandler = XSetErrorHandler(HandleXError);