Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/bobaddress.h b/bobaddress.h
- index dc8c29b..22c6c33 100644
- --- a/bobaddress.h
- +++ b/bobaddress.h
- @@ -3,8 +3,6 @@
- #include <boost/dynamic_bitset.hpp>
- -#include "libipvx.h"
- -
- namespace libipvx
- {
- class BobAddress
- @@ -13,7 +11,7 @@ namespace libipvx
- BobAddress(const int _bitsetLength);
- BobAddress(const int _bitsetLength, const unsigned long _addressLong);
- - private:
- + protected:
- boost::dynamic_bitset<> m_bitset;
- };
- }
- diff --git a/bobip4address.h b/bobip4address.h
- index 453083c..0d713e9 100644
- --- a/bobip4address.h
- +++ b/bobip4address.h
- @@ -1,7 +1,7 @@
- #ifndef BOBIP4ADDRESS_H
- #define BOBIP4ADDRESS_H
- -//#include "bobaddress.h"
- +#include "bobaddress.h"
- #include <boost/dynamic_bitset.hpp>
- diff --git a/bobsubnetmask.cpp b/bobsubnetmask.cpp
- index 0e26b60..57d9b33 100644
- --- a/bobsubnetmask.cpp
- +++ b/bobsubnetmask.cpp
- @@ -1,4 +1,4 @@
- -#include "bobaddress.h"
- +#include "bobsubnetmask.h"
- namespace libipvx
- {
- @@ -8,9 +8,8 @@ namespace libipvx
- }
- // Return the number of sequential 'on' bits.
- - size_t BobSubnetmaskGetBitLength() const
- + size_t BobSubnetmask::GetBitLength() const
- {
- - boost::dynamic_bitset<> _bitset = this->GetBitset();
- - return _bitset.count();
- + return m_bitset.count();
- }
- }
- diff --git a/libipvx.h b/libipvx.h
- index 2baedf4..82c1ae3 100644
- --- a/libipvx.h
- +++ b/libipvx.h
- @@ -62,5 +62,6 @@ namespace libipvx
- }
- #include "ip4address.h"
- +#include "ipvxsubnet.h"
- #endif
- diff --git a/makefile b/makefile
- index 2d4f23d..6a17204 100644
- --- a/makefile
- +++ b/makefile
- @@ -1,25 +1,19 @@
- CC=g++
- -CFLAGS=-Wall -std=c++0x
- +CFLAGS=-Wall -O2 -std=c++0x
- -all: ip4tests_targ #ipvxsubnettests_targ
- +all: ip4tests ipvxsubnettests
- -ip4tests_targ: ip4tests.o ip4address.o
- - $(CC) $(CFLAGS) ip4tests.o ip4address.o -o ip4tests
- +libipvx.a: ip4address.o bobip4address.o bobaddress.o ip4subnetmask.o bobsubnetmask.o
- + $(AR) crs $@ $^
- -#ipvxsubnettests_targ: ipvxsubnettests.o
- -# $(CC) $(CFLAGS) ipvxsubnettests.o ip4address.o -o ipvxsubnettests
- +ip4tests: ip4tests.o libipvx.a
- + $(CC) $(CFLAGS) -o $@ $^
- -ip4tests.o: ip4tests.cpp
- - $(CC) -c $(CFLAGS) ip4tests.cpp -o ip4tests.o
- -
- -ip4address.o: ip4address.cpp
- - $(CC) -c $(CFLAGS) ip4address.cpp -o ip4address.o
- -
- -#ipvxsubnettests.o: ipvxsubnettests.cpp
- -# $(CC) -c $(CFLAGS) ipvxsubnettests.cpp -o ipvxsubnettests.o
- +ipvxsubnettests: ipvxsubnettests.o libipvx.a
- + $(CC) $(CFLAGS) -o $@ $^
- clean:
- - rm -rf *.o ip4tests
- + rm -f *.o *.a ip4tests ipvxsubnettests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement