From fa03e8b9259e6611d83a10a2f3e12709fcef874f Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Tue, 27 Mar 2012 21:30:34 +0000 Subject: [PATCH] added const to several class members --- bochs/bochs.h | 16 ++++++++-------- bochs/logio.cc | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bochs/bochs.h b/bochs/bochs.h index df80864a3..4f6514c5e 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -277,18 +277,18 @@ public: assert (loglev >= 0 && loglev < N_LOGLEV); onoff[loglev] = value; } - const char *get_name() { return name; } - const char *getprefix() { return prefix; } - int getonoff(int level) { + const char *get_name() const { return name; } + const char *getprefix() const { return prefix; } + int getonoff(int level) const { assert (level>=0 && level= 0 && loglev < N_LOGLEV); assert (action >= 0 && action < N_ACT); default_onoff[loglev] = action; } - static int get_default_action (int loglev) { + static int get_default_action(int loglev) { assert (loglev >= 0 && loglev < N_LOGLEV); return default_onoff[loglev]; } @@ -319,13 +319,13 @@ public: void init_log(FILE *fs); void exit_log(); void set_log_prefix(const char *prefix); - int get_n_logfns() { return n_logfn; } + int get_n_logfns() const { return n_logfn; } logfunc_t *get_logfn(int index) { return logfn_list[index]; } void add_logfn(logfunc_t *fn); void remove_logfn(logfunc_t *fn); void set_log_action(int loglevel, int action); - const char *getlevel(int i); - const char *getaction(int i); + const char *getlevel(int i) const; + const char *getaction(int i) const; protected: int n_logfn; diff --git a/bochs/logio.cc b/bochs/logio.cc index 321c0aa61..3871950d8 100644 --- a/bochs/logio.cc +++ b/bochs/logio.cc @@ -33,7 +33,7 @@ static int Allocio=0; -const char* iofunctions::getlevel(int i) +const char* iofunctions::getlevel(int i) const { static const char *loglevel[N_LOGLEV] = { "DEBUG", @@ -46,11 +46,11 @@ const char* iofunctions::getlevel(int i) else return "?"; } -const char* iofunctions::getaction(int i) +const char* iofunctions::getaction(int i) const { static const char *name[] = { "ignore", "report", "ask", "fatal" }; assert (i>=ACT_IGNORE && i