Fixed up format specifiers

also cleanup imports
This commit is contained in:
Marcus Minhorst 2025-08-09 10:35:10 -04:00 committed by Ricardo Luís Vaz Silva
commit 4a3bfae42e
6 changed files with 147 additions and 160 deletions

View file

@ -39,87 +39,81 @@
#include <math.h>
#include <assert.h>
#include "engineerrors.h"
#include "i_time.h"
#include "d_gui.h"
#include "m_random.h"
#include "doomdef.h"
#include "doomstat.h"
#include "gstrings.h"
#include "filesystem.h"
#include "s_sound.h"
#include "v_video.h"
#include "intermission/intermission.h"
#include "wipe.h"
#include "m_argv.h"
#include "m_misc.h"
#include "menu.h"
#include "doommenu.h"
#include "a_dynlight.h"
#include "am_map.h"
#include "animations.h"
#include "autosegs.h"
#include "c_buttons.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "i_sound.h"
#include "i_video.h"
#include "g_game.h"
#include "hu_stuff.h"
#include "wi_stuff.h"
#include "st_stuff.h"
#include "am_map.h"
#include "p_setup.h"
#include "r_utility.h"
#include "r_sky.h"
#include "d_main.h"
#include "d_dehacked.h"
#include "cmdlib.h"
#include "v_text.h"
#include "gi.h"
#include "a_dynlight.h"
#include "gameconfigfile.h"
#include "sbar.h"
#include "decallib.h"
#include "version.h"
#include "st_start.h"
#include "teaminfo.h"
#include "hardware.h"
#include "sbarinfo.h"
#include "d_net.h"
#include "d_event.h"
#include "d_netinf.h"
#include "m_cheat.h"
#include "m_joy.h"
#include "v_draw.h"
#include "po_man.h"
#include "p_local.h"
#include "autosegs.h"
#include "fragglescript/t_fs.h"
#include "g_levellocals.h"
#include "events.h"
#include "vm.h"
#include "types.h"
#include "i_system.h"
#include "g_cvars.h"
#include "r_data/r_vanillatrans.h"
#include "s_music.h"
#include "swrenderer/r_swcolormaps.h"
#include "findfile.h"
#include "md5.h"
#include "c_buttons.h"
#include "common/scripting/dap/DebugServer.h"
#include "d_buttons.h"
#include "i_interface.h"
#include "animations.h"
#include "texturemanager.h"
#include "d_dehacked.h"
#include "d_main.h"
#include "d_net.h"
#include "d_netinf.h"
#include "decallib.h"
#include "doomdef.h"
#include "doomfont.h"
#include "doommenu.h"
#include "doomstat.h"
#include "engineerrors.h"
#include "events.h"
#include "filesystem.h"
#include "findfile.h"
#include "formats/multipatchtexture.h"
#include "scriptutil.h"
#include "v_palette.h"
#include "texturemanager.h"
#include "fragglescript/t_fs.h"
#include "g_cvars.h"
#include "g_game.h"
#include "g_levellocals.h"
#include "gameconfigfile.h"
#include "gi.h"
#include "gstrings.h"
#include "hu_stuff.h"
#include "hw_clock.h"
#include "hwrenderer/scene/hw_drawinfo.h"
#include "doomfont.h"
#include "i_interface.h"
#include "i_sound.h"
#include "i_system.h"
#include "i_time.h"
#include "i_video.h"
#include "m_argv.h"
#include "m_cheat.h"
#include "m_joy.h"
#include "m_misc.h"
#include "m_random.h"
#include "md5.h"
#include "menu.h"
#include "p_local.h"
#include "p_setup.h"
#include "po_man.h"
#include "r_data/r_vanillatrans.h"
#include "r_sky.h"
#include "r_utility.h"
#include "s_music.h"
#include "s_sound.h"
#include "sbar.h"
#include "sbarinfo.h"
#include "screenjob.h"
#include "startscreen.h"
#include "scriptutil.h"
#include "shiftstate.h"
#include "common/scripting/dap/DebugServer.h"
#include "common/widgets/errorwindow.h"
#include "st_start.h"
#include "st_stuff.h"
#include "startscreen.h"
#include "swrenderer/r_swcolormaps.h"
#include "teaminfo.h"
#include "texturemanager.h"
#include "types.h"
#include "v_draw.h"
#include "v_palette.h"
#include "v_text.h"
#include "v_video.h"
#include "version.h"
#include "vm.h"
#include "wi_stuff.h"
#include "wipe.h"
#include "zwidget/window/window.h"
#ifdef __unix__
#include "i_system.h" // for SHARE_DIR
@ -4139,7 +4133,7 @@ CCMD(fs_dir)
auto fnid = fileSystem.GetResourceId(i);
auto length = fileSystem.FileLength(i);
bool hidden = fileSystem.FindFile(fn1) != i;
Printf(PRINT_HIGH | PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10d %s %s\n", hidden ? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : "");
Printf(PRINT_HIGH | PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10ld %s %s\n", hidden ? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : "");
}
}
@ -4150,6 +4144,6 @@ CCMD(type)
if (lump >= 0)
{
auto data = fileSystem.ReadFile(lump);
Printf("%.*s\n", data.size(), data.string());
Printf("%.*s\n", static_cast<int>(data.size()), data.string());
}
}

