Add element construction/destruction hooks to IndexedMemPool
[folly.git] / folly / MacAddress.cpp
index 6368483fa6cb4723b15d7811397561bf5475a7de..c182999c97bdb102d41bc9b3833836ec371d579b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#include "MacAddress.h"
+#include <folly/MacAddress.h>
 
-#include "folly/Exception.h"
-#include "folly/IPAddressV6.h"
+#include <ostream>
+
+#include <folly/Exception.h>
+#include <folly/IPAddressV6.h>
 
 using std::invalid_argument;
 using std::string;
 
 namespace folly {
 
-const MacAddress MacAddress::BROADCAST{Endian::big(0xffffffffffffU)};
+const MacAddress MacAddress::BROADCAST{Endian::big(uint64_t(0xffffffffffffU))};
 const MacAddress MacAddress::ZERO;
 
 MacAddress::MacAddress(StringPiece str) {
@@ -126,7 +128,7 @@ void MacAddress::parse(StringPiece str) {
     }
 
     // Update parsed with the newly parsed byte
-    parsed[byteIndex] = ((upper << 4) | lower);
+    parsed[byteIndex] = uint8_t((upper << 4) | lower);
   }
 
   if (p != str.end()) {