From 1e38669119d4ce3e06bbad603799e32e6fd7feb2 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 12 Jun 2022 16:53:06 +0200 Subject: Replace max macro with std::max in C++ code Fixes compilation on Guix with gcc 12. Not sure which of those is relevant. --- src/win95/shpchunk.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/win95/shpchunk.cpp') diff --git a/src/win95/shpchunk.cpp b/src/win95/shpchunk.cpp index 26058af..f5338ea 100644 --- a/src/win95/shpchunk.cpp +++ b/src/win95/shpchunk.cpp @@ -1,3 +1,4 @@ +#include #include #include "unaligned.h" #include "chunk.hpp" @@ -191,17 +192,17 @@ void Shape_Chunk::post_input_processing() for (int i=0; inum_verts; i++) { - max.x = max(max.x, shape_data_store->v_list[i].x); - max.y = max(max.y, shape_data_store->v_list[i].y); - max.z = max(max.z, shape_data_store->v_list[i].z); + max.x = std::max(max.x, shape_data_store->v_list[i].x); + max.y = std::max(max.y, shape_data_store->v_list[i].y); + max.z = std::max(max.z, shape_data_store->v_list[i].z); - min.x = min(min.x, shape_data_store->v_list[i].x); - min.y = min(min.y, shape_data_store->v_list[i].y); - min.z = min(min.z, shape_data_store->v_list[i].z); + min.x = std::min(min.x, shape_data_store->v_list[i].x); + min.y = std::min(min.y, shape_data_store->v_list[i].y); + min.z = std::min(min.z, shape_data_store->v_list[i].z); float temp_rad =(float) mod(shape_data_store->v_list[i]); - radius = max (radius, temp_rad); + radius = std::max(radius, temp_rad); } shape_data_store->max = max; @@ -1459,7 +1460,7 @@ void Shape_Header_Chunk::prepare_for_output() } - Shape_Chunk::max_id = max(Shape_Chunk::max_id, file_id_num); + Shape_Chunk::max_id = std::max(Shape_Chunk::max_id, file_id_num); // this should always be the last thing @@ -1783,7 +1784,7 @@ void Shape_Morphing_Data_Chunk::prepare_for_output() for (; !cli.done(); cli.next()) { - max_id = max (max_id, ((Shape_Sub_Shape_Chunk *)cli())->get_header()->file_id_num); + max_id = std::max(max_id, ((Shape_Sub_Shape_Chunk *)cli())->get_header()->file_id_num); } for (cli.restart(); !cli.done(); cli.next()) -- cgit v1.3