Browse Source

less warnings

master
Joshua Moerman 13 years ago
parent
commit
3483724cff
  1. 2
      AwesomeAttract0r.xcodeproj/project.pbxproj
  2. 2
      Canvas.hpp
  3. 4
      ImageFormatBMP.hpp
  4. 4
      ImageFormatPNG.hpp
  5. 13
      Logger.hpp
  6. 4
      Tonemapper.hpp

2
AwesomeAttract0r.xcodeproj/project.pbxproj

@ -254,6 +254,7 @@
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx; SDKROOT = macosx;
WARNING_CFLAGS = ( WARNING_CFLAGS = (
"-Weffc++",
"-Wall", "-Wall",
"-Wextra", "-Wextra",
); );
@ -306,6 +307,7 @@
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx; SDKROOT = macosx;
WARNING_CFLAGS = ( WARNING_CFLAGS = (
"-Weffc++",
"-Wall", "-Wall",
"-Wextra", "-Wextra",
); );

2
Canvas.hpp

@ -52,7 +52,7 @@ public:
const int c = 0.5*position[0]*width + width*.5; const int c = 0.5*position[0]*width + width*.5;
const int r = 0.5*position[1]*width + height*.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]++; storage[r][c]++;
} }

4
ImageFormatBMP.hpp

@ -116,6 +116,10 @@ namespace ImageFormats {
struct bitmap_stream { struct bitmap_stream {
typedef P pixel; 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) bitmap_stream(uint16_t width, uint16_t height, std::string filename)
: dib_header(width, height, sizeof(pixel)*8) : dib_header(width, height, sizeof(pixel)*8)
, header(dib_header) , header(dib_header)

4
ImageFormatPNG.hpp

@ -47,6 +47,10 @@ namespace ImageFormats {
struct png_stream{ struct png_stream{
typedef pixelRGB pixel; 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) png_stream(uint32_t width, uint32_t height, std::string filename)
: fp(0) : fp(0)
, png_ptr(0) , png_ptr(0)

13
Logger.hpp

@ -41,6 +41,8 @@ protected:
, level(level) , level(level)
{} {}
virtual ~LoggingBase(){}
bool shouldSkip(){ bool shouldSkip(){
return verbose < level; return verbose < level;
} }
@ -52,6 +54,8 @@ protected:
struct Logger : public LoggingBase { struct Logger : public LoggingBase {
Logger(std::ostream& logging_stream_, LoggingLevels level, std::string prefix_ = "") Logger(std::ostream& logging_stream_, LoggingLevels level, std::string prefix_ = "")
: LoggingBase(logging_stream_, level) : LoggingBase(logging_stream_, level)
, event_map()
, event_name_stack()
, prefix(prefix_) , prefix(prefix_)
{} {}
@ -62,9 +66,7 @@ struct Logger : public LoggingBase {
void start(std::string what){ void start(std::string what){
if (shouldSkip()) return; if (shouldSkip()) return;
Event e; Event e(what);
e.start = boost::posix_time::microsec_clock::local_time();
e.name = what;
EventMap::iterator it = event_map.find(what); EventMap::iterator it = event_map.find(what);
if(it != event_map.end()){ if(it != event_map.end()){
@ -97,6 +99,11 @@ private:
} }
struct Event { 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 start;
boost::posix_time::ptime end; boost::posix_time::ptime end;
std::string name; std::string name;

4
Tonemapper.hpp

@ -45,7 +45,8 @@ namespace Tonemappers {
struct GammaCorrector : public Normalizer { struct GammaCorrector : public Normalizer {
GammaCorrector(double gamma = 1.0) GammaCorrector(double gamma = 1.0)
: gamma(gamma) : power(1.0)
, gamma(gamma)
{} {}
template <typename C> template <typename C>
@ -78,6 +79,7 @@ namespace Tonemappers {
Colorizer(size_t n_planes) Colorizer(size_t n_planes)
: gamma_correctors(n_planes) : gamma_correctors(n_planes)
, gammas() , gammas()
, colors()
{ {
gammas[0].push_back(1.3); gammas[0].push_back(1.3);
gammas[1].push_back(2.0); gammas[1].push_back(2.0);