Follow-up: Fix clang static analyzer warnings: Garbage return value
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2018 02:12:26 +0000 (02:12 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2018 02:12:26 +0000 (02:12 +0000)
<https://webkit.org/b/187224>

Address review feedback from Eric Carlson.

* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::valueForCapabilityRange const):
- Use brace initialization for more local variables.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233406 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/MediaConstraints.h

index f61a602..5bd3938 100644 (file)
@@ -1,3 +1,14 @@
+2018-06-30  David Kilzer  <ddkilzer@apple.com>
+
+        Follow-up: Fix clang static analyzer warnings: Garbage return value
+        <https://webkit.org/b/187224>
+
+        Address review feedback from Eric Carlson.
+
+        * platform/mediastream/MediaConstraints.h:
+        (WebCore::NumericConstraint::valueForCapabilityRange const):
+        - Use brace initialization for more local variables.
+
 2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Asan false positive: stack use after scope under WebCore::ApplyPropertyBorderImageModifier in WebCore::Length::Length(WebCore::Length&&)
index da962cf..056fc7e 100644 (file)
@@ -241,8 +241,8 @@ public:
     ValueType valueForCapabilityRange(ValueType current, ValueType capabilityMin, ValueType capabilityMax) const
     {
         ValueType value { 0 };
-        ValueType min = capabilityMin;
-        ValueType max = capabilityMax;
+        ValueType min { capabilityMin };
+        ValueType max { capabilityMax };
 
         if (m_exact) {
             ASSERT(validForRange(capabilityMin, capabilityMax));