1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Remove extra const qualifiers.

Some function declared parameters like this:
	int f(const char * const s)
Where appropriate, I changed to
	int f(const char *s)

The second const is a qualifier on the pointer itself; i.e., the value
of s may not be changed (may not be made to point to anything else)
within the function. This is probably not what was intended. The first
const is what prevents modifying things referenced through s.
This commit is contained in:
david
2011-10-13 20:52:03 +00:00
parent d4941d944c
commit 6987814beb
5 changed files with 6 additions and 6 deletions

View File

@@ -118,7 +118,7 @@ void TargetGroup::Initialize() {
/* Initializes (or reinitializes) the object with a new expression, such
as 192.168.0.0/16 , 10.1.0-5.1-254 , or fe80::202:e3ff:fe14:1102 .
Returns 0 for success */
int TargetGroup::parse_expr(const char * const target_expr, int af) {
int TargetGroup::parse_expr(const char *target_expr, int af) {
int i=0,j=0,k=0;
int start, end;

View File

@@ -114,7 +114,7 @@ class TargetGroup {
such as 192.168.0.0/16 , 10.1.0-5.1-254 , or
fe80::202:e3ff:fe14:1102 . The af parameter is AF_INET or
AF_INET6 Returns 0 for success */
int parse_expr(const char * const target_expr, int af);
int parse_expr(const char *target_expr, int af);
/* Grab the next host from this expression (if any). Returns 0 and
fills in ss if successful. ss must point to a pre-allocated
sockaddr_storage structure */

View File

@@ -1641,7 +1641,7 @@ struct sys_route *getsysroutes(int *howmany, char *errstr, size_t errstrlen) {
* localhost. (eg: the address is something like 127.x.x.x, the address
* matches one of the local network interfaces' address, etc).
* Returns 1 if the address is thought to be localhost and 0 otherwise */
int islocalhost(const struct sockaddr_storage *const ss) {
int islocalhost(const struct sockaddr_storage *ss) {
char dev[128];
struct sockaddr_in *sin = NULL;
struct sockaddr_in6 *sin6 = NULL;

View File

@@ -382,7 +382,7 @@ struct sys_route *getsysroutes(int *howmany, char *errstr, size_t errstrlen);
* localhost. (eg: the address is something like 127.x.x.x, the address
* matches one of the local network interfaces' address, etc).
* Returns 1 if the address is thought to be localhost and 0 otherwise */
int islocalhost(const struct sockaddr_storage *const ss);
int islocalhost(const struct sockaddr_storage *ss);
/* Determines whether the supplied address corresponds to a private,
* non-Internet-routable address. See RFC1918 for details.
@@ -435,7 +435,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail);
* Even if spoofss is NULL, if user specified a network device with -e,
* it should still be passed. Note that it's OK to pass either NULL or
* an empty string as the "device", as long as spoofss==NULL. */
int route_dst(const struct sockaddr_storage * const dst, struct route_nfo *rnfo,
int route_dst(const struct sockaddr_storage *dst, struct route_nfo *rnfo,
const char *device, const struct sockaddr_storage *spoofss);
/* Send an IP packet over a raw socket. */

View File

@@ -269,7 +269,7 @@ struct addrinfo *resolve_all(char *hostname, int pf);
a route is found, true is returned and rnfo is filled in with all
of the routing details. This function takes into account -S and -e
options set by user (o.spoofsource, o.device) */
int nmap_route_dst(const struct sockaddr_storage * const dst, struct route_nfo *rnfo);
int nmap_route_dst(const struct sockaddr_storage *dst, struct route_nfo *rnfo);
/* Determines what interface packets destined to 'dest' should be
routed through. It can also discover the appropriate next hop (if