summaryrefslogtreecommitdiff
path: root/roms/ipxe/src/util/einfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'roms/ipxe/src/util/einfo.c')
-rw-r--r--roms/ipxe/src/util/einfo.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/roms/ipxe/src/util/einfo.c b/roms/ipxe/src/util/einfo.c
index 06736f219..354d475fa 100644
--- a/roms/ipxe/src/util/einfo.c
+++ b/roms/ipxe/src/util/einfo.c
@@ -13,13 +13,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
*/
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -49,7 +51,8 @@ struct einfo {
* @v infile Filename
* @v opts Command-line options
*/
-static void einfo ( const char *infile, struct options *opts ) {
+static void einfo ( const char *infile,
+ struct options *opts __attribute__ (( unused )) ) {
int fd;
struct stat stat;
size_t len;
@@ -85,15 +88,16 @@ static void einfo ( const char *infile, struct options *opts ) {
for ( einfo = start ; ( ( void * ) einfo ) < ( start + len ) ;
einfo = ( ( ( void * ) einfo ) + einfo->size ) ) {
printf ( "%08x\t%s\t%d\t%s\n", einfo->error,
- ( ( ( void * ) einfo ) + einfo->file ),
+ ( ( ( char * ) einfo ) + einfo->file ),
einfo->line,
- ( ( ( void * ) einfo ) + einfo->desc ) );
+ ( ( ( char * ) einfo ) + einfo->desc ) );
}
+ /* Unmap file */
+ munmap ( start, len );
}
- /* Unmap and close file */
- munmap ( start, len );
+ /* Close file */
close ( fd );
}
@@ -115,8 +119,7 @@ static void print_help ( const char *program_name ) {
* @v opts Options structure to populate
*/
static int parse_options ( const int argc, char **argv,
- struct options *opts ) {
- char *end;
+ struct options *opts __attribute__ (( unused )) ) {
int c;
while (1) {
@@ -147,7 +150,7 @@ static int parse_options ( const int argc, char **argv,
int main ( int argc, char **argv ) {
struct options opts = {
};
- unsigned int infile_index;
+ int infile_index;
const char *infile;
/* Parse command-line arguments */