cppcheck fixes

This commit is contained in:
Isaac Connor 2022-01-10 17:35:11 -05:00
parent 9f86fd3b16
commit 78a10b6095
1 changed files with 4 additions and 3 deletions

View File

@ -120,9 +120,6 @@ std::string Join(const StringVector &values, const std::string &delim) {
std::string stringtf(const char* format, ...) { std::string stringtf(const char* format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
va_list args2;
va_copy(args2, args);
int size = vsnprintf(nullptr, 0, format, args) + 1; // Extra space for '\0' int size = vsnprintf(nullptr, 0, format, args) + 1; // Extra space for '\0'
va_end(args); va_end(args);
@ -131,6 +128,8 @@ std::string stringtf(const char* format, ...) {
} }
std::unique_ptr<char[]> buf(new char[size]); std::unique_ptr<char[]> buf(new char[size]);
va_list args2;
va_copy(args2, args);
vsnprintf(buf.get(), size, format, args2); vsnprintf(buf.get(), size, format, args2);
va_end(args2); va_end(args2);
@ -259,6 +258,8 @@ void HwCapsDetect() {
unsigned long auxval = 0; unsigned long auxval = 0;
elf_aux_info(AT_HWCAP, &auxval, sizeof(auxval)); elf_aux_info(AT_HWCAP, &auxval, sizeof(auxval));
if (auxval & HWCAP_NEON) { if (auxval & HWCAP_NEON) {
#else
{
#error Unsupported OS. #error Unsupported OS.
#endif #endif
Debug(1,"Detected ARM (AArch32) processor with Neon"); Debug(1,"Detected ARM (AArch32) processor with Neon");