Commit 867ddeb0 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

small cleanups in shared code

parent ce9c9343
......@@ -115,7 +115,7 @@ class ConfSimple(object):
sk = sk.encode('utf-8')
#v = ConfSimple.getbin(self, nm, sk)
v = self.getbin(nm, sk)
if v and dodecode:
if v is not None and dodecode:
v = v.decode('utf-8')
return v
......@@ -257,7 +257,7 @@ class ConfStack(object):
sk = sk.encode('utf-8')
#v = ConfSimple.getbin(self, nm, sk)
v = self.getbin(nm, sk)
if v and dodecode:
if v is not None and dodecode:
v = v.decode('utf-8')
return v
......
......@@ -1213,7 +1213,7 @@ void catstrerror(string *reason, const char *what, int _errno)
}
static std::unordered_map<string, string> lang_to_code {
static const std::unordered_map<string, string> lang_to_code {
{"be", "cp1251"},
{"bg", "cp1251"},
{"cs", "iso-8859-2"},
......
......@@ -239,7 +239,7 @@ private:
/// Entries for the descriptive table
struct CharFlags {
CharFlags(int v, const char *y, const char *n=0)
CharFlags(int v, const char *y, const char *n=nullptr)
: value(v), yesname(y), noname(n) {}
unsigned int value; // Flag or value
const char *yesname;// String to print if flag set or equal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment