From 956b421ef8e80c1015d38063852af1da2096721c Mon Sep 17 00:00:00 2001 From: Jean-Michel Audet Date: Tue, 10 Feb 2009 20:47:47 +0000 Subject: [PATCH] - Clean most of the warnings --- ipmitool/lib/ipmi_fru.c | 67 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/ipmitool/lib/ipmi_fru.c b/ipmitool/lib/ipmi_fru.c index 1111f5c..7bf3766 100644 --- a/ipmitool/lib/ipmi_fru.c +++ b/ipmitool/lib/ipmi_fru.c @@ -298,7 +298,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, fru_data = malloc(fru->size + 1); if (fru_data == NULL) { lprintf(LOG_ERR, " Out of memory!"); - return; + return NULL; } memset(fru_data, 0, fru->size + 1); @@ -355,10 +355,10 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, // Common header bloc_count = 0; - + p_bloc[bloc_count].start= 0; p_bloc[bloc_count].size = 8; - strcpy(p_bloc[bloc_count].blocId, "Common Header Section"); + strcpy((char *)p_bloc[bloc_count].blocId, "Common Header Section"); bloc_count ++; // Internal @@ -366,7 +366,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, { p_bloc[bloc_count].start = (header.offset.internal * 8); p_bloc[bloc_count].size = 0; // Will be fillup later - strcpy(p_bloc[bloc_count].blocId, "Internal Use Section"); + strcpy((char *)p_bloc[bloc_count].blocId, "Internal Use Section"); bloc_count ++; } // Chassis @@ -374,7 +374,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, { p_bloc[bloc_count].start = (header.offset.chassis * 8); p_bloc[bloc_count].size = 0; // Will be fillup later - strcpy(p_bloc[bloc_count].blocId, "Chassis Section"); + strcpy((char *)p_bloc[bloc_count].blocId, "Chassis Section"); bloc_count ++; } // Board @@ -382,7 +382,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, { p_bloc[bloc_count].start = (header.offset.board * 8); p_bloc[bloc_count].size = 0; // Will be fillup later - strcpy(p_bloc[bloc_count].blocId, "Board Section"); + strcpy((char *)p_bloc[bloc_count].blocId, "Board Section"); bloc_count ++; } // Product @@ -390,7 +390,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, { p_bloc[bloc_count].start = (header.offset.product * 8); p_bloc[bloc_count].size = 0; // Will be fillup later - strcpy(p_bloc[bloc_count].blocId, "Product Section"); + strcpy((char *)p_bloc[bloc_count].blocId, "Product Section"); bloc_count ++; } @@ -409,7 +409,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, p_bloc[bloc_count].start = i; p_bloc[bloc_count].size = h->len + sizeof (struct fru_multirec_header); - sprintf(p_bloc[bloc_count].blocId, "Multi-Rec Aread: Type %i", h->type); + sprintf((char *)p_bloc[bloc_count].blocId, "Multi-Rec Aread: Type %i", h->type); bloc_count ++; /*printf("Bloc Start: %i\n", i); printf("Bloc Size : %i\n", h->len); @@ -427,7 +427,7 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, // Bloc for remaining space p_bloc[bloc_count].start = i; p_bloc[bloc_count].size = (fru->size - i); - sprintf(p_bloc[bloc_count].blocId, "Unused space"); + sprintf((char *)p_bloc[bloc_count].blocId, "Unused space"); bloc_count ++; } @@ -1226,13 +1226,13 @@ fru_area_print_multirec(struct ipmi_intf * intf, struct fru_info * fru, uint8_t id, uint32_t offset) { uint8_t * fru_data; - uint32_t fru_len, i, j, toff; + uint32_t fru_len, i; struct fru_multirec_header * h; struct fru_multirec_powersupply * ps; struct fru_multirec_dcoutput * dc; struct fru_multirec_dcload * dl; uint16_t peak_capacity; - uint8_t peak_hold_up_time, bn; + uint8_t peak_hold_up_time; uint32_t last_off, len; i = last_off = offset; @@ -1567,8 +1567,6 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data, int blockstart; uint8_t blockCount; uint8_t blockIndex=0; - unsigned long blockCrc = 0; - unsigned int blockLen = 0; unsigned int matchInstance = 0; unsigned int instance = atoi( argv[OEM_KONTRON_INSTANCE_ARG_POS]); @@ -1579,14 +1577,13 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data, for(blockIndex=0;blockIndex