Browse Source

[master] Cast mismatched enums

Francis Dupont 7 years ago
parent
commit
372c3a94c7
1 changed files with 9 additions and 3 deletions
  1. 9 3
      src/lib/dhcp/option_vendor.cc

+ 9 - 3
src/lib/dhcp/option_vendor.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -14,12 +14,18 @@
 using namespace isc::dhcp;
 
 OptionVendor::OptionVendor(Option::Universe u, const uint32_t vendor_id)
-    :Option(u, u==Option::V4?DHO_VIVSO_SUBOPTIONS:D6O_VENDOR_OPTS), vendor_id_(vendor_id) {
+    : Option(u, u == Option::V4 ?
+             static_cast<uint16_t>(DHO_VIVSO_SUBOPTIONS) :
+             static_cast<uint16_t>(D6O_VENDOR_OPTS)),
+      vendor_id_(vendor_id) {
 }
 
 OptionVendor::OptionVendor(Option::Universe u, OptionBufferConstIter begin,
                            OptionBufferConstIter end)
-    :Option(u, u==Option::V4?DHO_VIVSO_SUBOPTIONS:D6O_VENDOR_OPTS), vendor_id_(0) {
+    : Option(u, u == Option::V4?
+             static_cast<uint16_t>(DHO_VIVSO_SUBOPTIONS) :
+             static_cast<uint16_t>(D6O_VENDOR_OPTS)),
+      vendor_id_(0) {
     unpack(begin, end);
 }