From b87651216cd2264dfcd5e4cafb869a737c2da42e Mon Sep 17 00:00:00 2001 From: Kp Date: Fri, 19 Aug 2016 03:41:41 +0000 Subject: [PATCH] Switch ab_load to use inttypes format macros Most 64-bit systems use `unsigned long` for `uint_fast32_t`. Some 32-bit systems use `unsigned int` for `uint_fast32_t`. To handle this, ab_load used casts to `unsigned long` and a format string of `%lu`. Switch to inttypes format macro so that the format string is correct without requiring a cast to handle systems where `uint_fast32_t` is not `unsigned long`. --- d1x-rebirth/main/bmread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d1x-rebirth/main/bmread.cpp b/d1x-rebirth/main/bmread.cpp index cf09700be..da260d490 100644 --- a/d1x-rebirth/main/bmread.cpp +++ b/d1x-rebirth/main/bmread.cpp @@ -29,6 +29,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include +#include #include "pstypes.h" #include "gr.h" @@ -243,7 +244,7 @@ static void ab_load(int skip, const char * filename, array(i)); + snprintf(tempname, sizeof(tempname), "%s#%" PRIuFAST32, fname, i); gr_remap_bitmap_good(*bm[i].get(), newpal, iff_has_transparency ? iff_transparent_color : -1, SuperX); bm[i]->avg_color = compute_average_pixel(bm[i].get()); bmp[i] = piggy_register_bitmap( bm[i].get(), tempname, 0 );