added const to several class members

This commit is contained in:
Stanislav Shwartsman 2012-03-27 21:30:34 +00:00
parent 90fc12d9e4
commit fa03e8b925
2 changed files with 11 additions and 11 deletions

View File

@ -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<N_LOGLEV);
return onoff[level];
}
static void set_default_action (int loglev, int action) {
static void set_default_action(int loglev, int action) {
assert (loglev >= 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;

View File

@ -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<N_ACT);
return (char *) name[i];
return name[i];
}
void iofunctions::flush(void)