mirror of
https://github.com/aristocratos/btop.git
synced 2024-09-29 22:51:35 +02:00
fix some warnings
This commit is contained in:
parent
4d8aa6b118
commit
d17e1a2dac
@ -37,7 +37,7 @@ static UInt32 _strtoul(char *str, int size, int base) {
|
|||||||
|
|
||||||
static void _ultostr(char *str, UInt32 val) {
|
static void _ultostr(char *str, UInt32 val) {
|
||||||
str[0] = '\0';
|
str[0] = '\0';
|
||||||
sprintf(str, "%c%c%c%c",
|
snprintf(str, 5, "%c%c%c%c",
|
||||||
(unsigned int)val >> 24,
|
(unsigned int)val >> 24,
|
||||||
(unsigned int)val >> 16,
|
(unsigned int)val >> 16,
|
||||||
(unsigned int)val >> 8,
|
(unsigned int)val >> 8,
|
||||||
@ -47,10 +47,8 @@ static void _ultostr(char *str, UInt32 val) {
|
|||||||
namespace Cpu {
|
namespace Cpu {
|
||||||
|
|
||||||
SMCConnection::SMCConnection() {
|
SMCConnection::SMCConnection() {
|
||||||
IOMasterPort(kIOMasterPortDefault, &masterPort);
|
|
||||||
|
|
||||||
CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC");
|
CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC");
|
||||||
result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator);
|
result = IOServiceGetMatchingServices(0, matchingDictionary, &iterator);
|
||||||
if (result != kIOReturnSuccess) {
|
if (result != kIOReturnSuccess) {
|
||||||
throw std::runtime_error("failed to get AppleSMC");
|
throw std::runtime_error("failed to get AppleSMC");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user