Bug 1005784 - Fix -Wuninitialized warnings in webrtc/modules/audio_device/linux/. r=jesup

This commit is contained in:
Chris Peterson 2014-05-05 23:38:04 -07:00
parent ede204a24f
commit 9bc8912ff4
2 changed files with 8 additions and 6 deletions

View File

@ -2369,18 +2369,16 @@ bool AudioDeviceLinuxALSA::RecThreadProcess()
bool AudioDeviceLinuxALSA::KeyPressed() const{
#ifdef USE_X11
char szKey[32];
unsigned int i = 0;
char state = 0;
#ifdef USE_X11
if (!_XDisplay)
return false;
// Check key map status
XQueryKeymap(_XDisplay, szKey);
#endif
// A bit change in keymap means a key is pressed
for (i = 0; i < sizeof(szKey); i++)
@ -2389,5 +2387,8 @@ bool AudioDeviceLinuxALSA::KeyPressed() const{
// Save old state
memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState));
return (state != 0);
#else
return false;
#endif
}
} // namespace webrtc

View File

@ -3114,18 +3114,16 @@ bool AudioDeviceLinuxPulse::RecThreadProcess()
}
bool AudioDeviceLinuxPulse::KeyPressed() const{
#ifdef USE_X11
char szKey[32];
unsigned int i = 0;
char state = 0;
#ifdef USE_X11
if (!_XDisplay)
return false;
// Check key map status
XQueryKeymap(_XDisplay, szKey);
#endif
// A bit change in keymap means a key is pressed
for (i = 0; i < sizeof(szKey); i++)
@ -3134,5 +3132,8 @@ bool AudioDeviceLinuxPulse::KeyPressed() const{
// Save old state
memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState));
return (state != 0);
#else
return false;
#endif
}
}