[Spice-devel] [PATCH 15/24] mingw32 build: remove unused, initialize uninitialized, reorder constructor initializers

Alon Levy alevy at redhat.com
Tue Dec 7 13:28:14 PST 2010


---
 client/controller.cpp       |    2 ++
 client/windows/platform.cpp |    8 ++++----
 client/windows/playback.cpp |    3 +--
 client/windows/record.cpp   |    2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/client/controller.cpp b/client/controller.cpp
index cf06aa3..329c133 100644
--- a/client/controller.cpp
+++ b/client/controller.cpp
@@ -347,7 +347,9 @@ bool ControllerConnection::handle_message(ControllerMsg *hdr)
 bool ControllerConnection::create_menu(char* resource)
 {
     bool ret = true;
+#ifndef WIN32
     char* item_state = 0;
+#endif
     char* next_item;
     const char* param;
     const char* text;
diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
index 3e556fa..3eb2cf6 100644
--- a/client/windows/platform.cpp
+++ b/client/windows/platform.cpp
@@ -461,10 +461,10 @@ bool WinMonitor::best_display_setting(uint32_t width, uint32_t height, uint32_t
     DEVMODE mode;
     DWORD mode_id = 0;
     uint32_t mod_waste = ~0;
-    DWORD mod_width;
-    DWORD mod_height;
-    DWORD mod_depth;
-    DWORD mod_frequency;
+    DWORD mod_width = 0;
+    DWORD mod_height = 0;
+    DWORD mod_depth = 0;
+    DWORD mod_frequency = 0;
 
     mode.dmSize = sizeof(DEVMODE);
     mode.dmDriverExtra = 0;
diff --git a/client/windows/playback.cpp b/client/windows/playback.cpp
index 17d8f56..5278288 100644
--- a/client/windows/playback.cpp
+++ b/client/windows/playback.cpp
@@ -44,14 +44,13 @@ WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint3
     info.nAvgBytesPerSec = sampels_per_sec * info.nBlockAlign;
     info.wBitsPerSample = bits_per_sample;
 
-    if (waveOutOpen(&_wave_out, WAVE_MAPPER, &info, NULL, NULL, CALLBACK_NULL)
+    if (waveOutOpen(&_wave_out, WAVE_MAPPER, &info, 0, 0, CALLBACK_NULL)
                                                             != MMSYSERR_NOERROR) {
         throw Exception("can not open playback device");
     }
 
     int frame_size = WavePlaybackAbstract::FRAME_SIZE;
     _ring_size = (sampels_per_sec * RING_SIZE_MS / 1000) / frame_size;
-    int low_mark = (sampels_per_sec * LOW_MARK_MS / 1000) / frame_size;
     _start_mark = (sampels_per_sec * START_MARK_MS / 1000) / frame_size;
     _frame_bytes = frame_size * channels * bits_per_sample / 8;
     _ring_item_size = sizeof(WAVEHDR) + _frame_bytes + sample_bytes;
diff --git a/client/windows/record.cpp b/client/windows/record.cpp
index 4edc787..398b165 100644
--- a/client/windows/record.cpp
+++ b/client/windows/record.cpp
@@ -33,9 +33,9 @@ WaveRecorder::WaveRecorder(Platform::RecordClient& client, uint32_t sampels_per_
                            uint32_t bits_per_sample, uint32_t channels)
     : _client (client)
     , _ring (NULL)
-    , _frame (NULL)
     , _head (0)
     , _in_use (0)
+    , _frame (NULL)
 {
     WAVEFORMATEX info;
     uint32_t frame_align;
-- 
1.7.3.2



More information about the Spice-devel mailing list