From 38b8fa7f377ceb13b73428c53ced53bd140ffbfc Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Thu, 13 Feb 2014 14:37:40 -0500 Subject: [PATCH] Added missing files in CMakeLists.txt for the mfilm plugin and fixed warnings. --- src/films/CMakeLists.txt | 2 +- src/films/cnpy.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/films/CMakeLists.txt b/src/films/CMakeLists.txt index 22ff2e8e..a2e6f313 100644 --- a/src/films/CMakeLists.txt +++ b/src/films/CMakeLists.txt @@ -7,7 +7,7 @@ macro(add_film) add_mts_plugin(${ARGN} TYPE film) endmacro() -add_film(mfilm mfilm.cpp) +add_film(mfilm mfilm.cpp cnpy.h cnpy.cpp) add_film(ldrfilm ldrfilm.cpp annotations.h banner.h MTS_HW) add_film(hdrfilm hdrfilm.cpp annotations.h banner.h MTS_HW) diff --git a/src/films/cnpy.cpp b/src/films/cnpy.cpp index a7b8b221..61f3fe98 100644 --- a/src/films/cnpy.cpp +++ b/src/films/cnpy.cpp @@ -68,7 +68,7 @@ void cnpy::parse_npy_header(FILE* fp, unsigned int& word_size, unsigned int*& sh std::string header = fgets(buffer,256,fp); assert(header[header.size()-1] == '\n'); - int loc1, loc2; + size_t loc1, loc2; //fortran order loc1 = header.find("fortran_order")+16; @@ -79,7 +79,7 @@ void cnpy::parse_npy_header(FILE* fp, unsigned int& word_size, unsigned int*& sh loc2 = header.find(")"); std::string str_shape = header.substr(loc1+1,loc2-loc1-1); if(str_shape[str_shape.size()-1] == ',') ndims = 1; - else ndims = std::count(str_shape.begin(),str_shape.end(),',')+1; + else ndims = static_cast(std::count(str_shape.begin(),str_shape.end(),',')+1); shape = new unsigned int[ndims]; for(unsigned int i = 0;i < ndims;i++) { loc1 = str_shape.find(",");