View file

@ -26,52 +26,45 @@
//-----------------------------------------------------------------------------
#include <stddef.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "version.h"
#include "menu.h"
#include "i_video.h"
#include "i_net.h"
#include "g_game.h"
#include "c_console.h"
#include "d_netinf.h"
#include "d_net.h"
#include "cmdlib.h"
#include "m_cheat.h"
#include "p_local.h"
#include "c_dispatch.h"
#include "sbar.h"
#include "gi.h"
#include "m_misc.h"
#include "gameconfigfile.h"
#include "p_acs.h"
#include "p_trace.h"
#include "a_sharedglobal.h"
#include "st_start.h"
#include "teaminfo.h"
#include "p_conversation.h"
#include "d_eventbase.h"
#include "p_enemy.h"
#include "m_argv.h"
#include "p_lnspec.h"
#include "p_spec.h"
#include "hardware.h"
#include "r_utility.h"
#include "a_keys.h"
#include "intermission/intermission.h"
#include "g_levellocals.h"
#include "a_sharedglobal.h"
#include "actorinlines.h"
#include "events.h"
#include "i_time.h"
#include "i_system.h"
#include "vm.h"
#include "gstrings.h"
#include "s_music.h"
#include "screenjob.h"
#include "c_dispatch.h"
#include "cmdlib.h"
#include "d_eventbase.h"
#include "d_main.h"
#include "d_net.h"
#include "d_netinf.h"
#include "events.h"
#include "g_game.h"
#include "g_levellocals.h"
#include "gameconfigfile.h"
#include "gi.h"
#include "gstrings.h"
#include "i_interface.h"
#include "i_net.h"
#include "i_system.h"
#include "i_time.h"
#include "m_argv.h"
#include "m_cheat.h"
#include "menu.h"
#include "p_conversation.h"
#include "p_enemy.h"
#include "p_lnspec.h"
#include "p_local.h"
#include "p_spec.h"
#include "p_trace.h"
#include "r_utility.h"
#include "s_music.h"
#include "savegamemanager.h"
#include "sbar.h"
#include "screenjob.h"
#include "version.h"
#include "vm.h"
void P_RunClientsideLogic();
@ -673,7 +666,7 @@ static bool HGetPacket()
size_t sizeCheck = GetNetBufferSize();
if (NetBufferLength != sizeCheck)
{
Printf("Incorrect packet size %d (expected %d)\n", NetBufferLength, sizeCheck);
Printf("Incorrect packet size %zu (expected %zu)\n", NetBufferLength, sizeCheck);
return false;
}

View file

@ -38,36 +38,31 @@
** executable, so it saves space on disk as well as in memory.
*/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "doomtype.h"
#include "doomstat.h"
#include "info.h"
#include "d_dehacked.h"
#include "g_level.h"
#include "cmdlib.h"
#include "gstrings.h"
#include "filesystem.h"
#include "d_player.h"
#include "r_state.h"
#include "c_dispatch.h"
#include "decallib.h"
#include "a_sharedglobal.h"
#include "actorptrselect.h"
#include "cmdlib.h"
#include "codegen.h"
#include "d_dehacked.h"
#include "decallib.h"
#include "doomstat.h"
#include "doomtype.h"
#include "engineerrors.h"
#include "filesystem.h"
#include "g_levellocals.h"
#include "gstrings.h"
#include "info.h"
#include "m_argv.h"
#include "p_effect.h"
#include "r_state.h"
#include "serializer.h"
#include "thingdef.h"
#include "v_text.h"
#include "vmbuilder.h"
#include "types.h"
#include "m_argv.h"
#include "actorptrselect.h"
#include "g_levellocals.h"
#include "codegen.h"
#include "vmbuilder.h"
extern TArray<PalEntry> TranslationColors;
@ -3055,7 +3050,7 @@ static int PatchSoundNames (int dummy, int flags)
stripwhite(Line2);
FString newname = skipwhite (Line2);
ReplaceSoundName((int)strtoll(Line1, nullptr, 10), newname.GetChars());
DPrintf (DMSG_SPAMMY, "Sound %d set to:\n%s\n", Line1, newname.GetChars());
DPrintf (DMSG_SPAMMY, "Sound %p set to:\n%s\n", Line1, newname.GetChars()); // should %p be %s ?
}
return result;
@ -3090,7 +3085,7 @@ static int PatchSpriteNames (int dummy, int flags)
int v = GetSpriteIndex(newname.GetChars());
memcpy(OrgSprNames[line1val].c, sprites[v].name, 5);
DPrintf (DMSG_SPAMMY, "Sprite %d set to:\n%s\n", Line1, newname.GetChars());
DPrintf (DMSG_SPAMMY, "Sprite %p set to:\n%s\n", Line1, newname.GetChars()); // should %p be %s ?
}
return result;

