Patch 2: Fix more compilation warnings in ipmi_fru.c
From 92207611b0f311aeb4915256a00bc0380b0a292f Mon Sep 17 00:00:00 2001
From: Dan Gora <d...@adax.com>
Date: Mon, 29 Apr 2013 19:58:44 -0300
Subject: [PATCH 2/6] Fix compilation warnings in lib/ipmi_fru.c.
Fixed some printf formatting warnings.
---
ipmitool/lib/ipmi_fru.c | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/ipmitool/lib/ipmi_fru.c b/ipmitool/lib/ipmi_fru.c
index a6e3fd4..dd4523e 100644
--- a/ipmitool/lib/ipmi_fru.c
+++ b/ipmitool/lib/ipmi_fru.c
@@ -2900,7 +2900,7 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data,
int off, int length)
/* direct desc */
for(j=0; j<direct_cnt; j++){
unsigned char feature, family, accuracy;
- unsigned long freq, min_freq, max_freq;
+ unsigned int freq, min_freq, max_freq;
feature = fru_data[offset++];
family = fru_data[offset++];
@@ -5178,36 +5178,33 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf *
intf, uint8_t fruId,
/* Do not requires any change in other section */
/* Change field length */
- printf("Updating Field : '%s' with '%s' ... (Length from '%x'
to '%x')\n",
- fru_area, f_string, *(fru_data_old +
fru_field_offset_tmp), (0xc0 + strlen(f_string)));
+ printf(
+ "Updating Field : '%s' with '%s' ... (Length from '%d' to '%d')\n",
+ fru_area, f_string,
+ (int)*(fru_data_old + fru_field_offset_tmp),
+ (int)(0xc0 + strlen(f_string)));
*(fru_data_new + fru_field_offset_tmp) = (0xc0 +
strlen(f_string));
memcpy(fru_data_new + fru_field_offset_tmp + 1, f_string,
strlen(f_string));
/* Copy remaing bytes in section */
- #ifdef DBG_RESIZE_FRU
- printf("Copying remaining of sections: %u \n",
- (
- (fru_data_old + header_offset +
fru_section_len - 1)
- -
- (fru_data_old +
fru_field_offset_tmp + strlen(f_string) + 1)
- )
- );
- #endif
+#ifdef DBG_RESIZE_FRU
+ printf("Copying remaining of sections: %d \n",
+ (int)((fru_data_old + header_offset + fru_section_len - 1) -
+ (fru_data_old + fru_field_offset_tmp + strlen(f_string) + 1)));
+#endif
- memcpy(
- (fru_data_new + fru_field_offset_tmp +
1 + strlen(f_string)),
- (fru_data_old + fru_field_offset_tmp +
1 + strlen(fru_area)),
- (
- (fru_data_old + header_offset +
fru_section_len - 1)
- -
- (fru_data_old +
fru_field_offset_tmp + strlen(f_string) + 1)
- )
- );
+ memcpy((fru_data_new + fru_field_offset_tmp + 1 +
+ strlen(f_string)),
+ (fru_data_old + fru_field_offset_tmp + 1 +
+ strlen(fru_area)),
+ ((fru_data_old + header_offset + fru_section_len - 1) -
+ (fru_data_old + fru_field_offset_tmp + strlen(f_string) + 1)));
/* Add Padding if required */
for(counter = 0; counter < padding_len; counter ++)
{
- *(fru_data_new + header_offset + fru_section_len - 1 -
padding_len+ counter) = 0;
+ *(fru_data_new + header_offset + fru_section_len - 1 -
+ padding_len + counter) = 0;
}
/* Calculate New Checksum */
--
1.7.11
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel