mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 02:57:22 +00:00
use uint32_t instead of unsigned long so we're 64bit safe
This commit is contained in:
parent
84cd061ad4
commit
3b17fb7dd8
@ -36,15 +36,16 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <ipmitool/helper.h>
|
#include <ipmitool/helper.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
unsigned long buf2long(unsigned char * buf)
|
uint32_t buf2long(unsigned char * buf)
|
||||||
{
|
{
|
||||||
return (unsigned long)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
|
return (uint32_t)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short buf2short(unsigned char * buf)
|
unsigned short buf2short(unsigned char * buf)
|
||||||
|
@ -134,7 +134,7 @@ static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
|||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
unsigned long count;
|
uint32_t count;
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||||
@ -148,7 +148,7 @@ static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
|||||||
memcpy(&count, rsp->data+1, 4);
|
memcpy(&count, rsp->data+1, 4);
|
||||||
|
|
||||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||||
count, (unsigned long)(count / 24), (unsigned long)(count % 24));
|
count, (uint32_t)(count / 24), (uint32_t)(count % 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||||
|
@ -228,7 +228,7 @@ ipmi_sel_get_std_entry(struct ipmi_intf * intf, unsigned short * next_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
ipmi_sel_timestamp(unsigned long stamp)
|
ipmi_sel_timestamp(uint32_t stamp)
|
||||||
{
|
{
|
||||||
static unsigned char tbuf[40];
|
static unsigned char tbuf[40];
|
||||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&stamp));
|
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&stamp));
|
||||||
@ -236,7 +236,7 @@ ipmi_sel_timestamp(unsigned long stamp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
ipmi_sel_timestamp_date(unsigned long stamp)
|
ipmi_sel_timestamp_date(uint32_t stamp)
|
||||||
{
|
{
|
||||||
static unsigned char tbuf[11];
|
static unsigned char tbuf[11];
|
||||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&stamp));
|
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&stamp));
|
||||||
@ -244,7 +244,7 @@ ipmi_sel_timestamp_date(unsigned long stamp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
ipmi_sel_timestamp_time(unsigned long stamp)
|
ipmi_sel_timestamp_time(uint32_t stamp)
|
||||||
{
|
{
|
||||||
static unsigned char tbuf[9];
|
static unsigned char tbuf[9];
|
||||||
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&stamp));
|
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&stamp));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user