From 19440bc103f31bdbe6b696934057810dfa4f2720 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sat, 10 Aug 2013 16:58:15 -0700 Subject: [PATCH] Fix clang warning Signed-off-by: Leonardo de Moura --- src/util/options.cpp | 4 ++-- src/util/options.h | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/util/options.cpp b/src/util/options.cpp index 6e9909846..5806b29bc 100644 --- a/src/util/options.cpp +++ b/src/util/options.cpp @@ -25,7 +25,7 @@ bool options::contains(char const * n) const { return ::lean::contains(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; }); } -sexpr const & options::get_sexpr(name const & n, sexpr const & default_value) const { +sexpr options::get_sexpr(name const & n, sexpr const & default_value) const { sexpr const * r = find(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; }); return r == nullptr ? default_value : tail(*r); } @@ -50,7 +50,7 @@ char const * options::get_string(name const & n, char const * default_value) con return !is_nil(r) && is_string(r) ? to_string(r).c_str() : default_value; } -sexpr const & options::get_sexpr(char const * n, sexpr const & default_value) const { +sexpr options::get_sexpr(char const * n, sexpr const & default_value) const { sexpr const * r = find(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; }); return r == nullptr ? default_value : *r; } diff --git a/src/util/options.h b/src/util/options.h index 7fe269077..a9f428816 100644 --- a/src/util/options.h +++ b/src/util/options.h @@ -29,17 +29,17 @@ public: bool contains(name const & n) const; bool contains(char const * n) const; - bool get_bool(name const & n, bool default_value=false) const; - int get_int(name const & n, int default_value=0) const; - double get_double(name const & n, double default_value=0.0) const; - char const * get_string(name const & n, char const * default_value=nullptr) const; - sexpr const & get_sexpr(name const & n, sexpr const & default_value=sexpr()) const; + bool get_bool(name const & n, bool default_value=false) const; + int get_int(name const & n, int default_value=0) const; + double get_double(name const & n, double default_value=0.0) const; + char const * get_string(name const & n, char const * default_value=nullptr) const; + sexpr get_sexpr(name const & n, sexpr const & default_value=sexpr()) const; - bool get_bool(char const * n, bool default_value=false) const; - int get_int(char const * n, int default_value=0) const; - double get_double(char const * n, double default_value=0.0) const; - char const * get_string(char const * n, char const * default_value=nullptr) const; - sexpr const & get_sexpr(char const * n, sexpr const & default_value=sexpr()) const; + bool get_bool(char const * n, bool default_value=false) const; + int get_int(char const * n, int default_value=0) const; + double get_double(char const * n, double default_value=0.0) const; + char const * get_string(char const * n, char const * default_value=nullptr) const; + sexpr get_sexpr(char const * n, sexpr const & default_value=sexpr()) const; options update(name const & n, sexpr const & v) const; template options update(name const & n, T v) const { return update(n, sexpr(v)); }