From 9d99fd9b82ee7fca11ce489443d0e534130192fb Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 29 Nov 2012 19:43:19 +0800 Subject: [PATCH] clean code --- src/util/path.cc | 2 +- src/util/path.h | 2 +- src/util/string_formatter.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/path.cc b/src/util/path.cc index c6f5804..a485fce 100644 --- a/src/util/path.cc +++ b/src/util/path.cc @@ -7,7 +7,7 @@ using std::string; namespace pdf2htmlEX { -void create_directories(string path) +void create_directories(const string & path) { if(path.empty()) return; diff --git a/src/util/path.h b/src/util/path.h index ddc9a4a..4f82a8e 100644 --- a/src/util/path.h +++ b/src/util/path.h @@ -12,7 +12,7 @@ namespace pdf2htmlEX { -void create_directories(std::string path); +void create_directories(const std::string & path); bool is_truetype_suffix(const std::string & suffix); diff --git a/src/util/string_formatter.h b/src/util/string_formatter.h index a5dc08b..8d50df0 100644 --- a/src/util/string_formatter.h +++ b/src/util/string_formatter.h @@ -17,8 +17,9 @@ public: { public: guarded_pointer(string_formatter * sf) : sf(sf) { ++(sf->buf_cnt); } + guarded_pointer(const guarded_pointer & gp) : sf(gp.sf) { ++(sf->buf_cnt); } ~guarded_pointer(void) { --(sf->buf_cnt); } - operator char* () { return &(sf->buf.front()); } + operator char* () const { return &(sf->buf.front()); } private: string_formatter * sf; };