From e6c43aea874e3486e3c0e05cb2b8e6f3013d30c0 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Thu, 10 Apr 2014 18:05:52 +0200 Subject: [PATCH] - cleaner code --- client/snapper.cc | 4 ++-- client/utils/Table.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/snapper.cc b/client/snapper.cc index d2276329..82beab91 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -1529,10 +1529,10 @@ main(int argc, char** argv) { unsigned int s; opt->second >> s; - if (s >= _End) + if (s >= Table::numStyles) { cerr << sformat(_("Invalid table style %d."), s) << " " - << sformat(_("Use an integer number from %d to %d"), 0, _End - 1) << endl; + << sformat(_("Use an integer number from %d to %d."), 0, Table::numStyles - 1) << endl; exit(EXIT_FAILURE); } Table::defaultStyle = (TableLineStyle) s; diff --git a/client/utils/Table.h b/client/utils/Table.h index e4a30bb8..f4733aa2 100644 --- a/client/utils/Table.h +++ b/client/utils/Table.h @@ -14,6 +14,7 @@ #include #include #include + using std::string; using std::ostream; using std::list; @@ -91,6 +92,8 @@ public: static TableLineStyle defaultStyle; + static const unsigned int numStyles = _End; + void add (const TableRow& tr); void setHeader (const TableHeader& tr); void dumpTo (ostream& stream) const; -- 2.47.3