1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 07:29:01 +00:00

Avoid hidden overloaded virtual functions

Since the functions were hidden for the comiler, I specified every
function that was being hidden in the IPv*Header.h header files.
This allows us to use both overloaded functions and the original one
instead of having one being hidden by the others.
Here is the compiler warning output before the fix:

warning: 'file::function' hides overloaded virtual function
note: hidden overloaded virtual function 'file2::function' declared
here: different qualifiers
This commit is contained in:
vincent
2016-07-01 11:36:20 +00:00
parent 900f015726
commit 9703feace9
2 changed files with 11 additions and 4 deletions

View File

@@ -213,7 +213,8 @@ class IPv6Header : public NetworkLayerElement {
int setNextHeader(u8 val);
int setNextHeader(const char *p);
u8 getNextHeader() const;
virtual u8 getNextHeader(){return 0;}
/* Hop Limit */
int setHopLimit(u8 val);
u8 getHopLimit() const;
@@ -223,14 +224,17 @@ class IPv6Header : public NetworkLayerElement {
int setSourceAddress(struct in6_addr val);
const u8 *getSourceAddress() const;
struct in6_addr getSourceAddress(struct in6_addr *result) const;
virtual u8 *getSourceAddress(){return NULL;}
/* Destination Address*/
int setDestinationAddress(u8 *val);
int setDestinationAddress(struct in6_addr val);
const u8 *getDestinationAddress() const;
struct in6_addr getDestinationAddress(struct in6_addr *result) const;
virtual u8 *getDestinationAddress(){return NULL;}
u16 getAddressLength() const;
virtual u16 getAddressLength(){return 0;}
};
#endif