From 3a0b829ea1c61207cf5d8062edefac188f709d4d Mon Sep 17 00:00:00 2001 From: david Date: Mon, 7 Jun 2010 22:09:37 +0000 Subject: [PATCH] Make const these methods of Target: deviceName deviceFullName directlyConnected directlyConnectedOrUnset --- Target.cc | 8 ++++---- Target.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Target.cc b/Target.cc index 9e2abf539..be4f0ac52 100644 --- a/Target.cc +++ b/Target.cc @@ -141,11 +141,11 @@ void Target::Initialize() { } -const char * Target::deviceName() { +const char * Target::deviceName() const { return (devname[0] != '\0')? devname : NULL; } -const char * Target::deviceFullName() { +const char * Target::deviceFullName() const { return (devfullname[0] != '\0')? devfullname : NULL; } @@ -361,11 +361,11 @@ void Target::setDirectlyConnected(bool connected) { directly_connected = connected? 1 : 0; } -int Target::directlyConnectedOrUnset(){ +int Target::directlyConnectedOrUnset() const { return directly_connected; } -bool Target::directlyConnected() { +bool Target::directlyConnected() const { assert(directly_connected == 0 || directly_connected == 1); return directly_connected; } diff --git a/Target.h b/Target.h index d6e49f4de..00b91a5f2 100644 --- a/Target.h +++ b/Target.h @@ -212,8 +212,8 @@ class Target { that information here. directlyConnected() will abort if it hasn't been set yet. */ void setDirectlyConnected(bool connected); - bool directlyConnected(); - int directlyConnectedOrUnset(); /* 1-directly connected, 0-no, -1-we don't know*/ + bool directlyConnected() const; + int directlyConnectedOrUnset() const; /* 1-directly connected, 0-no, -1-we don't know*/ /* If the host is NOT directly connected, you can set the next hop value here. It is OK to pass in a sockaddr_in or sockaddr_in6 @@ -263,8 +263,8 @@ class Target { qualifier, while the full name may include it (e.g. "eth1:1"). If these are non-null, they will overwrite the stored version */ void setDeviceNames(const char *name, const char *fullname); - const char *deviceName(); - const char *deviceFullName(); + const char *deviceName() const; + const char *deviceFullName() const; int osscanPerformed(void); void osscanSetFlag(int flag);