diff options
author | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
commit | 8bde7f776c77b343aca29b8c7b58464d915ac245 (patch) | |
tree | 20f1fd99975215e7c658454a15cdb4ed4694e2d4 /tools/img2srec.c | |
parent | 993cad9364c6b87ae429d1ed1130d8153f6f027e (diff) | |
download | u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.zip u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.bz2 |
* Code cleanup:LABEL_2003_06_27_2340
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'tools/img2srec.c')
-rw-r--r-- | tools/img2srec.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/img2srec.c b/tools/img2srec.c index 330ae02..b04abbd 100644 --- a/tools/img2srec.c +++ b/tools/img2srec.c @@ -351,34 +351,34 @@ static void ConvertELF(char* fileName, DWORD loadOffset) loadAddr = 0; for (i = 0; i < elfHeader.e_shnum; i++) { if ( (sectHeader[i].sh_type == SHT_PROGBITS) - && (sectHeader[i].sh_size != 0) - ) { + && (sectHeader[i].sh_size != 0) + ) { loadSize = sectHeader[i].sh_size; if (sectHeader[i].sh_flags != 0) { - loadAddr = sectHeader[i].sh_addr; - loadDiff = loadAddr - sectHeader[i].sh_offset; + loadAddr = sectHeader[i].sh_addr; + loadDiff = loadAddr - sectHeader[i].sh_offset; } /* if */ else { - loadAddr = sectHeader[i].sh_offset + loadDiff; + loadAddr = sectHeader[i].sh_offset + loadDiff; } /* else */ if (loadAddr < firstAddr) - firstAddr = loadAddr; + firstAddr = loadAddr; /* build s-records */ loadSize = sectHeader[i].sh_size; fseek(file, sectHeader[i].sh_offset, SEEK_SET); while (loadSize) { - rxCount = fread(rxBlock, 1, (loadSize > 32) ? 32 : loadSize, file); - if (rxCount < 0) { - fclose(file); - fprintf (stderr, "*** illegal file format\n"); - return; - } /* if */ - (void)BuildSRecord(srecLine, 3, loadAddr + loadOffset, rxBlock, rxCount); - loadSize -= rxCount; - loadAddr += rxCount; - printf("%s\r\n",srecLine); + rxCount = fread(rxBlock, 1, (loadSize > 32) ? 32 : loadSize, file); + if (rxCount < 0) { + fclose(file); + fprintf (stderr, "*** illegal file format\n"); + return; + } /* if */ + (void)BuildSRecord(srecLine, 3, loadAddr + loadOffset, rxBlock, rxCount); + loadSize -= rxCount; + loadAddr += rxCount; + printf("%s\r\n",srecLine); } /* while */ } /* if */ } /* for */ |