19
19
#include < ttyd/battle_ac.h>
20
20
21
21
#include < cstdio>
22
+ #include < cinttypes>
22
23
23
24
namespace mod {
24
25
@@ -630,7 +631,7 @@ void iconViewer()
630
631
631
632
char *tempDisplayBuffer = DisplayBuffer;
632
633
sprintf (tempDisplayBuffer,
633
- " %d " ,
634
+ " %" PRId16 ,
634
635
tempValue);
635
636
636
637
drawText (tempDisplayBuffer, 0 , 60 , 0xFF , 0xFFFFFFFF , 0.8 );
@@ -884,7 +885,7 @@ void drawMarioStats()
884
885
if (i != 11 ) // Special moves -- drawn separately
885
886
{
886
887
sprintf (tempDisplayBuffer,
887
- " %ld " ,
888
+ " %" PRId32 ,
888
889
MarioStatsArray[Counter]);
889
890
890
891
drawText (tempDisplayBuffer, ValuesPosX, PosY, Alpha, Color, TextScale);
@@ -1015,7 +1016,7 @@ void drawPartnerStats()
1015
1016
for (uint32_t i = 0 ; i < (tempStatsPartnerOptionsLinesSize - 1 ); i++)
1016
1017
{
1017
1018
sprintf (tempDisplayBuffer,
1018
- " %d " ,
1019
+ " %" PRId16 ,
1019
1020
PartnerStats[i]);
1020
1021
1021
1022
drawText (tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
@@ -1093,7 +1094,7 @@ void drawBattlesActorStats()
1093
1094
for (uint32_t i = 0 ; i < (tempBattlesCurrentActorStatsSize); i++)
1094
1095
{
1095
1096
sprintf (tempDisplayBuffer,
1096
- " %d " ,
1097
+ " %" PRId16 ,
1097
1098
ActorStats[i]);
1098
1099
1099
1100
drawText (tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
@@ -1378,7 +1379,7 @@ void drawMemoryModifyList()
1378
1379
// Draw the X and Y positions
1379
1380
char *tempDisplayBuffer = DisplayBuffer;
1380
1381
sprintf (tempDisplayBuffer,
1381
- " %ld , %ld " ,
1382
+ " %" PRId32 " , %" PRId32 ,
1382
1383
MemoryWatch[tempMenuSelectedOption].PosX ,
1383
1384
MemoryWatch[tempMenuSelectedOption].PosY );
1384
1385
@@ -1570,7 +1571,7 @@ void drawMemoryChangeAddressList()
1570
1571
1571
1572
// Draw the text for the current level
1572
1573
sprintf (tempDisplayBuffer,
1573
- " Level %ld " ,
1574
+ " Level %" PRIu32 ,
1574
1575
i);
1575
1576
drawText (tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
1576
1577
@@ -1586,13 +1587,13 @@ void drawMemoryChangeAddressList()
1586
1587
tempOffset = -tempOffset;
1587
1588
1588
1589
sprintf (tempDisplayBuffer,
1589
- " -0x%lX " ,
1590
+ " -0x%" PRIX32 ,
1590
1591
tempOffset);
1591
1592
}
1592
1593
else
1593
1594
{
1594
1595
sprintf (tempDisplayBuffer,
1595
- " 0x%lX " ,
1596
+ " 0x%" PRIX32 ,
1596
1597
tempOffset);
1597
1598
}
1598
1599
@@ -1792,7 +1793,7 @@ void drawBattlesStatusesList()
1792
1793
1793
1794
// Draw the text of the value
1794
1795
sprintf (tempDisplayBuffer,
1795
- " %d " ,
1796
+ " %" PRId8 ,
1796
1797
CurrentValue);
1797
1798
1798
1799
Color = 0xFFFFFFFF ;
@@ -2019,7 +2020,7 @@ void drawSingleLineFromStringAndValue(int32_t posX, int32_t posY,
2019
2020
{
2020
2021
char *tempDisplayBuffer = DisplayBuffer;
2021
2022
sprintf (tempDisplayBuffer,
2022
- " %s%ld " ,
2023
+ " %s%" PRId32 ,
2023
2024
line,
2024
2025
value);
2025
2026
@@ -2205,7 +2206,7 @@ void drawAdjustableValue(bool changingItem, uint32_t currentMenu)
2205
2206
2206
2207
char *tempDisplayBuffer = DisplayBuffer;
2207
2208
sprintf (tempDisplayBuffer,
2208
- " %d " ,
2209
+ " %" PRIu8 ,
2209
2210
AdjustableValue[i]);
2210
2211
2211
2212
drawText (tempDisplayBuffer, x, y, alpha, color, scale);
@@ -2347,7 +2348,7 @@ void drawMemoryWatchAdjustableValue(uint32_t currentMenu)
2347
2348
2348
2349
char *tempDisplayBuffer = DisplayBuffer;
2349
2350
sprintf (tempDisplayBuffer,
2350
- " %01X " ,
2351
+ " %01 " PRIX8 ,
2351
2352
AdjustableValue[i]);
2352
2353
2353
2354
drawText (tempDisplayBuffer, x, y, alpha, color, scale);
@@ -2499,7 +2500,7 @@ void drawPageNumber(int32_t posX, int32_t posY, uint32_t currentPage)
2499
2500
2500
2501
char *tempDisplayBuffer = DisplayBuffer;
2501
2502
sprintf (tempDisplayBuffer,
2502
- " Page %ld " ,
2503
+ " Page %" PRIu32 ,
2503
2504
currentPage + 1 );
2504
2505
2505
2506
drawText (tempDisplayBuffer, posX, posY, Alpha, Color, Scale);
@@ -2545,7 +2546,7 @@ void drawCheatsChangeSequence()
2545
2546
// Draw the text for showing what the current Sequence value is
2546
2547
char *tempDisplayBuffer = DisplayBuffer;
2547
2548
sprintf (tempDisplayBuffer,
2548
- " Current Value: %ld " ,
2549
+ " Current Value: %" PRIu32 ,
2549
2550
SequencePosition);
2550
2551
2551
2552
drawText (tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
@@ -2569,7 +2570,7 @@ void drawCheatsChangeSequence()
2569
2570
}
2570
2571
else
2571
2572
{
2572
- int StageNumber;
2573
+ int32_t StageNumber;
2573
2574
if ((SequencePosition >= 23 ) && (SequencePosition <= 70 ))
2574
2575
{
2575
2576
StageNumber = 1 ;
@@ -2607,7 +2608,7 @@ void drawCheatsChangeSequence()
2607
2608
clearMemory (tempString, sizeof (tempString));
2608
2609
2609
2610
sprintf (tempString,
2610
- " Stage %d " ,
2611
+ " Stage %" PRId32 ,
2611
2612
StageNumber);
2612
2613
2613
2614
StageName = tempString;
@@ -2739,7 +2740,7 @@ void drawChangeButtonCombo(uint16_t ¤tButtonCombo)
2739
2740
char *tempDisplayBuffer = DisplayBuffer;
2740
2741
2741
2742
sprintf (tempDisplayBuffer,
2742
- " Time Left: %02ld.%02ld " ,
2743
+ " Time Left: %02 " PRIu32 " .%02 " PRIu32 ,
2743
2744
second,
2744
2745
frame);
2745
2746
@@ -2928,7 +2929,7 @@ void drawSequenceInPauseMenu()
2928
2929
char *tempDisplayBuffer = DisplayBuffer;
2929
2930
2930
2931
sprintf (tempDisplayBuffer,
2931
- " Seq: %lu " ,
2932
+ " Seq: %" PRIu32 ,
2932
2933
SequencePosition);
2933
2934
2934
2935
drawText (tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
@@ -2948,7 +2949,7 @@ void drawOnScreenTimer()
2948
2949
2949
2950
char *tempDisplayBuffer = DisplayBuffer;
2950
2951
sprintf (tempDisplayBuffer,
2951
- " %02ld:%02ld:%02ld.%02ld " ,
2952
+ " %02 " PRIu32 " :%02 " PRIu32 " :%02 " PRIu32 " .%02 " PRIu32 ,
2952
2953
hour,
2953
2954
minute,
2954
2955
second,
@@ -3023,7 +3024,7 @@ void drawJumpStorageDetails()
3023
3024
char *tempDisplayBuffer = DisplayBuffer;
3024
3025
3025
3026
sprintf (tempDisplayBuffer,
3026
- " JS: %ld \n SpdY: %.2f" ,
3027
+ " JS: %" PRIu32 " \n SpdY: %.2f" ,
3027
3028
(player->flags3 & (1 << 16 )) >> 16 , // Get only the 16 bit
3028
3029
player->wJumpVelocityY );
3029
3030
@@ -3147,7 +3148,7 @@ void drawYoshiSkipDetails()
3147
3148
// Draw the text
3148
3149
char *tempDisplayBuffer = DisplayBuffer;
3149
3150
sprintf (tempDisplayBuffer,
3150
- " YST: %lu \n StickAngle: %.2f" ,
3151
+ " YST: %" PRIu32 " \n StickAngle: %.2f" ,
3151
3152
YoshiSkip.MainTimer ,
3152
3153
getStickAngle ());
3153
3154
@@ -3291,7 +3292,7 @@ void drawPalaceSkipDetails()
3291
3292
// Draw the text
3292
3293
char *tempDisplayBuffer = DisplayBuffer;
3293
3294
sprintf (tempDisplayBuffer,
3294
- " PST: %lu \n ItemTimer: %ld \n PhaEmY: %.2f\n ParY: %.2f" ,
3295
+ " PST: %" PRIu32 " \n ItemTimer: %" PRId32 " \n PhaEmY: %.2f\n ParY: %.2f" ,
3295
3296
PalaceSkip.MainTimer ,
3296
3297
ItemTimer,
3297
3298
PhantomEmberPosY,
@@ -3388,7 +3389,7 @@ void drawActionCommandsTiming()
3388
3389
}
3389
3390
3390
3391
sprintf (tempDisplayBuffer,
3391
- " Pressed %c on frame %ld of %ld " ,
3392
+ " Pressed %c on frame %" PRIu32 " of %" PRIu32 ,
3392
3393
Button,
3393
3394
FramePressed,
3394
3395
CurrentDifficultyFrames);
@@ -3431,7 +3432,7 @@ void drawActionCommandsTiming()
3431
3432
}
3432
3433
3433
3434
sprintf (tempDisplayBuffer,
3434
- " Pressed %c %ld frame%s early" ,
3435
+ " Pressed %c %" PRIu32 " frame%s early" ,
3435
3436
Button,
3436
3437
FramesEarly,
3437
3438
CheckForPlural);
0 commit comments