diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index cce4cc4e0..f5dae0af9 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -71,7 +71,7 @@ void InitHash() static unsigned int PkwareBufferRead(char *buf, unsigned int *size, void *param) // NOLINT(readability-non-const-parameter) { - TDataInfo *pInfo = (TDataInfo *)param; + auto *pInfo = (TDataInfo *)param; uint32_t sSize; if (*size >= pInfo->size - pInfo->srcOffset) { @@ -88,7 +88,7 @@ static unsigned int PkwareBufferRead(char *buf, unsigned int *size, void *param) static void PkwareBufferWrite(char *buf, unsigned int *size, void *param) // NOLINT(readability-non-const-parameter) { - TDataInfo *pInfo = (TDataInfo *)param; + auto *pInfo = (TDataInfo *)param; memcpy(pInfo->destData + pInfo->destOffset, buf, *size); pInfo->destOffset += *size; diff --git a/Source/engine/animationinfo.cpp b/Source/engine/animationinfo.cpp index d5cdf9ba0..01c83c6ed 100644 --- a/Source/engine/animationinfo.cpp +++ b/Source/engine/animationinfo.cpp @@ -23,7 +23,7 @@ int AnimationInfo::GetFrameToUseForRendering() const if (CurrentFrame > RelevantFramesForDistributing) return CurrentFrame; - float ticksSinceSequenceStarted = (float)TicksSinceSequenceStarted; + auto ticksSinceSequenceStarted = (float)TicksSinceSequenceStarted; if (TicksSinceSequenceStarted < 0) { ticksSinceSequenceStarted = 0.0F; Log("GetFrameToUseForRendering: Invalid TicksSinceSequenceStarted {}", TicksSinceSequenceStarted); diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 8f3960e98..612d84caf 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -4683,7 +4683,7 @@ void MI_Cbolt(int i) if (missile[i]._miVar3 == 0) { constexpr int bpath[16] = { -1, 0, 1, -1, 0, 1, -1, -1, 0, 0, 1, 1, 0, 1, -1, 0 }; - Direction md = static_cast(missile[i]._miVar2); + auto md = static_cast(missile[i]._miVar2); switch (bpath[missile[i]._mirnd]) { case -1: md = left[md]; diff --git a/Source/storm/storm_sdl_rw.cpp b/Source/storm/storm_sdl_rw.cpp index 49dd22d88..e522902ad 100644 --- a/Source/storm/storm_sdl_rw.cpp +++ b/Source/storm/storm_sdl_rw.cpp @@ -78,7 +78,7 @@ static int SFileRwClose(struct SDL_RWops *context) SDL_RWops *SFileRw_FromStormHandle(HANDLE handle) { - SDL_RWops *result = new SDL_RWops(); + auto *result = new SDL_RWops(); std::memset(result, 0, sizeof(*result)); #ifndef USE_SDL1 diff --git a/Source/sync.cpp b/Source/sync.cpp index b9331cc8a..a8d4ad1c0 100644 --- a/Source/sync.cpp +++ b/Source/sync.cpp @@ -249,7 +249,7 @@ uint32_t sync_update(int pnum, const byte *pbBuf) { uint16_t wLen; - TSyncHeader *pHdr = (TSyncHeader *)pbBuf; + auto *pHdr = (TSyncHeader *)pbBuf; pbBuf += sizeof(*pHdr); if (pHdr->bCmd != CMD_SYNCDATA) { diff --git a/Source/utils/soundsample.cpp b/Source/utils/soundsample.cpp index 24ef4fbbc..0bc26d18b 100644 --- a/Source/utils/soundsample.cpp +++ b/Source/utils/soundsample.cpp @@ -60,7 +60,7 @@ float PanLogToLinear(int logPan) float VolumeLogToLinear(int logVolume, int logMin, int logMax) { - const float logScaled = math::Remap(logMin, logMax, MillibelMin, MillibelMax, logVolume); + const auto logScaled = math::Remap(logMin, logMax, MillibelMin, MillibelMax, logVolume); const auto linVolume = std::pow(LogBase, static_cast(logScaled) / VolumeScale); return linVolume; }