diff --git a/AwesomeAttract0r.xcodeproj/project.pbxproj b/AwesomeAttract0r.xcodeproj/project.pbxproj index c3e8278..8ef2f9a 100644 --- a/AwesomeAttract0r.xcodeproj/project.pbxproj +++ b/AwesomeAttract0r.xcodeproj/project.pbxproj @@ -254,6 +254,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; WARNING_CFLAGS = ( + "-Weffc++", "-Wall", "-Wextra", ); @@ -306,6 +307,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; WARNING_CFLAGS = ( + "-Weffc++", "-Wall", "-Wextra", ); diff --git a/Canvas.hpp b/Canvas.hpp index ac14742..01546d4 100644 --- a/Canvas.hpp +++ b/Canvas.hpp @@ -52,7 +52,7 @@ public: const int c = 0.5*position[0]*width + width*.5; const int r = 0.5*position[1]*width + height*.5; - if(0 <= c && c < width && 0 <= r && r < height) + if(0 <= c && (size_t)c < width && 0 <= r && (size_t)r < height) storage[r][c]++; } diff --git a/ImageFormatBMP.hpp b/ImageFormatBMP.hpp index 7df45c7..c615849 100644 --- a/ImageFormatBMP.hpp +++ b/ImageFormatBMP.hpp @@ -116,6 +116,10 @@ namespace ImageFormats { struct bitmap_stream { typedef P pixel; + bitmap_stream() = delete; + bitmap_stream(bitmap_stream const &) = delete; + bitmap_stream & operator=(bitmap_stream const &) = delete; + bitmap_stream(uint16_t width, uint16_t height, std::string filename) : dib_header(width, height, sizeof(pixel)*8) , header(dib_header) diff --git a/ImageFormatPNG.hpp b/ImageFormatPNG.hpp index 1e06487..e8198da 100644 --- a/ImageFormatPNG.hpp +++ b/ImageFormatPNG.hpp @@ -47,6 +47,10 @@ namespace ImageFormats { struct png_stream{ typedef pixelRGB pixel; + png_stream() = delete; + png_stream(png_stream const &) = delete; + png_stream & operator=(png_stream const &) = delete; + png_stream(uint32_t width, uint32_t height, std::string filename) : fp(0) , png_ptr(0) diff --git a/Logger.hpp b/Logger.hpp index 2fce5c7..c59c9b0 100644 --- a/Logger.hpp +++ b/Logger.hpp @@ -41,6 +41,8 @@ protected: , level(level) {} + virtual ~LoggingBase(){} + bool shouldSkip(){ return verbose < level; } @@ -52,6 +54,8 @@ protected: struct Logger : public LoggingBase { Logger(std::ostream& logging_stream_, LoggingLevels level, std::string prefix_ = "") : LoggingBase(logging_stream_, level) + , event_map() + , event_name_stack() , prefix(prefix_) {} @@ -62,9 +66,7 @@ struct Logger : public LoggingBase { void start(std::string what){ if (shouldSkip()) return; - Event e; - e.start = boost::posix_time::microsec_clock::local_time(); - e.name = what; + Event e(what); EventMap::iterator it = event_map.find(what); if(it != event_map.end()){ @@ -97,6 +99,11 @@ private: } struct Event { + Event(std::string const & name) + : start(boost::posix_time::microsec_clock::local_time()) + , end(boost::posix_time::microsec_clock::local_time()) + , name(name) {} + boost::posix_time::ptime start; boost::posix_time::ptime end; std::string name; diff --git a/Tonemapper.hpp b/Tonemapper.hpp index 7ec612b..f2cc42d 100644 --- a/Tonemapper.hpp +++ b/Tonemapper.hpp @@ -45,7 +45,8 @@ namespace Tonemappers { struct GammaCorrector : public Normalizer { GammaCorrector(double gamma = 1.0) - : gamma(gamma) + : power(1.0) + , gamma(gamma) {} template @@ -78,6 +79,7 @@ namespace Tonemappers { Colorizer(size_t n_planes) : gamma_correctors(n_planes) , gammas() + , colors() { gammas[0].push_back(1.3); gammas[1].push_back(2.0);