From 23d33d9bc3eaa354160788de52e01e14d135e91c Mon Sep 17 00:00:00 2001 From: david Date: Tue, 14 Jun 2011 02:29:41 +0000 Subject: [PATCH] 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. --- portlist.cc | 2 +- portlist.h | 2 +- service_scan.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/portlist.cc b/portlist.cc index e1eca48a1..fe29c7f4e 100644 --- a/portlist.cc +++ b/portlist.cc @@ -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 // serviceDeductions definition for the fields that are populated. // 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; port = lookupPort(portno, protocol); diff --git a/portlist.h b/portlist.h index fccee8878..624745c15 100644 --- a/portlist.h +++ b/portlist.h @@ -270,7 +270,7 @@ class PortList { // 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 // 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 RPC_STATUS_GOOD_PROGRAM, pass 0 for the other args. This function diff --git a/service_scan.h b/service_scan.h index 97411abc9..5c49a2984 100644 --- a/service_scan.h +++ b/service_scan.h @@ -268,7 +268,7 @@ class ServiceProbe { void setRarity(const char *portstr, int lineno); // 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 // list of matches for this probe. This function should be passed