Remove the SZFMT macro

C++11 mandates the %zu/d formatter
This commit is contained in:
Chris Robinson 2019-04-11 16:01:11 -07:00
parent 8215251571
commit 4b95d310ae
5 changed files with 23 additions and 31 deletions

View File

@ -1928,8 +1928,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
/* Allocate extra channels for any post-filter output. */
const ALsizei num_chans{device->Dry.NumChannels + device->RealOut.NumChannels};
TRACE("Allocating %d channels, " SZFMT " bytes\n", num_chans,
num_chans*sizeof(device->MixBuffer[0]));
TRACE("Allocating %d channels, %zu bytes\n", num_chans,
num_chans*sizeof(device->MixBuffer[0]));
device->MixBuffer.resize(num_chans);
device->Dry.Buffer = &reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(device->MixBuffer[0]);
@ -2207,21 +2207,21 @@ ALCdevice::~ALCdevice()
{ return cur + POPCNT64(~sublist.FreeMask); }
)};
if(count > 0)
WARN(SZFMT " Buffer%s not deleted\n", count, (count==1)?"":"s");
WARN("%zu Buffer%s not deleted\n", count, (count==1)?"":"s");
count = std::accumulate(EffectList.cbegin(), EffectList.cend(), size_t{0u},
[](size_t cur, const EffectSubList &sublist) noexcept -> size_t
{ return cur + POPCNT64(~sublist.FreeMask); }
);
if(count > 0)
WARN(SZFMT " Effect%s not deleted\n", count, (count==1)?"":"s");
WARN("%zu Effect%s not deleted\n", count, (count==1)?"":"s");
count = std::accumulate(FilterList.cbegin(), FilterList.cend(), size_t{0u},
[](size_t cur, const FilterSubList &sublist) noexcept -> size_t
{ return cur + POPCNT64(~sublist.FreeMask); }
);
if(count > 0)
WARN(SZFMT " Filter%s not deleted\n", count, (count==1)?"":"s");
WARN("%zu Filter%s not deleted\n", count, (count==1)?"":"s");
if(mHrtf)
mHrtf->DecRef();
@ -2379,14 +2379,14 @@ ALCcontext::~ALCcontext()
cprops = next;
++count;
}
TRACE("Freed " SZFMT " context property object%s\n", count, (count==1)?"":"s");
TRACE("Freed %zu context property object%s\n", count, (count==1)?"":"s");
count = std::accumulate(SourceList.cbegin(), SourceList.cend(), size_t{0u},
[](size_t cur, const SourceSubList &sublist) noexcept -> size_t
{ return cur + POPCNT64(~sublist.FreeMask); }
);
if(count > 0)
WARN(SZFMT " Source%s not deleted\n", count, (count==1)?"":"s");
WARN("%zu Source%s not deleted\n", count, (count==1)?"":"s");
SourceList.clear();
NumSources = 0;
@ -2400,7 +2400,7 @@ ALCcontext::~ALCcontext()
eprops = next;
++count;
}
TRACE("Freed " SZFMT " AuxiliaryEffectSlot property object%s\n", count, (count==1)?"":"s");
TRACE("Freed %zu AuxiliaryEffectSlot property object%s\n", count, (count==1)?"":"s");
delete ActiveAuxSlots.exchange(nullptr, std::memory_order_relaxed);
DefaultSlot = nullptr;
@ -2410,7 +2410,7 @@ ALCcontext::~ALCcontext()
{ return cur + POPCNT64(~sublist.FreeMask); }
);
if(count > 0)
WARN(SZFMT " AuxiliaryEffectSlot%s not deleted\n", count, (count==1)?"":"s");
WARN("%zu AuxiliaryEffectSlot%s not deleted\n", count, (count==1)?"":"s");
EffectSlotList.clear();
NumEffectSlots = 0;
@ -2423,7 +2423,7 @@ ALCcontext::~ALCcontext()
vprops = next;
++count;
}
TRACE("Freed " SZFMT " voice property object%s\n", count, (count==1)?"":"s");
TRACE("Freed %zu voice property object%s\n", count, (count==1)?"":"s");
std::for_each(Voices, Voices + MaxVoices, DeinitVoice);
al_free(Voices);
@ -2446,7 +2446,7 @@ ALCcontext::~ALCcontext()
lprops = next;
++count;
}
TRACE("Freed " SZFMT " listener property object%s\n", count, (count==1)?"":"s");
TRACE("Freed %zu listener property object%s\n", count, (count==1)?"":"s");
if(AsyncEvents)
{
@ -2467,7 +2467,7 @@ ALCcontext::~ALCcontext()
++count;
}
if(count > 0)
TRACE("Destructed " SZFMT " orphaned event%s\n", count, (count==1)?"":"s");
TRACE("Destructed %zu orphaned event%s\n", count, (count==1)?"":"s");
}
ALCdevice_DecRef(Device);

View File

