Browse Source

Merge branch 'master' into trac2122_2

Mukund Sivaraman 12 years ago
parent
commit
03f0b4d031

+ 2 - 1
src/lib/dns/messagerenderer.cc

@@ -364,7 +364,8 @@ MessageRenderer::writeName(const LabelSequence& ls, const bool compress) {
 
 void
 MessageRenderer::writeName(const Name& name, const bool compress) {
-    writeName(LabelSequence(name), compress);
+    const LabelSequence ls(name);
+    writeName(ls, compress);
 }
 
 AbstractMessageRenderer::AbstractMessageRenderer() :

+ 2 - 1
src/lib/dns/name.cc

@@ -435,7 +435,8 @@ Name::toText(bool omit_final_dot) const {
 
 NameComparisonResult
 Name::compare(const Name& other) const {
-    return LabelSequence(*this).compare(LabelSequence(other));
+    LabelSequence ls(*this);
+    return (ls.compare(LabelSequence(other)));
 }
 
 bool

+ 2 - 1
src/lib/util/tests/memory_segment_local_unittest.cc

@@ -16,6 +16,7 @@
 #include <exceptions/exceptions.h>
 #include <gtest/gtest.h>
 #include <memory>
+#include <limits.h>
 
 using namespace std;
 using namespace isc::util;
@@ -56,7 +57,7 @@ TEST(MemorySegmentLocal, TestLocal) {
 TEST(MemorySegmentLocal, TestTooMuchMemory) {
     auto_ptr<MemorySegment> segment(new MemorySegmentLocal());
 
-    EXPECT_THROW(segment->allocate(0x7fffffffffffffff), bad_alloc);
+    EXPECT_THROW(segment->allocate(ULONG_MAX), bad_alloc);
 }
 
 TEST(MemorySegmentLocal, TestBadDeallocate) {