mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
fix compile errors when -Wall is specified
This commit is contained in:
parent
344cd68cc1
commit
47e42d3f32
@ -39,6 +39,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -60,7 +60,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
else if (argc > sizeof(data))
|
else if (argc > sizeof(data))
|
||||||
{
|
{
|
||||||
printf("Raw command input limit (%d bytes) exceeded\n", sizeof(data));
|
lprintf(LOG_NOTICE, "Raw command input limit (256 bytes) exceeded");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -131,37 +131,37 @@ sdr_convert_sensor_reading(struct sdr_record_full_sensor * sensor,
|
|||||||
case SDR_SENSOR_L_LINEAR:
|
case SDR_SENSOR_L_LINEAR:
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_LN:
|
case SDR_SENSOR_L_LN:
|
||||||
result = log(result);
|
result = logf(result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_LOG10:
|
case SDR_SENSOR_L_LOG10:
|
||||||
result = log10(result);
|
result = log10f(result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_LOG2:
|
case SDR_SENSOR_L_LOG2:
|
||||||
result = log2(result);
|
result = (float)(logf(result) / logf(2.0));
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_E:
|
case SDR_SENSOR_L_E:
|
||||||
result = exp(result);
|
result = expf(result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_EXP10:
|
case SDR_SENSOR_L_EXP10:
|
||||||
result = exp10(result);
|
result = powf(10.0, result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_EXP2:
|
case SDR_SENSOR_L_EXP2:
|
||||||
result = exp2(result);
|
result = powf(2.0, result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_1_X:
|
case SDR_SENSOR_L_1_X:
|
||||||
result = pow(result, -1.0); /*1/x w/o exception*/
|
result = powf(result, -1.0); /*1/x w/o exception*/
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_SQR:
|
case SDR_SENSOR_L_SQR:
|
||||||
result = result * result;
|
result = powf(result, 2.0);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_CUBE:
|
case SDR_SENSOR_L_CUBE:
|
||||||
result = pow(result, 3.0);
|
result = powf(result, 3.0);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_SQRT:
|
case SDR_SENSOR_L_SQRT:
|
||||||
result = sqrt(result);
|
result = sqrtf(result);
|
||||||
break;
|
break;
|
||||||
case SDR_SENSOR_L_CUBERT:
|
case SDR_SENSOR_L_CUBERT:
|
||||||
result = cbrt(result);
|
result = cbrtf(result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf * intf,
|
|||||||
/* only handle linear sensors and linearized sensors (for now) */
|
/* only handle linear sensors and linearized sensors (for now) */
|
||||||
if (sensor->linearization>=SDR_SENSOR_L_NONLINEAR) {
|
if (sensor->linearization>=SDR_SENSOR_L_NONLINEAR) {
|
||||||
printf("sensor %s non-linear!\n", desc);
|
printf("sensor %s non-linear!\n", desc);
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get sensor reading */
|
/* get sensor reading */
|
||||||
|
@ -195,7 +195,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
|||||||
/* only handle linear and linearized sensors (for now) */
|
/* only handle linear and linearized sensors (for now) */
|
||||||
if (sensor->linearization>=SDR_SENSOR_L_NONLINEAR) {
|
if (sensor->linearization>=SDR_SENSOR_L_NONLINEAR) {
|
||||||
printf("sensor %s non-linear!\n", id);
|
printf("sensor %s non-linear!\n", id);
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -36,8 +36,10 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -498,11 +498,11 @@ ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
|
|||||||
printf(" ASF Version %s\n"
|
printf(" ASF Version %s\n"
|
||||||
" RMCP Version %s\n"
|
" RMCP Version %s\n"
|
||||||
" RMCP Sequence %d\n"
|
" RMCP Sequence %d\n"
|
||||||
" IANA Enterprise %ld\n\n",
|
" IANA Enterprise %lu\n\n",
|
||||||
(pong->sup_entities & 0x01) ? "1.0" : "unknown",
|
(pong->sup_entities & 0x01) ? "1.0" : "unknown",
|
||||||
(pong->rmcp.ver == 6) ? "1.0" : "unknown",
|
(pong->rmcp.ver == 6) ? "1.0" : "unknown",
|
||||||
pong->rmcp.seq,
|
pong->rmcp.seq,
|
||||||
ntohl(pong->iana));
|
(unsigned long)ntohl(pong->iana));
|
||||||
|
|
||||||
return (pong->sup_entities & 0x80) ? 1 : 0;
|
return (pong->sup_entities & 0x80) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user