diff options
| author | Timotej Lazar <timotej.lazar@araneo.si> | 2022-06-12 16:53:06 +0200 |
|---|---|---|
| committer | Timotej Lazar <timotej.lazar@araneo.si> | 2022-06-12 16:53:06 +0200 |
| commit | 1e38669119d4ce3e06bbad603799e32e6fd7feb2 (patch) | |
| tree | e787ac4dac41be1f8bcdbeab22c3bbee64f0d8b7 /src/win95/shpchunk.cpp | |
| parent | 0aa9a623f3b38e35b7f1cd26da0237beca2c9988 (diff) | |
Replace max macro with std::max in C++ code
Fixes compilation on Guix with gcc 12. Not sure which of those is
relevant.
Diffstat (limited to 'src/win95/shpchunk.cpp')
| -rw-r--r-- | src/win95/shpchunk.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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 <algorithm> #include <math.h> #include "unaligned.h" #include "chunk.hpp" @@ -191,17 +192,17 @@ void Shape_Chunk::post_input_processing() for (int i=0; i<shape_data_store->num_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()) |
