diff --git a/snapper/Enum.cc b/snapper/Enum.cc index 0fdd454c..22b7f31d 100644 --- a/snapper/Enum.cc +++ b/snapper/Enum.cc @@ -27,11 +27,8 @@ namespace snapper { - static const string snapshot_type_names[] = { + const vector EnumInfo::names({ "single", "pre", "post" - }; - - const vector EnumInfo::names(snapshot_type_names, snapshot_type_names + - lengthof(snapshot_type_names)); + }); } diff --git a/snapper/Filesystem.cc b/snapper/Filesystem.cc index c01961ab..52ca97fa 100644 --- a/snapper/Filesystem.cc +++ b/snapper/Filesystem.cc @@ -57,7 +57,7 @@ namespace snapper vector Filesystem::filter_mount_options(const vector& options) { - static const char* ign_opt[] = { + static const char* ign_opts[] = { "ro", "rw", "exec", "noexec", "suid", "nosuid", "dev", "nodev", "atime", "noatime", "diratime", "nodiratime", @@ -66,8 +66,8 @@ namespace snapper vector ret = options; - for (size_t i = 0; i < lengthof(ign_opt); ++i) - ret.erase(remove(ret.begin(), ret.end(), ign_opt[i]), ret.end()); + for (const char* ign_opt : ign_opts) + ret.erase(remove(ret.begin(), ret.end(), ign_opt), ret.end()); return ret; } diff --git a/snapper/SnapperTmpl.h b/snapper/SnapperTmpl.h index eab0e88a..8707af56 100644 --- a/snapper/SnapperTmpl.h +++ b/snapper/SnapperTmpl.h @@ -116,10 +116,6 @@ namespace snapper return find_if(l.begin(), l.end(), pred) != l.end(); } - - template - inline unsigned int lengthof(T (&)[sz]) { return sz; } - } #endif