@ -91,15 +91,15 @@ bool load_ambdec_speakers(al::vector<AmbDecConf::SpeakerConf> &spkrs, const std:
const size_t spkr_num{spkrs.size()};
istr >> spkr.Name;
if(istr.fail()) WARN("Name not specified for speaker " SZFMT "\n", spkr_num);
if(istr.fail()) WARN("Name not specified for speaker %zu\n", spkr_num);
istr >> spkr.Distance;
if(istr.fail()) WARN("Distance not specified for speaker " SZFMT "\n", spkr_num);
if(istr.fail()) WARN("Distance not specified for speaker %zu\n", spkr_num);
istr >> spkr.Azimuth;
if(istr.fail()) WARN("Azimuth not specified for speaker " SZFMT "\n", spkr_num);
if(istr.fail()) WARN("Azimuth not specified for speaker %zu\n", spkr_num);
istr >> spkr.Elevation;
if(istr.fail()) WARN("Elevation not specified for speaker " SZFMT "\n", spkr_num);
if(istr.fail()) WARN("Elevation not specified for speaker %zu\n", spkr_num);
istr >> spkr.Connection;
if(istr.fail()) TRACE("Connection not specified for speaker " SZFMT "\n", spkr_num);
if(istr.fail()) TRACE("Connection not specified for speaker %zu\n", spkr_num);
}
else
{
@ -149,7 +149,7 @@ bool load_ambdec_matrix(float (&gains)[MAX_AMBI_ORDER+1], al::vector<AmbDecConf:
if(istr.fail()) break;
if(!istr.eof() && !std::isspace(istr.peek()))
{
ERR("Extra junk on gain " SZFMT ": %s\n", curgain+1,
ERR("Extra junk on gain %zu: %s\n", curgain+1,
buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return false;
}
@ -171,7 +171,7 @@ bool load_ambdec_matrix(float (&gains)[MAX_AMBI_ORDER+1], al::vector<AmbDecConf:
if(istr.fail()) break;
if(!istr.eof() && !std::isspace(istr.peek()))
{
ERR("Extra junk on matrix element " SZFMT "x" SZFMT ": %s\n", curidx,
ERR("Extra junk on matrix element %zux%zu: %s\n", curidx,
matrix.size(), buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
matrix.pop_back();
return false;

View File

@ -626,7 +626,7 @@ std::unique_ptr<HrtfEntry> LoadHrtf00(std::istream &data, const char *filename)
}
if(irCount <= evOffset.back())
{
ERR("Invalid evOffset: evOffset[" SZFMT "]=%d (irCount=%d)\n",
ERR("Invalid evOffset: evOffset[%zu]=%d (irCount=%d)\n",
evOffset.size()-1, evOffset.back(), irCount);
failed = AL_TRUE;
}
@ -647,7 +647,7 @@ std::unique_ptr<HrtfEntry> LoadHrtf00(std::istream &data, const char *filename)
azCount.back() = irCount - evOffset.back();
if(azCount.back() < MIN_AZ_COUNT || azCount.back() > MAX_AZ_COUNT)
{
ERR("Unsupported azimuth count: azCount[" SZFMT "]=%d (%d to %d)\n",
ERR("Unsupported azimuth count: azCount[%zu]=%d (%d to %d)\n",
azCount.size()-1, azCount.back(), MIN_AZ_COUNT, MAX_AZ_COUNT);
failed = AL_TRUE;
}
@ -1297,7 +1297,7 @@ HrtfEntry *GetLoadedHrtf(HrtfHandle *handle)
char magic[sizeof(magicMarker02)];
stream->read(magic, sizeof(magic));
if(stream->gcount() < static_cast<std::streamsize>(sizeof(magicMarker02)))
ERR("%s data is too short (" SZFMT " bytes)\n", name, stream->gcount());
ERR("%s data is too short (%zu bytes)\n", name, stream->gcount());
else if(memcmp(magic, magicMarker02, sizeof(magicMarker02)) == 0)
{
TRACE("Detected data set format v2\n");

View File

@ -6,14 +6,6 @@
#include "opthelpers.h"
#if defined(_WIN64)
#define SZFMT "%I64u"
#elif defined(_WIN32)
#define SZFMT "%u"
#else
#define SZFMT "%zu"
#endif
#ifdef __GNUC__
#define DECL_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else

View File

@ -812,7 +812,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appr
if(!conf.load(fname))
ERR("Failed to load layout file %s\n", fname);
else if(conf.Speakers.size() > MAX_OUTPUT_CHANNELS)
ERR("Unsupported speaker count " SZFMT " (max %d)\n", conf.Speakers.size(),
ERR("Unsupported speaker count %zu (max %d)\n", conf.Speakers.size(),
MAX_OUTPUT_CHANNELS);
else if(conf.ChanMask > AMBI_3ORDER_MASK)
ERR("Unsupported channel mask 0x%04x (max 0x%x)\n", conf.ChanMask,