1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 20:51:30 +00:00

Properly make some methods const.

These had const at the beginning of the declaration, so it applied to
the return value rather than the object the method was being called on.
This commit is contained in:
david
2011-06-14 02:29:41 +00:00
parent 17a57e186b
commit 23d33d9bc3
3 changed files with 3 additions and 3 deletions

View File

@@ -280,7 +280,7 @@ void serviceDeductions::populateFullVersionString(char *buf, size_t n) const {
// initializing, and you don't have to free any internal ptrs. See the // initializing, and you don't have to free any internal ptrs. See the
// serviceDeductions definition for the fields that are populated. // serviceDeductions definition for the fields that are populated.
// Returns 0 if at least a name is available. // Returns 0 if at least a name is available.
const void PortList::getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const { void PortList::getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const {
const Port *port; const Port *port;
port = lookupPort(portno, protocol); port = lookupPort(portno, protocol);

View File

@@ -270,7 +270,7 @@ class PortList {
// pass in an allocated struct serviceDeductions (don't worry about initializing, and // pass in an allocated struct serviceDeductions (don't worry about initializing, and
// you don't have to free any internal ptrs. See the serviceDeductions definition for // you don't have to free any internal ptrs. See the serviceDeductions definition for
// the fields that are populated. Returns 0 if at least a name is available. // the fields that are populated. Returns 0 if at least a name is available.
const void getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const; void getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const;
/* Sets the results of an RPC scan. if rpc_status is not /* Sets the results of an RPC scan. if rpc_status is not
RPC_STATUS_GOOD_PROGRAM, pass 0 for the other args. This function RPC_STATUS_GOOD_PROGRAM, pass 0 for the other args. This function

View File

@@ -268,7 +268,7 @@ class ServiceProbe {
void setRarity(const char *portstr, int lineno); void setRarity(const char *portstr, int lineno);
// Simply returns the rarity of this probe // Simply returns the rarity of this probe
const int getRarity() { return rarity; } int getRarity() const { return rarity; }
// Takes a match line in a probe description and adds it to the // Takes a match line in a probe description and adds it to the
// list of matches for this probe. This function should be passed // list of matches for this probe. This function should be passed