From 49626033d86140b76aa9ea582543e71bec81835d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sun, 9 Oct 2016 21:06:44 -0400 Subject: [PATCH 1/3] warnings: Add parentheses around expressions [-Wparentheses] --- src/audio/audio_device.cpp | 2 +- src/parser/response.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index dd61e8db..6d1e298c 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -309,7 +309,7 @@ void t_oss_io::enable(bool enable_playback, bool enable_recording) { void t_oss_io::flush(bool playback_buffer, bool recording_buffer) { for (int i = 0; i < 2; i++) { // i == 0: flush playback buffer, 1: flush recording buffer - if (i == 0 && playback_buffer || i == 1 && recording_buffer) { + if ((i == 0 && playback_buffer) || (i == 1 && recording_buffer)) { int skip_bytes = ( (i==0) ? play_buffersize : rec_buffersize) - get_buffer_space(i == 1); if(skip_bytes <= 0) continue; diff --git a/src/parser/response.cpp b/src/parser/response.cpp index 0844fe43..49d9b55d 100644 --- a/src/parser/response.cpp +++ b/src/parser/response.cpp @@ -207,10 +207,10 @@ bool t_response::is_valid(bool &fatal, string &reason) const { } bool t_response::must_authenticate(void) const { - return (code == R_401_UNAUTHORIZED && - hdr_www_authenticate.is_populated() || - code == R_407_PROXY_AUTH_REQUIRED && - hdr_proxy_authenticate.is_populated()); + return ((code == R_401_UNAUTHORIZED && + hdr_www_authenticate.is_populated()) || + (code == R_407_PROXY_AUTH_REQUIRED && + hdr_proxy_authenticate.is_populated())); } void t_response::get_destination(t_ip_port &ip_port) const { From aac05833f2054684846584a930666f35fe0eb344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sun, 9 Oct 2016 21:07:13 -0400 Subject: [PATCH 2/3] warnings: Add braces around nested if() statement [-Wdangling-else] --- src/audio/g72x.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio/g72x.cpp b/src/audio/g72x.cpp index 40d14305..2f6f99f6 100644 --- a/src/audio/g72x.cpp +++ b/src/audio/g72x.cpp @@ -369,11 +369,12 @@ update( /* UPA1 */ /* update predictor pole a[0] */ state_ptr->a[0] -= state_ptr->a[0] >> 8; - if (dqsez != 0) + if (dqsez != 0) { if (pks1 == 0) state_ptr->a[0] += 192; else state_ptr->a[0] -= 192; + } /* LIMD */ a1ul = 15360 - a2p; From 9ec79df2585670d853a045a4ccb0001c88314340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sat, 22 Oct 2022 21:33:13 -0400 Subject: [PATCH 3/3] warnings: Silence warning about unhandled enum values [-Wswitch] --- src/dialog.cpp | 3 +++ src/parser/hdr_session_expires.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/dialog.cpp b/src/dialog.cpp index c61d6b0d..84a4b290 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -3919,6 +3919,9 @@ void t_dialog::timeout(t_line_timer timer) { case LTMR_SESSION_REFRESH: case LTMR_SESSION_EXPIRE: return timeout_session_refresh(timer); + default: + // We're not dealing with a session timer, so carry on as usual + break; } switch(state) { diff --git a/src/parser/hdr_session_expires.cpp b/src/parser/hdr_session_expires.cpp index 1c2b683c..6758e11c 100644 --- a/src/parser/hdr_session_expires.cpp +++ b/src/parser/hdr_session_expires.cpp @@ -75,6 +75,9 @@ string t_hdr_session_expires::encode_value(void) const { case REFRESHER_UAC: refresher_str = SE_REFRESHER_UAC; break; + case REFRESHER_NONE: + // Leave refresher_str empty + break; } if (!refresher_str.empty()) { t_parameter r("refresher", refresher_str);