From 6922e6678d247af8c9d63df7a3db2fe83c328f7e Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 25 Feb 2014 00:30:31 +0100 Subject: Get rid of warnings uncovered with clangs -Weverything --- src/export/extract_version_1.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/export/extract_version_1.c') diff --git a/src/export/extract_version_1.c b/src/export/extract_version_1.c index 987c38f..bbe900a 100644 --- a/src/export/extract_version_1.c +++ b/src/export/extract_version_1.c @@ -7,7 +7,7 @@ #include "mystdlib.h" -static char xlat_table[] = { +static uint8_t xlat_table[] = { 0x00, 0x09, 0x02, 0x03, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, @@ -18,7 +18,7 @@ static char xlat_table[] = { 0xfb, 0xf9, 0xff, 0xd6, 0xdc, 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xdf, 0x5b, 0x5c, 0x5d, 0x60 }; -static char cp437_to_iso8859_1_table[] = { +static uint8_t cp437_to_iso8859_1_table[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, @@ -42,7 +42,7 @@ static struct { char * zip; } g_state; -void decode_7bit_string( uint8_t const *source, uint8_t *dest ) +static void decode_7bit_string( uint8_t const *source, uint8_t *dest ) { uint16_t acc = 0, acc_bits = 0; while( 1 ) @@ -55,7 +55,7 @@ again: } } -void split_to_files( uint8_t *entries, int num_entries ) +static void split_to_files( uint8_t *entries, int num_entries ) { int entry = 0, column; char *e = (char*)entries; @@ -74,7 +74,7 @@ void split_to_files( uint8_t *entries, int num_entries ) if( end ) { *end = '\n'; if( column == 9 && *e >= '0' && *e <= '9' ) write( g_state.outfiles[column+1], "0", 1 ); /* Augment Vorwahl */ - write( g_state.outfiles[column+1], e, end - e + 1); + write( g_state.outfiles[column+1], e, (size_t)(end - e + 1) ); e = end + 1; } else dprintf( g_state.outfiles[column+1], "%s\n", e); @@ -82,7 +82,7 @@ void split_to_files( uint8_t *entries, int num_entries ) } } -void act_on_record( uint8_t *file, int flag, uint8_t *page, uint16_t record_off ) +static void act_on_record( uint8_t *file, int flag, uint8_t *page, uint16_t record_off ) { uint8_t outbuf[8192], *out_dest = outbuf, *record; int num_entries; @@ -116,7 +116,7 @@ void act_on_record( uint8_t *file, int flag, uint8_t *page, uint16_t record_off } /* Page is always 0x2000 */ -void act_on_page( uint8_t *file, uint8_t *page, int page_nr ) +static void act_on_page( uint8_t *file, uint8_t *page, int page_nr ) { int record, flag = page[0]; int blob_len = *(uint16_t*)(page + 0x2); @@ -131,17 +131,17 @@ void act_on_page( uint8_t *file, uint8_t *page, int page_nr ) act_on_record( file, flag, page + 0xe, recs[record] ); } -void act_on_file( uint8_t *file ) +static void act_on_file( uint8_t *file ) { int page, num_pages = *(uint16_t*)(file+0x40); - int num_records = *(uint32_t*)(file+0x42); + uint32_t num_records= *(uint32_t*)(file+0x42); char *gasse = (char *)file + 0x8e; char *ort = gasse + 1 + strlen(gasse); char *zip = ort + 1 + strlen(ort); char *vorwahl = zip + 1 + strlen(zip); char ort_conv[1024]; int i; - for(i=0; ort[i]; ++i ) ort_conv[i] = cp437_to_iso8859_1_table[((uint8_t*)ort)[i]]; ort_conv[i] = 0; + for(i=0; ort[i]; ++i ) ort_conv[i] = (char)cp437_to_iso8859_1_table[((uint8_t*)ort)[i]]; ort_conv[i] = 0; /* printf( "Working on a %04d page and %06d records file, city: %4s %-32s with prefix %s\n", num_pages, num_records, zip, ort_conv, vorwahl ); */ (void)num_records; /* silence warning about unused variable */ -- cgit v1.2.3