From f736196cb45d16814f404759d4ebdfc3e46f1e89 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 11 Oct 2007 21:18:04 +0000 Subject: [PATCH] 1. image_data.hpp - fixed mismatched new/new[] in ctor in ImageData 2. image_data.hpp - initialize image data (ImageData) 3. unicode.hpp - added missing when in debug -DMAPNIK_DEBUG --- include/mapnik/image_data.hpp | 14 +++++++------- include/mapnik/unicode.hpp | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/include/mapnik/image_data.hpp b/include/mapnik/image_data.hpp index 46e3b19ec..fd2c969c3 100644 --- a/include/mapnik/image_data.hpp +++ b/include/mapnik/image_data.hpp @@ -39,13 +39,14 @@ namespace mapnik height_(height), pData_((width!=0 && height!=0)? static_cast(::operator new(sizeof(T)*width*height)):0) { - //if (pData_) memset(pData_,0,sizeof(T)*width_*height_); + if (pData_) memset(pData_,0,sizeof(T)*width_*height_); } ImageData(const ImageData& rhs) :width_(rhs.width_), height_(rhs.height_), - pData_((rhs.width_!=0 && rhs.height_!=0)? new T[rhs.width_*rhs.height_]:0) + pData_((rhs.width_!=0 && rhs.height_!=0)? + static_cast(::operator new(sizeof(T)*rhs.width_*rhs.height_)) :0) { if (pData_) memcpy(pData_,rhs.pData_,sizeof(T)*rhs.width_* rhs.height_); } @@ -126,11 +127,10 @@ namespace mapnik } private: - const unsigned width_; - const unsigned height_; - T *pData_; - ImageData& operator=(const ImageData&); - + const unsigned width_; + const unsigned height_; + T *pData_; + ImageData& operator=(const ImageData&); }; typedef ImageData ImageData32; diff --git a/include/mapnik/unicode.hpp b/include/mapnik/unicode.hpp index f2a6822e6..a0b2d0681 100644 --- a/include/mapnik/unicode.hpp +++ b/include/mapnik/unicode.hpp @@ -32,6 +32,10 @@ #include #include +#ifdef MAPNIK_DEBUG +#include +#endif + namespace mapnik { /*