From eac0c269d828dfd1cfbb2f9e9f53e644d10d27a9 Mon Sep 17 00:00:00 2001 From: mwlasiuk Date: Tue, 13 Jan 2026 19:15:49 +0100 Subject: [PATCH] Fix more compiler warnings on windows --- apps/lidar_odometry_step_1/lidar_odometry.cpp | 7 +++++-- apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp | 2 +- core/include/export_laz.h | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/lidar_odometry_step_1/lidar_odometry.cpp b/apps/lidar_odometry_step_1/lidar_odometry.cpp index 0875bc9b..e32b5af1 100644 --- a/apps/lidar_odometry_step_1/lidar_odometry.cpp +++ b/apps/lidar_odometry_step_1/lidar_odometry.cpp @@ -4,7 +4,7 @@ namespace fs = std::filesystem; -const float RAD_TO_DEG = 180.0f / M_PI; +const float RAD_TO_DEG = 180.0f / static_cast(M_PI); bool load_data(std::vector& input_file_names, LidarOdometryParams& params, @@ -360,7 +360,10 @@ void calculate_trajectory( for (const auto& [timestamp_pair, gyr, acc] : imu_data) { - const FusionVector gyroscope = { static_cast(gyr.axis.x * RAD_TO_DEG) - bias_gyr_x, static_cast(gyr.axis.y * RAD_TO_DEG) - bias_gyr_y, static_cast(gyr.axis.z * RAD_TO_DEG) - bias_gyr_z }; + const FusionVector gyroscope = { + static_cast(gyr.axis.x * RAD_TO_DEG) - static_cast(bias_gyr_x), + static_cast(gyr.axis.y * RAD_TO_DEG) - static_cast(bias_gyr_y), + static_cast(gyr.axis.z * RAD_TO_DEG) - static_cast(bias_gyr_z) }; const FusionVector accelerometer = { acc.axis.x, acc.axis.y, acc.axis.z }; /*if (provious_time_stamp == 0.0) diff --git a/apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp b/apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp index 089ea9bd..b46cd712 100644 --- a/apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp +++ b/apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp @@ -1023,7 +1023,7 @@ void loadData() const FusionEuler euler = FusionQuaternionToEuler(FusionAhrsGetQuaternion(&ahrs)); counter++; if (counter % 100 == 0) - printf("Roll %0.1f, Pitch %0.1f, Yaw %0.1f [%d of %d]\n", euler.angle.roll, euler.angle.pitch, euler.angle.yaw, counter++, imu_data.size()); + printf("Roll %0.1f, Pitch %0.1f, Yaw %0.1f [%d of %zu]\n", euler.angle.roll, euler.angle.pitch, euler.angle.yaw, counter++, imu_data.size()); // log it for implot imu_data_plot.timestampLidar.push_back(timestamp_pair.first); diff --git a/core/include/export_laz.h b/core/include/export_laz.h index 0be585d7..854c055b 100644 --- a/core/include/export_laz.h +++ b/core/include/export_laz.h @@ -330,7 +330,7 @@ inline void save_processed_pc(const fs::path &file_path_in, const fs::path &file std::abort(); } - for (int i = 0; i < header->number_of_point_records; i++) + for (uint32_t i = 0; i < header->number_of_point_records; i++) { if (laszip_read_point(laszip_reader)) { @@ -367,7 +367,7 @@ inline void save_processed_pc(const fs::path &file_path_in, const fs::path &file if (laszip_write_point(laszip_writer)) { - fprintf(stderr, "DLL ERROR: writing point %I64d\n", i); + fprintf(stderr, "DLL ERROR: writing point %u\n", i); return; } } @@ -394,7 +394,7 @@ inline void save_processed_pc(const fs::path &file_path_in, const fs::path &file return; } - fprintf(stderr, "successfully written %ld points\n", p_count); + fprintf(stderr, "successfully written %lld points\n", p_count); // close the writer