diff options
author | Guillem Jover <guillem@debian.org> | 2014-06-02 00:32:45 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-06-02 00:32:45 +0200 |
commit | c7ad73d0a95ed527e1efe013b97cf849f3af55e9 (patch) | |
tree | 5488444f937653c8ce00cccf0dcff6903e0169dc /dselect/pkgtop.cc | |
parent | dc2edadf0bcb624eafbcd16c92aae7691180f7a4 (diff) | |
download | dpkg-c7ad73d0a95ed527e1efe013b97cf849f3af55e9.tar.gz |
Move enum definitions out of structs
This untangles the types, and makes it possible to use functions that
use such enums as arguments from C++ code, as otherwise the enum would
need to be declared within the struct namespace.
Diffstat (limited to 'dselect/pkgtop.cc')
-rw-r--r-- | dselect/pkgtop.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dselect/pkgtop.cc b/dselect/pkgtop.cc index 8973e560c..49755e760 100644 --- a/dselect/pkgtop.cc +++ b/dselect/pkgtop.cc @@ -3,6 +3,7 @@ * pkgtop.cc - handles (re)draw of package list windows colheads, list, thisstate * * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk> + * Copyright © 2007-2014 Guillem Jover <guillem@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,12 +37,12 @@ static const char * pkgprioritystring(const struct pkginfo *pkg) { - if (pkg->priority == pkginfo::pri_unset) { + if (pkg->priority == pri_unset) { return nullptr; - } else if (pkg->priority == pkginfo::pri_other) { + } else if (pkg->priority == pri_other) { return pkg->otherpriority; } else { - assert(pkg->priority <= pkginfo::pri_unknown); + assert(pkg->priority <= pri_unknown); return gettext(prioritystrings[pkg->priority]); } } @@ -166,7 +167,7 @@ void packagelist::redraw1itemsel(int index, int selected) { mvwprintw(listpad, screenline, priority_column - 1, " %-*.*s", priority_width, priority_width, - pkg->priority == pkginfo::pri_other ? pkg->otherpriority : + pkg->priority == pri_other ? pkg->otherpriority : gettext(prioritystrings[pkg->priority])); } else { mvwaddch(listpad, screenline, 0, eflagchars[pkg->eflag]); @@ -182,7 +183,7 @@ void packagelist::redraw1itemsel(int index, int selected) { wmove(listpad, screenline, priority_column - 1); waddch(listpad, ' '); - if (pkg->priority == pkginfo::pri_other) { + if (pkg->priority == pri_other) { for (i=priority_width, p=pkg->otherpriority; i > 0 && *p; i--, p++) |