From 992776704db2cceff47f80011c15fe2e4e2ca8ab Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 17 Oct 2009 21:24:16 +0000 Subject: [PATCH] fixed compilation problems git-svn-id: svn://anubis/misc/FileLoader@178 bd8a9e45-a331-0410-811e-c64571078777 --- FileLoader.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/FileLoader.h b/FileLoader.h index f461832..bb62af8 100644 --- a/FileLoader.h +++ b/FileLoader.h @@ -13,11 +13,10 @@ class FileLoader public: std::string fullPath; std::string shortPath; + Path() { } Path(const std::string & full_path, const std::string & short_path) - : fullPath(full_path), shortPath(short_path) - { - } + : fullPath(full_path), shortPath(short_path) { } }; class Buffer @@ -32,23 +31,22 @@ class FileLoader _refcnt = new int; *_refcnt = 1; } - Buffer(const Buffer & other) + void copy(const Buffer & other) { data = other.data; _refcnt = other._refcnt; - (*refcnt)++; + (*_refcnt)++; } - Buffer & operator=(Buffer & me, const Buffer & other) + Buffer(const Buffer & other) { copy(other); } + Buffer & operator=(const Buffer & other) { - me.data = other.data; - me._refcnt = other._refcnt; - (*me_.refcnt)++; - return me; + copy(other); + return *this; } ~Buffer() { (*_refcnt)--; - if (*refcnt < 1) + if (*_refcnt < 1) { delete _refcnt; delete data;