Skip to content

Commit

Permalink
Merge pull request yedf2#41 from wangqing1218/fix_some
Browse files Browse the repository at this point in the history
Fix some lint and make some code more rubust.
  • Loading branch information
yedf2 authored Aug 19, 2018
2 parents 17cc475 + 47a350b commit 2bc32e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions handy/conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ namespace {
};
}

int Conf::parse(const string& filename1) {
filename = filename1;
FILE* file = fopen(filename.c_str(), "r");
int Conf::parse(const string& filename) {
this->filename = filename;
FILE* file = fopen(this->filename.c_str(), "r");
if (!file)
return -1;
unique_ptr<FILE, decltype(fclose)*> release2(file, fclose);
Expand Down
2 changes: 1 addition & 1 deletion handy/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Conf {
// 0 success
// -1 IOERROR
// >0 line no of error
int parse(const std::string& filename1);
int parse(const std::string& filename);

// Get a string value from INI file, returning default_value if not found.
std::string get(std::string section, std::string name, std::string default_value);
Expand Down
5 changes: 4 additions & 1 deletion handy/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
namespace handy {

struct noncopyable {
noncopyable() {};
protected:
noncopyable() = default;
virtual ~noncopyable() = default;

noncopyable(const noncopyable&) = delete;
noncopyable& operator=(const noncopyable&) = delete;
};
Expand Down

0 comments on commit 2bc32e8

Please sign in to comment.