Fixing usages of ptr_lib::shared_ptr
In certain cases, importing both std:: and ndn::ptr_lib namespaces
causes ambiguity for shared_ptr type.
Change-Id: Iddc02353e1615b2387277c56185a1dd873d54459
diff --git a/src/name.cpp b/src/name.cpp
index 640fdeb..728f29e 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -12,7 +12,6 @@
#include "c/name.h"
using namespace std;
-using namespace ndn::ptr_lib;
namespace ndn {
@@ -128,7 +127,7 @@
Name::Component
Name::Component::fromNumber(uint64_t number)
{
- shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
+ ptr_lib::shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
// First encode in little endian.
while (number != 0) {
@@ -144,7 +143,7 @@
Name::Component
Name::Component::fromNumberWithMarker(uint64_t number, uint8_t marker)
{
- shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
+ ptr_lib::shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
// Add the leading marker.
value->push_back(marker);
@@ -382,9 +381,9 @@
for (size_t i = 0; i < value.size(); ++i) {
uint8_t x = value[i];
// Check for 0-9, A-Z, a-z, (+), (-), (.), (_)
- if (x >= 0x30 && x <= 0x39 || x >= 0x41 && x <= 0x5a ||
- x >= 0x61 && x <= 0x7a || x == 0x2b || x == 0x2d ||
- x == 0x2e || x == 0x5f)
+ if ((x >= 0x30 && x <= 0x39) || (x >= 0x41 && x <= 0x5a) ||
+ (x >= 0x61 && x <= 0x7a) || x == 0x2b || x == 0x2d ||
+ x == 0x2e || x == 0x5f)
result << x;
else {
result << '%';