From c830ed59c344bce4770055cb904cb899db2884bd Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 4 Nov 2011 11:30:57 +0000 Subject: [PATCH] client: fix errors in (currently unused) get_max_cpu_temperature() code for Macintosh svn path=/trunk/boinc/; revision=24526 --- checkin_notes | 7 +++++++ client/hostinfo_unix.cpp | 32 +++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/checkin_notes b/checkin_notes index 989b910ee6..0118e9d77c 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8104,3 +8104,10 @@ Charlie 5 Nov 2011 mac_build/ boinc.xcodeproj/ project.pbxproj + +Charlie 5 Nov 2011 + - client: fix errors in (currently unused) get_max_cpu_temperature() + code for Macintosh. + + client/ + hostinfo_unix.cpp diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 4737d657ea..c6995336b8 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -986,25 +986,27 @@ kern_return_t SMCReadKey(UInt32 key, SMCBytes_t val) { memset(&inputStructure, 0, sizeof(inputStructure)); memset(&outputStructure, 0, sizeof(outputStructure)); - memset(val, 0, sizeof(val)); + memset(val, 0, sizeof(SMCBytes_t)); inputStructure.key = key; inputStructure.data8 = SMC_CMD_READ_KEYINFO; -#if MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 result = IOConnectCallStructMethod(conn, KERNEL_INDEX_SMC, &inputStructure, sizeof(inputStructure), - &inputStructure, - &structureOutputSize); + &outputStructure, + &structureOutputSize + ); #else result = IOConnectMethodStructureIStructureO(conn, KERNEL_INDEX_SMC, sizeof(inputStructure), &structureOutputSize, &inputStructure, - &outputStructure); + &outputStructure + ); #endif if (result != kIOReturnSuccess) { return result; @@ -1013,18 +1015,22 @@ kern_return_t SMCReadKey(UInt32 key, SMCBytes_t val) { inputStructure.keyInfo.dataSize = outputStructure.keyInfo.dataSize; inputStructure.data8 = SMC_CMD_READ_BYTES; -#if MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 result = IOConnectCallStructMethod(conn, KERNEL_INDEX_SMC, &inputStructure, sizeof(inputStructure), - &inputStructure, - &structureOutputSize); + &outputStructure, + &structureOutputSize + ); #else - result = IOConnectMethodStructureIStructureO( - conn, KERNEL_INDEX_SMC, sizeof(inputStructure), &structureOutputSize), - &inputStructure, &outputStructure - ); + result = IOConnectMethodStructureIStructureO(conn, + KERNEL_INDEX_SMC, + sizeof(inputStructure), + &structureOutputSize, + &inputStructure, + &outputStructure + ); #endif if (result != kIOReturnSuccess) { return result; @@ -1091,7 +1097,7 @@ int get_max_cpu_temperature() { #else // PowerPC -int GetMaxCPUTemperature() { +int get_max_cpu_temperature() { return 0; }