Skip to content

Commit

Permalink
Fix more warnings around cast
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Mar 20, 2024
1 parent bc77d8a commit 7900bcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/core/include/visp3/core/vpIoTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ template<typename T> void npz_save(std::string zipname, std::string fname, const
//below, we will write the the new data at the start of the global header then append the global header and footer below it
size_t global_header_size;
parse_zip_footer(fp, nrecs, global_header_size, global_header_offset);
fseek(fp, global_header_offset, SEEK_SET);
fseek(fp, static_cast<long>(global_header_offset), SEEK_SET);
global_header.resize(global_header_size);
size_t res = fread(&global_header[0], sizeof(char), global_header_size, fp);
if (res != global_header_size) {
throw std::runtime_error("npz_save: header read error while adding to existing zip");
}
fseek(fp, global_header_offset, SEEK_SET);
fseek(fp, static_cast<long>(global_header_offset), SEEK_SET);
}
else {
fp = fopen(zipname.c_str(), "wb");
Expand Down
3 changes: 1 addition & 2 deletions modules/core/include/visp3/core/vpMunkres.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ inline std::vector<std::pair<unsigned int, unsigned int> > vpMunkres::run(std::v
const auto original_col_size = static_cast<Type>(costs.front().size());
const auto sq_size = std::max<Type>(original_row_size, original_col_size);

auto mask = std::vector<std::vector<vpMunkres::ZERO_T> >(
sq_size, std::vector<vpMunkres::ZERO_T>(sq_size, vpMunkres::ZERO_T::NA));
auto mask = std::vector<std::vector<vpMunkres::ZERO_T> >(sq_size, std::vector<vpMunkres::ZERO_T>(sq_size, vpMunkres::ZERO_T::NA));
auto row_cover = std::vector<bool>(sq_size, false);
auto col_cover = std::vector<bool>(sq_size, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ int main(int argc, char **argv)
}
double end = vpTime::measureTimeMs();
times.push_back(end-start);
vec_img_data_size.push_back(img_buffer.size());
vec_img_data_size.push_back(static_cast<int>(img_buffer.size()));
vec_img_data.insert(vec_img_data.end(), img_buffer.begin(), img_buffer.end());

std::vector<double> vec_pose = poseToVec(cMo);
Expand All @@ -175,7 +175,7 @@ int main(int argc, char **argv)
tracker.getModelForDisplay(mapOfModels, mapOfW, mapOfH, mapOfcMos, mapOfCams);

std::vector<std::vector<double>> model = mapOfModels[camera_name];
const std::string model_iter = toString("model_%06zu", iter);
const std::string model_iter = toString("model_%06zu", static_cast<int>(iter));
const std::string model_iter_sz = model_iter + "_sz";
const size_t model_size = model.size();
visp::cnpy::npz_save(npz_filename, model_iter_sz, &model_size, { 1 }, "a");
Expand Down

0 comments on commit 7900bcd

Please sign in to comment.