summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-11-09 21:44:43 -0600
committerPatrick Williams <patrick@stwcx.xyz>2016-11-09 21:44:45 -0600
commitef52f03556e443672ad1bbecad07fb1549d01e30 (patch)
tree69aabad8d9ca90483614774d061b9b143bfd5b7c
parent6a07ddb302fb3e1677aede8ca24cfe0b09c2eeb4 (diff)
downloadphosphor-time-manager-ef52f03556e443672ad1bbecad07fb1549d01e30.tar.gz
phosphor-time-manager-ef52f03556e443672ad1bbecad07fb1549d01e30.zip
time-config: fix warning on no-effect conditional
operator<< (for iostream) has higher precidence than terinary operator. Therefore, 'cout << foo ? 1 : 2' would be evaluated as '(cout << foo) ? 1 : 2' which is always true. Add parens to ensure the correct evaluation order. Change-Id: I24ce991ec934c35ca2b244677cacb1a5a738ad76 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r--time-config.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/time-config.cpp b/time-config.cpp
index da54581..48bcbd4 100644
--- a/time-config.cpp
+++ b/time-config.cpp
@@ -528,7 +528,7 @@ int TimeConfig::modifyNtpSettings(const timeModes& newTimeMode)
else
{
std::cout << "SUCCESS. NTP setting is now: " <<
- (ntpChangeOp) ? "Enabled" : "Disabled";
+ ((ntpChangeOp) ? "Enabled" : "Disabled");
// TODO : https://github.com/openbmc/phosphor-time-manager/issues/1
if (ntpChangeOp)
OpenPOWER on IntegriCloud