Advertisement
eXFq7GJ1cC

Untitled

Jul 1st, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. diff --git a/bobaddress.h b/bobaddress.h
  2. index dc8c29b..22c6c33 100644
  3. --- a/bobaddress.h
  4. +++ b/bobaddress.h
  5. @@ -3,8 +3,6 @@
  6.  
  7. #include <boost/dynamic_bitset.hpp>
  8.  
  9. -#include "libipvx.h"
  10. -
  11. namespace libipvx
  12. {
  13. class BobAddress
  14. @@ -13,7 +11,7 @@ namespace libipvx
  15. BobAddress(const int _bitsetLength);
  16. BobAddress(const int _bitsetLength, const unsigned long _addressLong);
  17.  
  18. - private:
  19. + protected:
  20. boost::dynamic_bitset<> m_bitset;
  21. };
  22. }
  23. diff --git a/bobip4address.h b/bobip4address.h
  24. index 453083c..0d713e9 100644
  25. --- a/bobip4address.h
  26. +++ b/bobip4address.h
  27. @@ -1,7 +1,7 @@
  28. #ifndef BOBIP4ADDRESS_H
  29. #define BOBIP4ADDRESS_H
  30.  
  31. -//#include "bobaddress.h"
  32. +#include "bobaddress.h"
  33.  
  34. #include <boost/dynamic_bitset.hpp>
  35.  
  36. diff --git a/bobsubnetmask.cpp b/bobsubnetmask.cpp
  37. index 0e26b60..57d9b33 100644
  38. --- a/bobsubnetmask.cpp
  39. +++ b/bobsubnetmask.cpp
  40. @@ -1,4 +1,4 @@
  41. -#include "bobaddress.h"
  42. +#include "bobsubnetmask.h"
  43.  
  44. namespace libipvx
  45. {
  46. @@ -8,9 +8,8 @@ namespace libipvx
  47. }
  48.  
  49. // Return the number of sequential 'on' bits.
  50. - size_t BobSubnetmaskGetBitLength() const
  51. + size_t BobSubnetmask::GetBitLength() const
  52. {
  53. - boost::dynamic_bitset<> _bitset = this->GetBitset();
  54. - return _bitset.count();
  55. + return m_bitset.count();
  56. }
  57. }
  58. diff --git a/libipvx.h b/libipvx.h
  59. index 2baedf4..82c1ae3 100644
  60. --- a/libipvx.h
  61. +++ b/libipvx.h
  62. @@ -62,5 +62,6 @@ namespace libipvx
  63. }
  64.  
  65. #include "ip4address.h"
  66. +#include "ipvxsubnet.h"
  67.  
  68. #endif
  69. diff --git a/makefile b/makefile
  70. index 2d4f23d..6a17204 100644
  71. --- a/makefile
  72. +++ b/makefile
  73. @@ -1,25 +1,19 @@
  74. CC=g++
  75. -CFLAGS=-Wall -std=c++0x
  76. +CFLAGS=-Wall -O2 -std=c++0x
  77.  
  78. -all: ip4tests_targ #ipvxsubnettests_targ
  79. +all: ip4tests ipvxsubnettests
  80.  
  81. -ip4tests_targ: ip4tests.o ip4address.o
  82. - $(CC) $(CFLAGS) ip4tests.o ip4address.o -o ip4tests
  83. +libipvx.a: ip4address.o bobip4address.o bobaddress.o ip4subnetmask.o bobsubnetmask.o
  84. + $(AR) crs $@ $^
  85.  
  86. -#ipvxsubnettests_targ: ipvxsubnettests.o
  87. -# $(CC) $(CFLAGS) ipvxsubnettests.o ip4address.o -o ipvxsubnettests
  88. +ip4tests: ip4tests.o libipvx.a
  89. + $(CC) $(CFLAGS) -o $@ $^
  90.  
  91. -ip4tests.o: ip4tests.cpp
  92. - $(CC) -c $(CFLAGS) ip4tests.cpp -o ip4tests.o
  93. -
  94. -ip4address.o: ip4address.cpp
  95. - $(CC) -c $(CFLAGS) ip4address.cpp -o ip4address.o
  96. -
  97. -#ipvxsubnettests.o: ipvxsubnettests.cpp
  98. -# $(CC) -c $(CFLAGS) ipvxsubnettests.cpp -o ipvxsubnettests.o
  99. +ipvxsubnettests: ipvxsubnettests.o libipvx.a
  100. + $(CC) $(CFLAGS) -o $@ $^
  101.  
  102. clean:
  103. - rm -rf *.o ip4tests
  104. + rm -f *.o *.a ip4tests ipvxsubnettests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement