From 1245fbd2a8d60bab7b16b8a1d3c0122fee72f53f Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 5 Jun 2013 00:57:38 +0200 Subject: Nuke trailing whitespace. Signed-off-by: Ralf Baechle --- yamdrv/mcs2h.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'yamdrv/mcs2h.c') diff --git a/yamdrv/mcs2h.c b/yamdrv/mcs2h.c index 6914965..bf1ae72 100644 --- a/yamdrv/mcs2h.c +++ b/yamdrv/mcs2h.c @@ -6,12 +6,12 @@ int in2hex(char *ptr) { char str[3]; int val; - + memcpy(str, ptr, 2); str[2] = '\0'; - + sscanf(str, "%x", &val); - + return val; } @@ -19,7 +19,7 @@ unsigned char swap(unsigned char c) { unsigned char r = 0; int i; - + for (i = 0 ; i < 8 ; i++) { r <<= 1; @@ -34,12 +34,12 @@ int in4hex(char *ptr) { char str[5]; int val; - + memcpy(str, ptr, 4); str[4] = '\0'; - + sscanf(str, "%x", &val); - + return val; } @@ -50,22 +50,22 @@ int main(int ac, char *av[]) time_t temps; FILE *fptr; char buf[256]; - + if (ac != 3) { fprintf(stderr, "format : mcs2h 1200|9600 filename\n"); return 1; } - + fptr = fopen(av[2], "r"); if (fptr == NULL) { fprintf(stderr, "file %s not found\n", av[2]); return 1; } - + time(&temps); - + printf( "/*\n" " *\n" " * File %s converted to h format by mcs2h\n" @@ -84,10 +84,10 @@ int main(int ac, char *av[]) nb = in2hex(buf+1); add = in4hex(buf+3); type = in2hex(buf+7); - + if (type != 0) continue; - + if (first) first = 0; else @@ -98,9 +98,9 @@ int main(int ac, char *av[]) printf("0x%02x%s", swap(in2hex(buf+9+i*2)), (i < (nb-1)) ? "," : ""); } } - + printf(" };\n"); - + fclose(fptr); return 0; } -- cgit v1.2.3