View file

@ -2,14 +2,17 @@
// Globally visible constants.
//
#pragma once
#include "engineerrors.h"
#include "texturemanager.h"
#include "v_font.h"
#define HU_FONTSTART uint8_t('!') // the first font characters
#define HU_FONTEND uint8_t('\377') // the last font characters
// Calculate # of glyphs in font.
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
void InitDoomFonts()
{
// load the heads-up font

View file

@ -1,6 +1,8 @@
#ifndef __A_MORPH__
#define __A_MORPH__
#include "info.h"
#define MORPHTICS (40*TICRATE)
#define MAXMORPHHEALTH 30

View file

@ -37,47 +37,47 @@
#include <assert.h>
#include "templates.h"
#include "doomdef.h"
#include "p_local.h"
#include "d_player.h"
#include "p_spec.h"
#include "p_acs.h"
#include "p_saveg.h"
#include "p_lnspec.h"
#include "p_enemy.h"
#include "a_morph.h"
#include "a_sharedglobal.h"
#include "actorinlines.h"
#include "actorptrselect.h"
#include "c_bind.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "cmdlib.h"
#include "d_player.h"
#include "decallib.h"
#include "doomdef.h"
#include "filesystem.h"
#include "g_game.h"
#include "g_levellocals.h"
#include "gi.h"
#include "gstrings.h"
#include "m_png.h"
#include "p_acs.h"
#include "p_effect.h"
#include "p_enemy.h"
#include "p_lnspec.h"
#include "p_local.h"
#include "p_saveg.h"
#include "p_setup.h"
#include "p_spec.h"
#include "p_terrain.h"
#include "po_man.h"
#include "r_sky.h"
#include "r_utility.h"
#include "s_music.h"
#include "s_sndseq.h"
#include "sbar.h"
#include "a_sharedglobal.h"
#include "filesystem.h"
#include "r_sky.h"
#include "gstrings.h"
#include "gi.h"
#include "g_game.h"
#include "c_bind.h"
#include "cmdlib.h"
#include "m_png.h"
#include "p_setup.h"
#include "po_man.h"
#include "actorptrselect.h"
#include "serializer_doom.h"
#include "serialize_obj.h"
#include "decallib.h"
#include "p_terrain.h"
#include "version.h"
#include "p_effect.h"
#include "r_utility.h"
#include "a_morph.h"
#include "thingdef.h"
#include "g_levellocals.h"
#include "actorinlines.h"
#include "types.h"
#include "scriptutil.h"
#include "s_music.h"
#include "v_video.h"
#include "serialize_obj.h"
#include "serializer_doom.h"
#include "templates.h"
#include "texturemanager.h"
#include "thingdef.h"
#include "types.h"
#include "v_video.h"
#include "version.h"
// P-codes for ACS scripts
enum
@ -470,7 +470,7 @@
PCD_TRANSLATIONRANGE4,
PCD_TRANSLATIONRANGE5,
/*381*/ PCODE_COMMAND_COUNT
/*385*/ PCODE_COMMAND_COUNT
};
// Some constants used by ACS scripts
@ -10880,7 +10880,7 @@ static void ShowProfileData(TArray<ProfileCollector> &profiles, int ilimit,
if (ilimit > 0)
{
Printf(TEXTCOLOR_ORANGE "Top %lld %ss:\n", ilimit, typelabels[functions]);
Printf(TEXTCOLOR_ORANGE "Top %d %ss:\n", ilimit, typelabels[functions]);
limit = (unsigned int)ilimit;
}
else