From d924560af0dfa4f797f1fae40b52297c432e53e6 Mon Sep 17 00:00:00 2001 From: amerhifi Date: Thu, 16 May 2019 14:36:31 -0700 Subject: [PATCH] undoing test code for gcc warnings --- libraries/platform/src/AndroidPlatform.cpp | 16 ++++++++-------- libraries/platform/src/LinuxPlatform.cpp | 16 ++++++++-------- libraries/platform/src/MACOSPlatform.cpp | 16 ++++++++-------- libraries/platform/src/WINPlatform.cpp | 16 ++++++++-------- libraries/platform/src/platformJsonKeys.h | 3 +++ 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/libraries/platform/src/AndroidPlatform.cpp b/libraries/platform/src/AndroidPlatform.cpp index 58274df9f5..4351b14688 100644 --- a/libraries/platform/src/AndroidPlatform.cpp +++ b/libraries/platform/src/AndroidPlatform.cpp @@ -15,19 +15,19 @@ using namespace platform; void AndroidInstance::enumerateCpu() { json cpu; - cpu[jsonKeys::cpuBrand] = ""; - cpu[jsonKeys::cpuModel] = ""; - cpu[jsonKeys::cpuClockSpeed] = ""; - cpu[jsonKeys::cpuNumCores] = ""; + cpu["cpuBrand"] = ""; + cpu["cpuModel"] = ""; + cpu["cpuClockSpeed"] = ""; + cpu["cpuNumCores"] = ""; _cpu.push_back(cpu); } void AndroidInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); - gpu[jsonKeys::gpuMemory] = ident->getMemory(); - gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + gpu["gpuName"] = ident->getName().toUtf8().constData(); + gpu["gpuMemory"] = ident->getMemory(); + gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -35,6 +35,6 @@ void AndroidInstance::enumerateGpu() { void AndroidInstance::enumerateMemory() { json ram = {}; - ram[jsonKeys::totalMemory]=""; + ram["totalMemory"]=""; _memory.push_back(ram); } diff --git a/libraries/platform/src/LinuxPlatform.cpp b/libraries/platform/src/LinuxPlatform.cpp index b22344e728..01d89a4462 100644 --- a/libraries/platform/src/LinuxPlatform.cpp +++ b/libraries/platform/src/LinuxPlatform.cpp @@ -15,10 +15,10 @@ using namespace platform; void LinuxInstance::enumerateCpu() { json cpu = {}; - cpu[jsonKeys::cpuBrand] = ""; - cpu[jsonKeys::cpuModel] = ""; - cpu[jsonKeys::cpuClockSpeed] = ""; - cpu[jsonKeys::cpuNumCores] = ""; + cpu["cpuBrand"] = ""; + cpu["cpuModel"] = ""; + cpu["cpuClockSpeed"] = ""; + cpu["cpuNumCores"] = ""; _cpu.push_back(cpu); } @@ -26,9 +26,9 @@ void LinuxInstance::enumerateCpu() { void LinuxInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); - gpu[jsonKeys::gpuMemory] = ident->getMemory(); - gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + gpu["gpuName"] = ident->getName().toUtf8().constData(); + gpu["gpuMemory"] = ident->getMemory(); + gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -36,7 +36,7 @@ void LinuxInstance::enumerateGpu() { void LinuxInstance::enumerateMemory() { json ram = {}; - ram[jsonKeys::totalMemory]=""; + ram["totalMemory"]=""; _memory.push_back(ram); } diff --git a/libraries/platform/src/MACOSPlatform.cpp b/libraries/platform/src/MACOSPlatform.cpp index 6b2e39bac5..151df96719 100644 --- a/libraries/platform/src/MACOSPlatform.cpp +++ b/libraries/platform/src/MACOSPlatform.cpp @@ -58,10 +58,10 @@ void MACOSInstance::enumerateCpu() { } } - cpu[jsonKeys::cpuBrand] = CPUBrandString; - cpu[jsonKeys::cpuModel] = CPUModelString; - cpu[jsonKeys::cpuClockSpeed] = CPUClockString; - cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); + cpu["cpuBrand"] = CPUBrandString; + cpu["cpuModel"] = CPUModelString; + cpu["cpuClockSpeed"] = CPUClockString; + cpu["cpuNumCores"] = std::thread::hardware_concurrency(); _cpu.push_back(cpu); @@ -79,9 +79,9 @@ void MACOSInstance::enumerateCpu() { void MACOSInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); - gpu[jsonKeys::gpuMemory] = ident->getMemory(); - gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + gpu["gpuName"] = ident->getName().toUtf8().constData(); + gpu["gpuMemory"] = ident->getMemory(); + gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -94,7 +94,7 @@ void MACOSInstance::enumerateMemory() { #ifdef Q_OS_MAC long pages = sysconf(_SC_PHYS_PAGES); long page_size = sysconf(_SC_PAGE_SIZE); - ram[jsonKeys::totalMemory] = pages * page_size;; + ram["totalMemory"] = pages * page_size;; #endif _memory.push_back(ram); } diff --git a/libraries/platform/src/WINPlatform.cpp b/libraries/platform/src/WINPlatform.cpp index cc10b47442..b39c83889b 100644 --- a/libraries/platform/src/WINPlatform.cpp +++ b/libraries/platform/src/WINPlatform.cpp @@ -47,10 +47,10 @@ void WINInstance::enumerateCpu() { } } - cpu[platform::json::cpuBrand] = CPUBrandString; - cpu[jsonKeys::cpuModel] = CPUModelString; - cpu[jsonKeys::cpuClockSpeed] = CPUClockString; - cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); + cpu["cpuBrand"] = CPUBrandString; + cpu["cpuModel"] = CPUModelString; + cpu["cpuClockSpeed"] = CPUClockString; + cpu["cpuNumCores"] = std::thread::hardware_concurrency(); #endif _cpu.push_back(cpu); @@ -61,9 +61,9 @@ void WINInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); - gpu[jsonKeys::gpuMemory] = ident->getMemory(); - gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); + gpu["gpuName"] = ident->getName().toUtf8().constData(); + gpu["gpuMemory"] = ident->getMemory(); + gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -77,7 +77,7 @@ void WINInstance::enumerateMemory() { statex.dwLength = sizeof(statex); GlobalMemoryStatusEx(&statex); int totalRam = statex.ullTotalPhys / 1024 / 1024; - ram[jsonKeys::totalMemory] = totalRam; + ram["totalMemory"] = totalRam; #endif _memory.push_back(ram); } diff --git a/libraries/platform/src/platformJsonKeys.h b/libraries/platform/src/platformJsonKeys.h index a46d5e5b89..629aa30e34 100644 --- a/libraries/platform/src/platformJsonKeys.h +++ b/libraries/platform/src/platformJsonKeys.h @@ -11,6 +11,7 @@ namespace platform { namespace jsonKeys{ +#if 0 static const char* cpuBrand { "cpuBrand"}; static const char* cpuModel {"cpuModel"}; static const char* cpuClockSpeed {"clockSpeed"}; @@ -25,6 +26,8 @@ namespace platform { static const char* displayCoordsRight { "coordinatesright"}; static const char* displayCoordsTop { "coordinatestop"}; static const char* displayCoordsBottom { "coordinatesbottom"}; +#endif + } } // namespace platform