Advertisement
eXFq7GJ1cC

Untitled

Jul 1st, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 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/makefile b/makefile
  59. index 2d4f23d..399b5dc 100644
  60. --- a/makefile
  61. +++ b/makefile
  62. @@ -1,22 +1,10 @@
  63. CC=g++
  64. -CFLAGS=-Wall -std=c++0x
  65. +CFLAGS=-Wall -O2 -std=c++0x
  66.  
  67. -all: ip4tests_targ #ipvxsubnettests_targ
  68. +all: ip4tests
  69.  
  70. -ip4tests_targ: ip4tests.o ip4address.o
  71. - $(CC) $(CFLAGS) ip4tests.o ip4address.o -o ip4tests
  72. -
  73. -#ipvxsubnettests_targ: ipvxsubnettests.o
  74. -# $(CC) $(CFLAGS) ipvxsubnettests.o ip4address.o -o ipvxsubnettests
  75. -
  76. -ip4tests.o: ip4tests.cpp
  77. - $(CC) -c $(CFLAGS) ip4tests.cpp -o ip4tests.o
  78. -
  79. -ip4address.o: ip4address.cpp
  80. - $(CC) -c $(CFLAGS) ip4address.cpp -o ip4address.o
  81. -
  82. -#ipvxsubnettests.o: ipvxsubnettests.cpp
  83. -# $(CC) -c $(CFLAGS) ipvxsubnettests.cpp -o ipvxsubnettests.o
  84. +ip4tests: ip4tests.o ip4address.o bobip4address.o bobaddress.o ip4subnetmask.o bobsubnetmask.o
  85. + $(CC) $(CFLAGS) $^ -o $@
  86.  
  87. clean:
  88. rm -rf *.o ip4tests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement