mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
- fixed several warnings emitted by Clang.
This commit is contained in:
parent
9c3907136d
commit
47b76180d6
12 changed files with 21 additions and 16 deletions
|
@ -569,7 +569,7 @@ inline RenderPassBegin& RenderPassBegin::Framebuffer(VulkanFramebuffer* framebuf
|
|||
inline RenderPassBegin& RenderPassBegin::AddClearColor(float r, float g, float b, float a)
|
||||
{
|
||||
VkClearValue clearValue = { };
|
||||
clearValue.color = { r, g, b, a };
|
||||
clearValue.color = { { r, g, b, a } };
|
||||
clearValues.push_back(clearValue);
|
||||
|
||||
renderPassInfo.clearValueCount = (uint32_t)clearValues.size();
|
||||
|
|
|
@ -410,7 +410,7 @@ static FString ReplayGainHash(ZMusicCustomReader* reader, int flength, int playe
|
|||
|
||||
for (size_t j = 0; j < sizeof(digest); ++j)
|
||||
{
|
||||
sprintf(digestout + (j * 2), "%02X", digest[j]);
|
||||
snprintf(digestout + (j * 2), 3, "%02X", digest[j]);
|
||||
}
|
||||
digestout[32] = 0;
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, bool quiet, L
|
|||
|
||||
for (size_t j = 0; j < sizeof(cksum); ++j)
|
||||
{
|
||||
sprintf(cksumout + (j * 2), "%02X", cksum[j]);
|
||||
snprintf(cksumout + (j * 2), 3, "%02X", cksum[j]);
|
||||
}
|
||||
|
||||
fprintf(hashfile, "file: %s, hash: %s, size: %d\n", filename, cksumout, (int)filereader.GetLength());
|
||||
|
@ -417,7 +417,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, bool quiet, L
|
|||
|
||||
for (size_t j = 0; j < sizeof(cksum); ++j)
|
||||
{
|
||||
sprintf(cksumout + (j * 2), "%02X", cksum[j]);
|
||||
snprintf(cksumout + (j * 2), 3, "%02X", cksum[j]);
|
||||
}
|
||||
|
||||
fprintf(hashfile, "file: %s, lump: %s, hash: %s, size: %d\n", filename, lump->getName(), cksumout, lump->LumpSize);
|
||||
|
|
|
@ -528,15 +528,15 @@ const TArray<VSMatrix> IQMModel::CalculateBones(int frame1, int frame2, double i
|
|||
const TArray<TRS>& animationFrames = animationData ? *animationData : TRSData;
|
||||
if (Joints.Size() > 0)
|
||||
{
|
||||
int numbones = Joints.Size();
|
||||
int numbones = Joints.SSize();
|
||||
|
||||
if (boneComponentData->trscomponents[index].Size() != numbones)
|
||||
if (boneComponentData->trscomponents[index].SSize() != numbones)
|
||||
boneComponentData->trscomponents[index].Resize(numbones);
|
||||
if (boneComponentData->trsmatrix[index].Size() != numbones)
|
||||
if (boneComponentData->trsmatrix[index].SSize() != numbones)
|
||||
boneComponentData->trsmatrix[index].Resize(numbones);
|
||||
|
||||
frame1 = clamp(frame1, 0, ((int)animationFrames.Size() - 1) / numbones);
|
||||
frame2 = clamp(frame2, 0, ((int)animationFrames.Size() - 1) / numbones);
|
||||
frame1 = clamp(frame1, 0, (animationFrames.SSize() - 1) / numbones);
|
||||
frame2 = clamp(frame2, 0, (animationFrames.SSize() - 1) / numbones);
|
||||
|
||||
int offset1 = frame1 * numbones;
|
||||
int offset2 = frame2 * numbones;
|
||||
|
|
|
@ -405,7 +405,7 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||
SendDlgItemMessage( hDlg, IDC_WELCOME_WIDESCREEN, BM_SETCHECK, (flags & 8) ? BST_CHECKED : BST_UNCHECKED, 0 );
|
||||
|
||||
// Set up our version string.
|
||||
sprintf(szString, "Version %s.", GetVersionString());
|
||||
snprintf(szString, sizeof(szString), "Version %s.", GetVersionString());
|
||||
SetDlgItemTextA (hDlg, IDC_WELCOME_VERSION, szString);
|
||||
|
||||
// Populate the list with all the IWADs found
|
||||
|
|
|
@ -52,7 +52,7 @@ VkRenderPassManager::VkRenderPassManager(VulkanRenderDevice* fb) : fb(fb)
|
|||
{
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(fr.GetLength());
|
||||
if (fr.Read(data.data(), data.size()) == data.size())
|
||||
if (fr.Read(data.data(), data.size()) == (FileReader::Size)data.size())
|
||||
{
|
||||
builder.InitialData(data.data(), data.size());
|
||||
}
|
||||
|
|
|
@ -580,6 +580,10 @@ public:
|
|||
{
|
||||
return Count;
|
||||
}
|
||||
int SSize() const
|
||||
{
|
||||
return (int)Count;
|
||||
}
|
||||
unsigned int Max () const
|
||||
{
|
||||
return Most;
|
||||
|
|
|
@ -52,6 +52,7 @@ struct FWeaponSlots
|
|||
{
|
||||
FWeaponSlots() { Clear(); }
|
||||
FWeaponSlots(const FWeaponSlots &other) = default;
|
||||
FWeaponSlots& operator=(const FWeaponSlots& other) = default;
|
||||
|
||||
private:
|
||||
FWeaponSlot Slots[NUM_WEAPON_SLOTS];
|
||||
|
|
|
@ -102,7 +102,7 @@ struct svalue_t
|
|||
}
|
||||
|
||||
svalue_t(const svalue_t & other) = default;
|
||||
|
||||
svalue_t& operator=(const svalue_t& other) = default;
|
||||
void setInt(int ip)
|
||||
{
|
||||
value.i = ip;
|
||||
|
|
|
@ -1344,7 +1344,7 @@ void DoomSoundEngine::PrintSoundList()
|
|||
const sfxinfo_t* sfx = soundEngine->GetSfx(FSoundID::fromInt(i));
|
||||
if (sfx->bRandomHeader)
|
||||
{
|
||||
Printf("%3d. %s -> #%d {", i, sfx->name.GetChars(), sfx->link);
|
||||
Printf("%3d. %s -> #%d {", i, sfx->name.GetChars(), sfx->link.index());
|
||||
const FRandomSoundList* list = &S_rnd[sfx->link.index()];
|
||||
for (auto& me : list->Choices)
|
||||
{
|
||||
|
@ -1354,7 +1354,7 @@ void DoomSoundEngine::PrintSoundList()
|
|||
}
|
||||
else if (sfx->UserData[0] & SND_PlayerReserve)
|
||||
{
|
||||
Printf("%3d. %s <<player sound %d>>\n", i, sfx->name.GetChars(), sfx->link);
|
||||
Printf("%3d. %s <<player sound %d>>\n", i, sfx->name.GetChars(), sfx->link.index());
|
||||
}
|
||||
else if (S_sfx[i].lumpnum != -1)
|
||||
{
|
||||
|
|
|
@ -218,7 +218,7 @@ void FEventTree::PrintTree (const FEvent *event) const
|
|||
if (event != &Nil)
|
||||
{
|
||||
PrintTree(event->Left);
|
||||
sprintf(buff, " Distance %g, vertex %d, seg %u\n",
|
||||
snprintf(buff, sizeof(buff), " Distance %g, vertex %d, seg %u\n",
|
||||
g_sqrt(event->Distance/4294967296.0), event->Info.Vertex, (unsigned)event->Info.FrontSeg);
|
||||
Printf(PRINT_LOG, "%s", buff);
|
||||
PrintTree(event->Right);
|
||||
|
|
|
@ -99,7 +99,7 @@ void FNodeBuilder::FixSplitSharers (const node_t &node)
|
|||
|
||||
// Use the CRT's printf so the formatting matches ZDBSP's
|
||||
D(char buff[200]);
|
||||
D(sprintf(buff, "Considering events on seg %d(%d[%d,%d]->%d[%d,%d]) [%g:%g]\n", seg,
|
||||
D(snprintf(buff, sizeof(buff), "Considering events on seg %d(%d[%d,%d]->%d[%d,%d]) [%g:%g]\n", seg,
|
||||
Segs[seg].v1,
|
||||
Vertices[Segs[seg].v1].x>>16,
|
||||
Vertices[Segs[seg].v1].y>>16,
|
||||
|
|
Loading…
Reference in a new issue