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`.
This commit is contained in:
parent
d554b01e45
commit
b87651216c
|
@ -29,6 +29,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "pstypes.h"
|
#include "pstypes.h"
|
||||||
#include "gr.h"
|
#include "gr.h"
|
||||||
|
@ -243,7 +244,7 @@ static void ab_load(int skip, const char * filename, array<bitmap_index, MAX_BIT
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint_fast32_t i=0;i< *nframes; i++) {
|
for (uint_fast32_t i=0;i< *nframes; i++) {
|
||||||
snprintf(tempname, sizeof(tempname), "%s#%u", fname, static_cast<unsigned>(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);
|
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());
|
bm[i]->avg_color = compute_average_pixel(bm[i].get());
|
||||||
bmp[i] = piggy_register_bitmap( bm[i].get(), tempname, 0 );
|
bmp[i] = piggy_register_bitmap( bm[i].get(), tempname, 0 );
|
||||||
|
|
Loading…
Reference in a new issue